Răsfoiți Sursa

退款统计金额异常

gorden 1 zi în urmă
părinte
comite
aa256efabd
1 a modificat fișierele cu 11 adăugiri și 11 ștergeri
  1. 11 11
      app/admin/controller/order/RefundController.php

+ 11 - 11
app/admin/controller/order/RefundController.php

@@ -172,31 +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);
+        $total['amount'] = sprintf('%.2f', 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);
+        $pendingTotal['amount'] = sprintf('%.2f', 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);
+        $doingTotal['amount'] = sprintf('%.2f', 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);
+        $disagreeTotal['amount'] = sprintf('%.2f', 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);
+        $doneTotal['amount'] = sprintf('%.2f', round($doneTotal['amount'], 2));
 
         return json_success('success', [
             'total' => $total,
@@ -243,7 +243,7 @@ class RefundController extends Curd
         $orderId = $request->get('order_id');
         $orderSheet = OrderSheet::with([
             'member' => function ($query) {
-                $query->select('member_id', 'member_mobile', 'join_member_role_id', 'member_is_owner', 'member_is_vip', 'member_is_partner', 'member_is_referrer','member_is_franchisee');
+                $query->select('member_id', 'member_mobile', 'join_member_role_id', 'member_is_owner', 'member_is_vip', 'member_is_partner', 'member_is_referrer', 'member_is_franchisee');
             },
             'goods' => function ($query) {
                 $query->select('goods_id', 'goods_name', 'goods_cover', 'goods_market_price', 'goods_sales_price', 'goods_classify');
@@ -489,7 +489,7 @@ class RefundController extends Curd
         $payDetail = PayDetail::where('join_pay_order_id', $order->order_groupby)
             ->whereJsonContains('join_pay_object_json->order_id', $orderId)
             ->where('pay_status', 'SUCCESS')
-            ->where('pay_prepayid','<>','')
+            ->where('pay_prepayid', '<>', '')
             ->whereIn('pay_category', ['GOODS', 'SERVICE', 'CHNMED', 'CHNNCD', 'MEALS', 'DISHES', 'VIP', 'PACKAGE'])
             ->get()
             ->toArray();
@@ -625,7 +625,7 @@ class RefundController extends Curd
             throw new BusinessException("余额账户异常");
         }
         $account->member_account_surplus = $account->member_account_surplus + $amount;
-        $account->member_account_expend  = $account->member_account_expend - $amount;
+        $account->member_account_expend = $account->member_account_expend - $amount;
         $account->member_account_update_user_id = JwtToken::getCurrentId();
         $account->member_account_updatetimes = time();
         $account->save();
@@ -648,7 +648,7 @@ class RefundController extends Curd
             throw new BusinessException("余额账户异常");
         }
         $account->member_account_surplus = $account->member_account_surplus + $amount;
-        $account->member_account_expend  = $account->member_account_expend - $amount;
+        $account->member_account_expend = $account->member_account_expend - $amount;
         $account->member_account_update_user_id = JwtToken::getCurrentId();
         $account->member_account_updatetimes = time();
         $account->save();
@@ -671,7 +671,7 @@ class RefundController extends Curd
             throw new BusinessException("余额账户异常");
         }
         $account->member_account_surplus = $account->member_account_surplus + $amount;
-        $account->member_account_expend  = $account->member_account_expend - $amount;
+        $account->member_account_expend = $account->member_account_expend - $amount;
         $account->member_account_update_user_id = JwtToken::getCurrentId();
         $account->member_account_updatetimes = time();
         $account->save();
@@ -695,7 +695,7 @@ class RefundController extends Curd
             throw new BusinessException("储值卡账户异常");
         }
         $account->member_account_surplus = $account->member_account_surplus + $amount;
-        $account->member_account_expend  = $account->member_account_expend - $amount;
+        $account->member_account_expend = $account->member_account_expend - $amount;
         $account->member_account_update_user_id = JwtToken::getCurrentId();
         $account->member_account_updatetimes = time();
         $account->save();