all(); $param['poi_id'] = $request->user['store_id']; $productType = $this->goodsService->productType(); $data = $this->service->setModel()->getList($param,['product' => function($query) use($productType){ $query->field("product_id,product_name,product_type")->append(['types'])->withAttr(['types' => function($query,$resp) use($productType){ $productTypeArr = []; foreach ($productType as $val) { $productTypeArr[$val['key']] = $val['name']; } return $productTypeArr[$resp['product_type']]??''; }]); }]); return successTrans("success.data",pageFormat($data),200); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }