all(); $param['poi_id'] = $request->user['store_id']; $productType = (new GoodsService)->productType(); $data = $this->service->setModel()->getList($param,['orders' => function($query) use ($productType) { $query->field("order_sn,product_id,img")->with(['product' => function($query) use($productType){ $query->field("product_id,product_name,product_type")->append(['types'])->withAttr(['types' => function($data,$next) use($productType){ $productTypeArr = []; foreach ($productType as $val) { $productTypeArr[$val['key']] = $val['name']; } return $productTypeArr[$next['product_type']]??''; }]); }]); },'poi' => function($query){ $query->field("poi_id,poi_name,poi_address,nick_name"); }]); return successTrans(100010,pageFormat($data),200); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }