|
|
@@ -120,5 +120,30 @@ class Plan extends Base
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ #[GetMapping('detail')]
|
|
|
+ public function detailPlan(Request $request): Response
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $param = $this->_valid([
|
|
|
+ "id.require" => trans("empty.require"),
|
|
|
+ ],$request->method());
|
|
|
+ if (!is_array($param)) return error($param);
|
|
|
+ $plan = $this->model->where("id",$param['id'])->with(['goods' => function ($query) {
|
|
|
+ $query->with(['goods' => function($subQue){
|
|
|
+ $subQue->field("goods_id,product_name,image_list,product_id,price,line_price,limit_use_rule,use_num_per_consume,status");
|
|
|
+ }]);
|
|
|
+ },'star' => function ($query) {
|
|
|
+ $query->with(['star' => function($subQue){
|
|
|
+ $subQue->field("unique_id,avatar_url,show_nickname,fans_count,fans_tag_list,local_fans_count,talent_item_level_display,talent_live_level_display,content_level_display,credit_score_display,city_name,rank_display,status");
|
|
|
+ }]);
|
|
|
+ }])->findOrEmpty();
|
|
|
+ if ($plan->isEmpty()) return errorTrans("empty.data");
|
|
|
+ if ($plan['poi_id'] <> $request->user['store_id']) return errorTrans("empty.data");
|
|
|
+ return successTrans("success.data",$plan->toArray());
|
|
|
+ } catch (\Throwable $throwable) {
|
|
|
+ return error($throwable->getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|