request->get(); $get['page_no'] = $get['page_no'] ?? $this->page_no; $get['page_size'] = $get['page_size'] ?? $this->page_size; $get['type'] = $get['type'] ?? 1; $get['user_id'] = $this->user_id; $result = LocalStoreGoodsLogic::lists($get); if ($result) { return JsonServer::success('获取成功', $result); } return JsonServer::error('获取失败'); } // 商家添加商品 public function saveGoods() { $form = $this->request->post(); (new LocalStoreGoodsValidate())->goCheck(); $result = LocalStoreGoodsLogic::saveGoods($form, $this->user_id); if ($result === false) { $error = LocalStoreGoodsLogic::getError() ?: '提交失败'; return JsonServer::error($error); } return JsonServer::success('提交成功', [], 1, 1); } public function shopDetails() { $get = $this->request->get(); $get['user_id'] = $this->user_id; $result = LocalStoreGoodsLogic::shop_details($get); if ($result) { return JsonServer::success('获取成功', $result); } return JsonServer::error('获取失败'); } public function details() { $get = $this->request->get(); $get['user_id'] = $this->user_id; $result = LocalStoreGoodsLogic::details($get); if ($result) { return JsonServer::success('获取成功', $result); } return JsonServer::error('获取失败'); } public function setState() { $form = $this->request->post(); $result = LocalStoreGoodsLogic::setState($form, $this->user_id); if ($result) { return JsonServer::success('操作成功'); } return JsonServer::error('操作失败'); } }