all(); $param['poi_id'] = $request->user['store_id']; $param['is_deleted'] = 1; $data = $this->service->setModel()->getList($param,['store' => function($query){ $query->field("poi_id,poi_name,poi_address,poi_city"); },'goods' => function($query){ $query->field("goods_id,image_list,product_name,price,line_price"); }]); return successTrans("success.data",pageFormat($data),200); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } #[PostMapping('save')] public function setDataDetail(Request $request): Response { try { [$state,$msg] = $this->checkDeposit($request->user['store_id']); if (!$state) return error($msg); $param = $request->all(); $param['poi_id'] = $request->user['store_id']; $state = $this->model->setAutoData($param); if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $th) { return error($th->getMessage()); } } #[PostMapping("del")] public function delGoods(Request $request): Response { try { $param = $this->_valid([ "id.require" => trans("empty.require"), ],$request->method()); if (!is_array($param)) return error($param); $detail = $this->model->where("id",$param["id"])->findOrEmpty(); if ($detail->isEmpty()) return errorTrans("empty.data"); if ($detail['poi_id'] <> $request->user['store_id']) return error("非法操作"); $detail->is_deleted = 0; $state = $detail->save(); if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }