diff --git a/app/Endpoint/Api/Http/Controllers/Dealer/ManageSubsidyLogController.php b/app/Endpoint/Api/Http/Controllers/Dealer/ManageSubsidyLogController.php index 098742fe..b4b3dbbc 100644 --- a/app/Endpoint/Api/Http/Controllers/Dealer/ManageSubsidyLogController.php +++ b/app/Endpoint/Api/Http/Controllers/Dealer/ManageSubsidyLogController.php @@ -22,7 +22,7 @@ class ManageSubsidyLogController extends Controller $perPage = Paginator::resolvePerPage('per_page', 20, 50); - $manageSubsidyLogs = DealerManageSubsidyLog::with(['product', 'order']) + $manageSubsidyLogs = DealerManageSubsidyLog::with(['product', 'order.user']) ->when($isComplted, function ($query) { $tz = now(); diff --git a/app/Endpoint/Api/Http/Resources/Dealer/OrderSimpleResource.php b/app/Endpoint/Api/Http/Resources/Dealer/OrderSimpleResource.php index 05e0d184..ae509660 100644 --- a/app/Endpoint/Api/Http/Resources/Dealer/OrderSimpleResource.php +++ b/app/Endpoint/Api/Http/Resources/Dealer/OrderSimpleResource.php @@ -18,12 +18,11 @@ class OrderSimpleResource extends JsonResource 'id' => $this->id, 'sn' =>$this->sn, 'total_amount' => $this->total_amount, - 'paied_time' => $this->paied_time?->toDateTimeString(), - 'shippinged_time' => $this->shippinged_time?->toDateTimeString(), 'created_at' => $this->created_at->toDateTimeString(), 'status' => $this->status, 'is_consignor' => $request->user()->id == $this->consignor_id, //是否发货人身份 'products' => OrderProductResource::collection($this->whenLoaded('products')), + 'user' => UserResource::make($this->whenLoaded('user')), ]; } } diff --git a/app/Endpoint/Api/Http/Resources/Dealer/UserResource.php b/app/Endpoint/Api/Http/Resources/Dealer/UserResource.php new file mode 100644 index 00000000..fd30cf4f --- /dev/null +++ b/app/Endpoint/Api/Http/Resources/Dealer/UserResource.php @@ -0,0 +1,26 @@ + $this->id, + 'phone' => $this->phone, + 'nickname' => (string) $this->userInfo->nickname, + 'avatar' => (string) $this->userInfo->avatar, + 'gender' => (string) $this->userInfo->gender, + 'code' => (string) $this->userInfo->code, + ]; + } +}