Your Name 2 年之前
父節點
當前提交
665c32a071
共有 1 個文件被更改,包括 30 次插入14 次删除
  1. 30 14
      tool/stats/lib/Manage.php

+ 30 - 14
tool/stats/lib/Manage.php

@@ -182,7 +182,7 @@ Class Manage
 	                $money = 0;
 	                 if ($v['status'] == 8 || $v['status'] == 6) {
 	                    $num = $v1['num'];
-	                    // $refund_cash = $v1['price']*$v1['num'];
+	                    $refund_cash = $v1['price']*$v1['num'];
 	                    if ($v['status'] == 8) {
 	                    	if ($v['refund_cash'] && $v['refund_cash']>0) {
 		                    	$money = $v['refund_cash'];
@@ -197,6 +197,13 @@ Class Manage
 	                    		$money = $v['refund_cash'];
 	                    	}
 	                    }
+	                    if ($k1 == 0) {
+	                    	$ka = $ka;
+	                    	$money = $money;
+	                    } else {
+	                    	$ka = 0;
+	                    	$money = 0;
+	                    }
 	                    
 	                    $refund_status = '已退款';
 	                    $refund_cdate = '';
@@ -211,13 +218,27 @@ Class Manage
 	                	#有退款的情况
 		                if ($v['refund_status'] == 3 && $v1['status'] == 3) {
 		                	$refund_status = '有退款';
-		                	// $refund_cash = $v1['num']*$v1['price'];
-	                		if ($v['card_code_id'] && $v['card_code_id'] >0) {
-	                    		$ka = $v['refund_cash'];
-	                    	} else {
-	                    		$money = $v['refund_cash'];
-	                    	}
-		   
+		                	$refund_cash = $v1['num']*$v1['price'];
+		                	if ($refund_cash)
+		                	if ($v['refund_cash']>$refund_cash) {
+		                		if ($k1 == 0) {
+			                    	if ($v['card_code_cash'] && $v['card_code_cash'] >0) {
+				                    	$ka = $v['refund_cash'];
+				                    } else {
+				                    	$money = $v['refund_cash'];
+				                    }
+			                    }else {
+			                    	$ka = 0;
+			                    	$money = 0;
+			                    }
+		                	} else {
+		                		if ($v['card_code_id'] && $v['card_code_id'] >0) {
+				                    	$ka = $v['refund_cash'];
+				                    } else {
+				                    	$money = $v['refund_cash'];
+				                    }
+		                	}
+		                    
 		                    $refund_cdate = '';
 		                    if ($v['shop_type'] == 1) {
 		                    	$refund = Dever::db('shop/sell_order_refund')->find(array('order_id'=>$v['id']));
@@ -244,9 +265,7 @@ Class Manage
 	                    $card_code_cash = round($v['card_code_cash'],2);#礼品卡金额
 						$wallet_cash = round($v['wallet_cash'],2);#钱包金额
 						$discount_cash = round($v['discount_cash'],2);
-	                    $refund_cash = $v['refund_cash'];
-	                    $ka = $ka;
-	                    $money = $money;
+	                    
 	                } else {
 	                    $v['num'] = 0;
 	                    
@@ -256,9 +275,6 @@ Class Manage
 	                    $card_code_cash = 0;
 	                    $wallet_cash = 0;
 	                    $discount_cash = 0;
-	                    $refund_cash = 0;
-	                    $ka = 0;
-		                $money = 0;
 	                    
 	                }
 	                // print_R($v['price']);die;