소스 검색

退款统计金额异常

gorden 1 일 전
부모
커밋
6c4dcd9961
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      app/admin/controller/order/RefundController.php

+ 5 - 0
app/admin/controller/order/RefundController.php

@@ -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,