rabin %!s(int64=3) %!d(string=hai) anos
pai
achega
25d1109293
Modificáronse 2 ficheiros con 26 adicións e 1 borrados
  1. 25 0
      service/agent/database/member_goods.php
  2. 1 1
      service/agent/lib/Dhorder.php

+ 25 - 0
service/agent/database/member_goods.php

@@ -503,6 +503,31 @@ return array
             // 'order' => array('cdate'=>'desc'),
             // 'order' => array('cdate'=>'desc'),
             'col' => 'sum(cash) as cash,sum(total_num) as total_num,sum(sell_num) as sell_num,price',
             'col' => 'sum(cash) as cash,sum(total_num) as total_num,sum(sell_num) as sell_num,price',
         ),
         ),
+
+        'getDhTotal' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'fstart' => array('yes-t_2.ddate','>='),
+                'fend' => array('yes-t_2.ddate','<='),
+                'mid' => 'yes-t_1.mid',
+                'type' => array('yes-t_1.type','in'),
+                'type_id' => 'yes-t_1.type_id',
+                'state' => 'yes-t_1.state-1',
+            ),
+            'join' => array
+            (
+                'table' => 'card/code',
+                'type' => 'left join',
+                'on' => array('id', 'sku_id'),
+                'col' => 't_2.id as cid',
+            ),
+            'type' => 'one',
+            // 'order' => array('cdate'=>'desc'),
+            'col' => 'id,sum(t_1.cash) as cash,sum(t_1.total_num) as total_num,sum(t_1.sell_num) as sell_num,t_1.price',
+        ),
+
         'getProduct' => array
         'getProduct' => array
         (
         (
             # 匹配的正则或函数 选填项
             # 匹配的正则或函数 选填项

+ 1 - 1
service/agent/lib/Dhorder.php

@@ -1522,7 +1522,7 @@ class Dhorder
                         $n['mid'] = $v['mid'];
                         $n['mid'] = $v['mid'];
                         $n['type'] = $type;
                         $n['type'] = $type;
                         $n['type_id'] = $type_id;
                         $n['type_id'] = $type_id;
-                        $dh_goods = Dever::db('agent/member_goods')->getTotal($n);
+                        $dh_goods = Dever::db('agent/member_goods')->getDhTotal($n);
 
 
                         $d[$i] = $dh_goods['sell_num'] ? $dh_goods['cash']*$dh_goods['sell_num'] : 0;
                         $d[$i] = $dh_goods['sell_num'] ? $dh_goods['cash']*$dh_goods['sell_num'] : 0;
                     } elseif($type == 1) {
                     } elseif($type == 1) {