dever 3 년 전
부모
커밋
9a54dc3b1b
2개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      app/mshop/lib/Manage.php
  2. 10 1
      app/shop/lib/Refund.php

+ 4 - 0
app/mshop/lib/Manage.php

@@ -34,6 +34,10 @@ class Manage
             $status = 2;
         }
 
+        if (!$shop_id || !$order_id) {
+            return;
+        }
+
         return Dever::load('shop/lib/refund')->set('sell')->apply(2, $shop_id, $order_id, $order_goods_id, $status, $num, $desc, '', 2, $buy_status);
     }
 }

+ 10 - 1
app/shop/lib/Refund.php

@@ -150,13 +150,22 @@ class Refund
                         $num = $info['num'];   
                     }
                     Dever::db($this->goods_table)->update(array('where_id' => $info['id'], 'status' => 2));
-                    $info['total_price'] = $info['price'] * $num;
                 	if (isset($info['coupon_cash']) && $info['coupon_cash']) {
                 		$cash = $info['total_price'] - $info['coupon_cash'];
                 	} else {
                 		$cash = $info['total_price'];
                 	}
 
+                    $kou = $data['card_code_cash'] + $data['wallet_cash'];
+                    $info['total_price'] = $info['price'] * $num;
+                    if ($kou > 0) {
+                        if ($info['total_price'] >= $kou) {
+                            $cash = $info['total_price'] - $kou;
+                        } else {
+                            $cash = 0;
+                        }
+                    }
+
                     if (isset($info['p_price'])) {
                         $p_cash = $info['p_price'] * $num;
                     } else {