|
|
@@ -167,16 +167,23 @@ class DistributionController extends BackendController |
|
|
|
] ; |
|
|
|
} |
|
|
|
|
|
|
|
$arrayCreditUser = [] ; |
|
|
|
if(isset($order->user) && isset($order->user->userProducer)) { |
|
|
|
$arrayCreditUser['credit'] = $order->user->userProducer[0]->credit ; |
|
|
|
} |
|
|
|
|
|
|
|
$order = array_merge($order->getAttributes(), [ |
|
|
|
'amount' => $order->getAmount(Order::AMOUNT_TOTAL), |
|
|
|
'amount_paid' => $order->getAmount(Order::AMOUNT_PAID), |
|
|
|
'amount_remaining' => $order->getAmount(Order::AMOUNT_REMAINING), |
|
|
|
'amount_surplus' => $order->getAmount(Order::AMOUNT_SURPLUS), |
|
|
|
'user' => (isset($order->user)) ? $order->user->getAttributes() : null, |
|
|
|
'user' => (isset($order->user)) ? array_merge($order->user->getAttributes(), $arrayCreditUser) : null, |
|
|
|
'pointSale' => ['id' => $order->pointSale->id, 'name' => $order->pointSale->name], |
|
|
|
'productOrder' => $productOrderArray, |
|
|
|
'creditHistory' => $creditHistoryArray |
|
|
|
]) ; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|