rabin 2 years ago
parent
commit
34e7e5edc6
2 changed files with 19 additions and 12 deletions
  1. 17 11
      service/bill/database/goods_stat.php
  2. 2 1
      service/bill/lib/Cron.php

+ 17 - 11
service/bill/database/goods_stat.php

@@ -77,9 +77,6 @@ return array
             'list_name' => '权益名称',
             //'list'      => 'Dever::load("agent/lib/manage.getGoods#name", "{type}", "{type_id}", "{sku_id}")',
             //'list_order' => 5,
-            'list_name' => '总价值',
-            'list'      => '{cash}',
-            'list_order' => 9,
         ),
 
         'sku_id'      => array
@@ -153,21 +150,30 @@ return array
             'update'    => 'text',
             'list'      => true,
             'list_name' => '未兑换价值',
-            'list'      => '({total_num} - {sell_num})*{price}',
+            'list_order' => 9,
+        ),
+
+        'w_cash'      => array
+        (
+            'type'      => 'decimal-11,2',
+            'name'      => '未兑换价值',
+            'default'   => '0',
+            'desc'      => '未兑换价值',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
             'list_order' => 10,
         ),
 
-        'price'      => array
+        'y_cash'      => array
         (
             'type'      => 'decimal-11,2',
-            'name'      => '单件价值',
+            'name'      => '已兑换价值',
             'default'   => '0',
-            'desc'      => '单件价值',
+            'desc'      => '已兑换价值',
             'match'     => 'is_numeric',
             'update'    => 'text',
             'list'      => true,
-            'list_name' => '已兑换价值',
-            'list'      => '{sell_num}*{price}',
             'list_order' => 11,
         ),
 
@@ -215,7 +221,7 @@ return array
             'order' => array('day' => 'desc', 'cdate' => 'desc'),
             'page' => array(20, 'list'),
             'group' => '(case when type = 2 then concat_ws("_", type, type_id) else concat_ws("_", type, type_id, sku_id) end)',
-            'col' => '*,sum(total_num) as total_num, sum(sell_num) as sell_num, sum(cash) as cash,sum(sell_nonum) as sell_nonum,sum(price) as price',
+            'col' => '*,sum(total_num) as total_num, sum(sell_num) as sell_num, sum(cash) as cash,sum(sell_nonum) as sell_nonum,sum(w_cash) as w_cash,sum(y_cash) as y_cash',
         ),
 
         'all' => array
@@ -233,7 +239,7 @@ return array
             'type' => 'all',
             'order' => array('day' => 'desc', 'cdate' => 'desc'),
             'group' => '(case when type = 2 then concat_ws("_", type, type_id) else concat_ws("_", type, type_id, sku_id) end)',
-            'col' => '*,sum(total_num) as total_num, sum(sell_num) as sell_num, sum(cash) as cash,sum(sell_nonum) as sell_nonum,sum(price) as price',
+            'col' => '*,sum(total_num) as total_num, sum(sell_num) as sell_num, sum(cash) as cash,sum(sell_nonum) as sell_nonum,sum(w_cash) as w_cash,sum(y_cash) as y_cash',
         ),
     ),
 );

+ 2 - 1
service/bill/lib/Cron.php

@@ -100,7 +100,8 @@ class Cron
                     $data['total_num'] = $v['total_num'];
                     $data['sell_num'] = $v['sell_num'];
                     $data['cash'] = $v['cash'];
-                    $data['price'] = $v['price'];
+                    $data['w_cash'] = ($v['total_num'] - $v['sell_num']) * $v['price'];
+                    $data['y_cash'] = $v['sell_num'] * $v['price'];
                     $data['name'] = $v['name'];
                     $data['sell_nonum'] = $dh_order;