Browse Source

Merge branch 'master' into dev

gorden 1 day ago
parent
commit
efbafc10ba
1 changed files with 11 additions and 6 deletions
  1. 11 6
      app/admin/controller/order/RefundController.php

+ 11 - 6
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'] = 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'] = 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'] = 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'] = 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'] = sprintf('%.2f', round($doneTotal['amount'], 2));
 
         return json_success('success', [
             'total' => $total,
@@ -238,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');
@@ -484,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();
@@ -620,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();
@@ -643,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();
@@ -666,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();
@@ -690,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();