all(); $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']]??''; }]); },'user' => function($query){ $query->field("openid,nickname,avatar"); },'poi' => function($query){ $query->field("poi_id,poi_name,poi_address,nick_name"); },"star" => function($query){ $query->field("uid,nick_name,avatar_url,unique_id"); }],true,['end_time','refund_num'],["end_time" => function ($resp,$next) { return timeDiff(strtotime("+30 minutes",strtotime($next['create_at'])),time()); },'refund_num' => function($resp,$next){ if ($next['status'] == 6) { return (new SaasOrderItem)->where(['order_sn' => $next['order_sn'],'status' => 2])->count()??0; } return 0; }]); return successTrans("success.data",pageFormat($data),200); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }