Your Name 2 سال پیش
والد
کامیت
4e0b2f3549
1فایلهای تغییر یافته به همراه25 افزوده شده و 14 حذف شده
  1. 25 14
      service/mail/lib/Manage.php

+ 25 - 14
service/mail/lib/Manage.php

@@ -580,6 +580,13 @@ class Manage
         $data = Dever::db('shop/buy_order')->getNewAll($where);
         $res = array();
         $money = 0;
+        $res['money'] = 0;
+        if($data && isseet($data['price']) && $data['price']){
+            $res['price'] = $data['price'];
+        }else{
+            $res['price'] = 0;
+        }
+        
         foreach($data as $k => $v){
             // $goods_id,$skuid
             $order_goods = Dever::db('shop/buy_order_goods')->select(array('order_id' => $v['id']));
@@ -590,10 +597,11 @@ class Manage
                     $c_price += $goods['c_price'] * $v1['num'];
                 }
             }
-            $money += ($v['price'] - $c_price);
+            $res['money'] += ($v['price'] - $c_price);
         }
-        return $money;
+        return $res;
     }
+    #零售
     public function ls($where,$type=false){
         $shop = Dever::db('mail/area_entry')->getNewAll($where);
         $data = array();
@@ -638,8 +646,8 @@ class Manage
                 $where['area'] = $v['city'];
                 $data[$k]['citys']['area'] = $v['province'].','.$v['city'];
                 $jia = $this->caigou($where);
-                $data[$k]['citys']['money'] = Dever::db('shop/buy_order')->getSerachMoney($where);
-                $data[$k]['citys']['price']= $jia * 0.01;
+                // $data[$k]['citys']['money'] = Dever::db('shop/buy_order')->getSerachMoney($where);
+                $data[$k]['citys']['price']= $jia['money'] * 0.01;
                 // $data[$k]['citys']['price']= round($data[$k]['citys']['money']['total']) * 0.3*0.01;
                 $mid = Dever::db('agent/member')->getAreaAll(array('area'=>$data[$k]['citys']['area'],'role'=>2));
                 $w['citys']['area'] = $v['city'];
@@ -659,7 +667,7 @@ class Manage
                 $data[$k]['citys']['t_num'] = count($t_shop);
                 if($data[$k]['citys']['t_num']>0){
                     $data[$k]['citys']['t_price'] = Dever::db('shop/buy_order')->getSerachTMoney($where);
-                    $data[$k]['citys']['t_fprice'] = $data[$k]['citys']['t_price']['total'] * 0.01;
+                    $data[$k]['citys']['t_fprice'] = $data[$k]['citys']['price'];
                 }else{
                     $data[$k]['citys']['t_price'] = 0;
                     $data[$k]['citys']['t_fprice'] = 0;
@@ -673,7 +681,8 @@ class Manage
                 $w['mid'] = $data[$k]['citys']['mid'];
                 $w['area'] = $data[$k]['citys']['area'];
                 $w['price'] = $data[$k]['citys']['price'];
-                $w['c_price'] = $data[$k]['citys']['money']['total'];
+                $w['c_price'] = $jia['price'];
+                // $data[$k]['citys']['money']['total'];
                 $w['num'] = $data[$k]['citys']['num'];
                 $w['t_num'] = $data[$k]['citys']['t_num'];
                 $w['t_price'] = $data[$k]['citys']['t_price']['total'];
@@ -695,9 +704,9 @@ class Manage
             if($v['county']>0){
                 $where['area'] = $v['county'];
                 $data[$k]['countys']['area'] = $v['province'].','.$v['city'].','.$v['county'];
-                $data[$k]['countys']['money'] = Dever::db('shop/buy_order')->getSerachMoney($where);
+                // $data[$k]['countys']['money'] = Dever::db('shop/buy_order')->getSerachMoney($where);
                 $jia = $this->caigou($where);
-                $data[$k]['countys']['price']= $jia *0.03;
+                $data[$k]['countys']['price']= $jia['money'] *0.03;
                 // $data[$k]['countys']['price']= round($data[$k]['countys']['money']['total']) * 0.3*0.03;
                 $mid = Dever::db('agent/member')->getAreaAll(array('area'=>$data[$k]['countys']['area'],'role'=>3));
                 if($mid && $mid['id']){
@@ -714,7 +723,7 @@ class Manage
                 $data[$k]['countys']['t_num'] = count($t_shop);
                 if($data[$k]['countys']['t_num']>0){
                     $data[$k]['countys']['t_price'] = Dever::db('shop/buy_order')->getSerachTMoney($where);
-                    $data[$k]['countys']['t_fprice'] = $data[$k]['countys']['t_price']['total'] * 0.03;
+                    $data[$k]['countys']['t_fprice'] = $data[$k]['countys']['price'];
                 }else{
                     $data[$k]['countys']['t_price'] = 0;
                     $data[$k]['countys']['t_fprice'] = 0;
@@ -732,7 +741,8 @@ class Manage
                 $w['area'] = $data[$k]['countys']['area'];
                 $w['price'] = $data[$k]['countys']['price'];
                 $w['num'] = $data[$k]['countys']['num'];
-                $w['c_price'] = $data[$k]['countys']['money']['total'];
+                $w['c_price'] = $jia['price'];
+                // $data[$k]['countys']['money']['total'];
                 $w['t_num'] = $data[$k]['countys']['t_num'];
                 $w['t_price'] = $data[$k]['countys']['t_price']['total'];
                 $w['t_fprice'] = $data[$k]['countys']['t_fprice'];
@@ -751,9 +761,9 @@ class Manage
             if($v['town']>0){
                 $where['area'] = $v['town'];
                 $data[$k]['towns']['area'] = $v['province'].','.$v['city'].','.$v['county'].','.$v['town'];
-                $data[$k]['towns']['money'] = Dever::db('shop/buy_order')->getSerachMoney($where);
+                // $data[$k]['towns']['money'] = Dever::db('shop/buy_order')->getSerachMoney($where);
                 $jia = $this->caigou($where);
-                $data[$k]['towns']['price'] = $jia * 0.05;
+                $data[$k]['towns']['price'] = $jia['money'] * 0.05;
                 // $data[$k]['towns']['price']= round($data[$k]['towns']['money']['total']) * 0.3*0.05;
                 $mid = Dever::db('agent/member')->getAreaAll(array('area'=>$data[$k]['towns']['area'],'role'=>4));
                 if($mid && $mid['id']){
@@ -771,7 +781,7 @@ class Manage
                 $data[$k]['towns']['t_num'] = count($t_shop);
                 if($data[$k]['towns']['t_num']>0){
                     $data[$k]['towns']['t_price'] = Dever::db('shop/buy_order')->getSerachTMoney($where);
-                    $data[$k]['towns']['t_fprice'] = $data[$k]['towns']['t_price']['total'] *0.05;
+                    $data[$k]['towns']['t_fprice'] = $data[$k]['towns']['price'];
                 }else{
                     $data[$k]['towns']['t_price'] = 0;
                     $data[$k]['towns']['t_fprice'] = 0;
@@ -789,7 +799,8 @@ class Manage
                 $w['area'] = $data[$k]['towns']['area'];
                 $w['price'] = $data[$k]['towns']['price'];
                 $w['num'] = $data[$k]['towns']['num'];
-                $w['c_price'] = $data[$k]['towns']['money']['total'];
+                $w['c_price'] = $jia['price'];
+                // $data[$k]['towns']['money']['total'];
                 $w['t_num'] = $data[$k]['towns']['t_num'];
                 $w['t_price'] = $data[$k]['towns']['t_price']['total'];
                 $w['t_fprice'] = $data[$k]['towns']['t_fprice'];