管理津贴订单增加下单人信息
parent
161478fdca
commit
a08bdab76c
|
|
@ -22,7 +22,7 @@ class ManageSubsidyLogController extends Controller
|
||||||
|
|
||||||
$perPage = Paginator::resolvePerPage('per_page', 20, 50);
|
$perPage = Paginator::resolvePerPage('per_page', 20, 50);
|
||||||
|
|
||||||
$manageSubsidyLogs = DealerManageSubsidyLog::with(['product', 'order'])
|
$manageSubsidyLogs = DealerManageSubsidyLog::with(['product', 'order.user'])
|
||||||
->when($isComplted, function ($query) {
|
->when($isComplted, function ($query) {
|
||||||
$tz = now();
|
$tz = now();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,11 @@ class OrderSimpleResource extends JsonResource
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'sn' =>$this->sn,
|
'sn' =>$this->sn,
|
||||||
'total_amount' => $this->total_amount,
|
'total_amount' => $this->total_amount,
|
||||||
'paied_time' => $this->paied_time?->toDateTimeString(),
|
|
||||||
'shippinged_time' => $this->shippinged_time?->toDateTimeString(),
|
|
||||||
'created_at' => $this->created_at->toDateTimeString(),
|
'created_at' => $this->created_at->toDateTimeString(),
|
||||||
'status' => $this->status,
|
'status' => $this->status,
|
||||||
'is_consignor' => $request->user()->id == $this->consignor_id, //是否发货人身份
|
'is_consignor' => $request->user()->id == $this->consignor_id, //是否发货人身份
|
||||||
'products' => OrderProductResource::collection($this->whenLoaded('products')),
|
'products' => OrderProductResource::collection($this->whenLoaded('products')),
|
||||||
|
'user' => UserResource::make($this->whenLoaded('user')),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Endpoint\Api\Http\Resources\Dealer;
|
||||||
|
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
|
class UserResource extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
||||||
|
*/
|
||||||
|
public function toArray($request)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $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,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue