mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-23 14:34:19 +00:00
update replica packages logic and over weight price announcement
This commit is contained in:
@@ -17,7 +17,7 @@ class PackingListResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
$exceptionUsers = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]);
|
||||
$packages = !$this->packingLists()->exists() ? $this->packages : $this->packingLists->first()->packages;
|
||||
$packages = !$this->packingLists()->exists() || $exceptionUsers ? $this->packages : $this->packingLists->first()->packages;
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
@@ -27,6 +27,7 @@ class PackingListResource extends JsonResource
|
||||
'transport' => new TransportResource($this->transports()->first()),
|
||||
'type' => $this->type,
|
||||
'packages' => PackageResource::collection($packages),
|
||||
'packing_list' => new PackingListResource($replica),
|
||||
$this->mergeWhen($this->owner instanceof Order, [
|
||||
'order' => New OrderResource($this->owner)
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user