|
@@ -172,26 +172,31 @@ class RefundController extends Curd
|
|
|
$total = $totalModel->selectRaw("SUM(JSON_UNQUOTE(JSON_EXTRACT(order_return_apply_json,'$.amount'))) as amount,count(orders_return_id) as total")
|
|
|
->first()
|
|
|
->toArray();
|
|
|
+ $total['amount'] = round($total['amount'],2);
|
|
|
$pendingTotalModel = clone $returnModel;
|
|
|
$pendingTotal = $pendingTotalModel->where('order_return_status', 'PENDING')
|
|
|
->selectRaw("SUM(JSON_UNQUOTE(JSON_EXTRACT(order_return_apply_json,'$.amount'))) as amount,count(orders_return_id) as total")
|
|
|
->first()
|
|
|
->toArray();
|
|
|
+ $pendingTotal['amount'] = round($pendingTotal['amount'],2);
|
|
|
$doingTotalModel = clone $returnModel;
|
|
|
$doingTotal = $doingTotalModel->where('order_return_status', 'DOING')
|
|
|
->selectRaw("SUM(JSON_UNQUOTE(JSON_EXTRACT(order_return_apply_json,'$.amount'))) as amount,count(orders_return_id) as total")
|
|
|
->first()
|
|
|
->toArray();
|
|
|
+ $doingTotal['amount'] = round($doingTotal['amount'],2);
|
|
|
$disagreeTotalModel = clone $returnModel;
|
|
|
$disagreeTotal = $disagreeTotalModel->where('order_return_status', 'DISAGREE')
|
|
|
->selectRaw("SUM(JSON_UNQUOTE(JSON_EXTRACT(order_return_apply_json,'$.amount'))) as amount,count(orders_return_id) as total")
|
|
|
->first()
|
|
|
->toArray();
|
|
|
+ $disagreeTotal['amount'] = round($disagreeTotal['amount'],2);
|
|
|
$doneTotalModel = clone $returnModel;
|
|
|
$doneTotal = $doneTotalModel->where('order_return_status', 'DONE')
|
|
|
->selectRaw("SUM(JSON_UNQUOTE(JSON_EXTRACT(order_return_apply_json,'$.amount'))) as amount,count(orders_return_id) as total")
|
|
|
->first()
|
|
|
->toArray();
|
|
|
+ $doneTotal['amount'] = round($doneTotal['amount'],2);
|
|
|
|
|
|
return json_success('success', [
|
|
|
'total' => $total,
|