gorden пре 5 месеци
родитељ
комит
022f162ba2
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      app/admin/controller/order/RefundController.php

+ 4 - 1
app/admin/controller/order/RefundController.php

@@ -302,18 +302,21 @@ class RefundController extends Curd
         $response = [];
         $response = [];
         Db::beginTransaction();
         Db::beginTransaction();
         try {
         try {
+            dump("开始退券",sprintf("%.2f", $amount),sprintf("%.2f", $order->order_amount_pay));
             // 全额退款,检查优惠券,恢复可使用
             // 全额退款,检查优惠券,恢复可使用
             if (sprintf("%.2f", $amount) == sprintf("%.2f", $order->order_amount_pay)) {
             if (sprintf("%.2f", $amount) == sprintf("%.2f", $order->order_amount_pay)) {
                 if (!empty($order->order_discount_json)) {
                 if (!empty($order->order_discount_json)) {
+                    dump("有优惠");
                     $discountJson = json_decode($order->order_discount_json, true);
                     $discountJson = json_decode($order->order_discount_json, true);
                     foreach ($discountJson as $item){
                     foreach ($discountJson as $item){
                         if (empty($item['coupon_id'])){
                         if (empty($item['coupon_id'])){
                             continue;
                             continue;
                         }
                         }
 
 
+                        dump("检查是否有拆单");
                         // 是否有其他订单一起使用优惠券
                         // 是否有其他订单一起使用优惠券
                         if(!Order::where('order_groupby',$order->order_groupby)->where('order_id','<>',$order->order_id)->where('order_is_complete','<>','R')->exists()){
                         if(!Order::where('order_groupby',$order->order_groupby)->where('order_id','<>',$order->order_id)->where('order_is_complete','<>','R')->exists()){
-                            dump("有没退的");
+                            dump("有没退的");
                             CouponDetail::where('coupon_detail_id',$item['coupon_id'])->update([
                             CouponDetail::where('coupon_detail_id',$item['coupon_id'])->update([
                                 'coupon_detail_status'=>'ACTIVED',
                                 'coupon_detail_status'=>'ACTIVED',
                                 'coupon_detail_used_datetime'=>''
                                 'coupon_detail_used_datetime'=>''