Browse Source

Merge branch 'master' of ssh://git.dever.cc:10022/dever-product/churen

rabin 2 years ago
parent
commit
f7f8d6943e
3 changed files with 12 additions and 6 deletions
  1. 1 1
      app/mshop/src/Buy.php
  2. 1 1
      service/agent/database/member_goods.php
  3. 10 4
      service/agent/lib/Dhorder.php

+ 1 - 1
app/mshop/src/Buy.php

@@ -124,7 +124,7 @@ class Buy extends Core
                 if($this->shop['price']  >= $this->data['price']){
                     $this->data['wallet']['type'] = 1;
                     #花的钱
-                    $this->data['wallet']['price'] = $this->data['price'];
+                    $this->data['wallet']['price'] = round($this->data['price'],2);
                     $this->data['price'] = 0;
                     #余额
                     $this->data['wallet']['yue'] = round($this->shop['price'] - $this->data['price'],2);

+ 1 - 1
service/agent/database/member_goods.php

@@ -494,7 +494,7 @@ return array
             ),
             'type' => 'one',
             // 'order' => array('cdate'=>'desc'),
-            'col' => 'sum(cash) as cash,sum(total_num) as total_num,sum(sell_num) as sell_num',
+            'col' => 'sum(cash) as cash,sum(total_num) as total_num,sum(sell_num) as sell_num,price',
         ),
         'getProduct' => array
         (

+ 10 - 4
service/agent/lib/Dhorder.php

@@ -1435,12 +1435,14 @@ class Dhorder
             foreach ($res[0] as $k1 => $v1) {
                 list($type, $type_id) = explode('_', $k1);
                 $goods[$k1] = Dever::db('agent/member_goods')->getTotal(array('start'=>$where['start'],'end'=>$where['end'],'mid'=>$v['mid'],'type'=>$type, 'type_id' => $type_id));
-
                 $d[$i] = 0;
                 if ($goods[$k1]) {
-                    $d[$i] = $goods[$k1]['total_num'] ? $goods[$k1]['total_num'] : 0;
+                    if(strstr($v1[0],'卡')){
+                        $d[$i] = $goods[$k1]['cash'] ? $goods[$k1]['cash'] : 0;
+                    }else{
+                        $d[$i] = $goods[$k1]['total_num'] ? $goods[$k1]['total_num'] : 0;
+                    }
                 }
-                
                 if ($v1[1]) {
                     $i++;
                     $d[$i] = 0;
@@ -1473,7 +1475,11 @@ class Dhorder
             foreach ($res[1] as $k1 => $v1) {
                 $d[$i] = 0;
                 if ($goods[$k1]) {
-                    $d[$i] = $goods[$k1]['sell_num'] ? $goods[$k1]['sell_num'] : 0;
+                    if (strstr($v1,'卡')) {
+                        $d[$i] = $goods[$k1]['cash']*$goods[$k1]['sell_num'] ? $goods[$k1]['cash']*$goods[$k1]['sell_num'] : 0;
+                    } else {
+                        $d[$i] = $goods[$k1]['sell_num'] ? $goods[$k1]['sell_num'] : 0;
+                    }
                 }
                 $i++;
             }