Your Name 2 years ago
parent
commit
c8dabb339f
1 changed files with 20 additions and 17 deletions
  1. 20 17
      tool/stats/lib/Manage.php

+ 20 - 17
tool/stats/lib/Manage.php

@@ -161,14 +161,14 @@ Class Manage
 	                }
 	                $goods_price = $v1['price']*$v1['num'];
 	                #代理优惠金额
-	                $discount_cash = round($v['discount_cash']/$goods_price,2);
+	                $discount_cash = round($v['discount_cash'],2);
 	                #商品实付金额
 	                $price = round(($goods_price/$v['oprice']*$v['price']),2);
 	                //round(($v['price']/$goods_price),2);
 	                #礼品卡金额
 	                $card_code_cash = round($v['card_code_cash'],2);
 	                #钱包金额
-	                $wallet_cash = round(($v['wallet_cash']/$goods_price),2);
+	                $wallet_cash = round($v['wallet_cash'],2);
 	                #商品支付金额
 	                if ($k1 == 0) {
 	                	$total_cash = Dever::load("shop/lib/manage.getTotalCash", $v['id']);
@@ -224,6 +224,7 @@ Class Manage
 	                    $v['discount_cash'] = $v['discount_cash'];
 	                    $card_code_cash = round($v['card_code_cash'],2);#礼品卡金额
 						$wallet_cash = round($v['wallet_cash'],2);#钱包金额
+						$discount_cash = round($v['discount_cash'],2);
 	                    $ka = $ka;
 	                    $money = $money;
 	                } else {
@@ -235,6 +236,7 @@ Class Manage
 	                    $v['discount_cash'] = 0;
 	                    $card_code_cash = 0;
 	                    $wallet_cash = 0;
+	                    $discount_cash = 0;
 	                    $ka = 0;
 	                    $money = 0;
 	                }
@@ -250,14 +252,15 @@ Class Manage
                     	$goods_info['name'],
 						$sku,
 						$goods_info['tax'],
-						round($v1['price'], 2),
-						round($v1['num'],2),
-						round($v1['price']*$v1['num'], 2),
-						$discount_cash,
-						$price,
-						$card_code_cash,
-						$wallet_cash,
-						$price,
+
+						round($v1['price'], 2),//商品单价
+						round($v1['num'],2),//商品数量
+						round($v1['price']*$v1['num'], 2),//商品合计金额
+						$discount_cash,//代理商优惠金额
+						$price,//商品实付金额
+						$card_code_cash,//礼品卡
+						$wallet_cash, //钱包
+						$price,//商品支付
 						$v['card'],
 						$v['card_code']."\t",
 						$zhuce,
@@ -265,13 +268,13 @@ Class Manage
 						$paydate,
 						$operdate,
 						$fdate,
-						$v1['num'],
-						sprintf('%01.2f',$total_cash),
-	                    round($v['price'], 2),
-	                    sprintf('%01.2f',$v['card_code_cash']),
-	                    round($v['wallet_cash'], 2),
-	                    round($v['coupon_cash'], 2),
-	                    round($v['discount_cash'], 2),
+						$v1['num'],//订单总量
+						sprintf('%01.2f',$total_cash),//订单总金额
+	                    round($v['price'], 2),//订单实付
+	                    sprintf('%01.2f',$v['card_code_cash']),//礼品卡
+	                    round($v['wallet_cash'], 2),//钱包
+	                    round($v['coupon_cash'], 2),//优惠券
+	                    round($v['discount_cash'], 2),//代理优惠
 	                    $status[$v['status']],
 	                    $refund_status,
 	                    $refund_cdate,