rabin 3 rokov pred
rodič
commit
cb6216ab06

+ 4 - 2
app/shop/database/user_money.php

@@ -18,9 +18,9 @@ $type = array
 (
     1 => '充值',
     2 => '充值返还',
-    3 => '购买商品',
-    4 => '邀请奖励',
+    3 => '邀请奖励',
     11 => '提现',
+    12 => '购买商品',
 );
 $excel = false;
 
@@ -247,6 +247,8 @@ return array
             # 匹配的正则或函数 选填项
             'option' => array
             (
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
                 'uid' => 'yes',
                 'type' => 'yes',
                 'state' => 1,

+ 11 - 2
app/shop/lib/Sell.php

@@ -688,7 +688,16 @@ class Sell
                     }
                 }
             } elseif ($wallet && $wallet > 0) {
-                $data['score'] = Dever::load('score/lib/core')->getUserScore($data['uid']);
+                $user = Dever::db('passport/user')->find($data['uid']);
+                if ($user) {
+                    if ($user['cash'] >= $data['price']) {
+                        $data['wallet_cash'] = $data['price'];
+                        $data['price'] = 0;
+                    } else {
+                        $data['wallet_cash'] = $user['cash'];
+                        $data['price'] = $data['price'] - $user['cash'];
+                    }
+                }
             }
         }
 
@@ -1188,7 +1197,7 @@ class Sell
             }
             
         } elseif ($wallet_cash) {
-
+            Dever::load('shop/lib/money')->up($order_data['uid'], 12, -1*$wallet_cash, $order_data['id'], '购买商品', 2);
         }
 
         # 这里可以记录一下使用日志

+ 8 - 2
app/shop/src/My.php

@@ -57,7 +57,13 @@ class My extends Core
         if ($type) {
             $where['type'] = $type;
         }
-        $day = Dever::input('day');
+        $month = Dever::input('month');
+        if ($month) {
+        	$start = $month . '-01 00:00:00';
+        	$end = strtotime("$start +1 month -1 day");
+        	$where['start'] = Dever::maketime($start);
+        	$where['end'] = $end;
+        }
         $this->data['list'] = Dever::db('shop/user_money')->getData($where);
         if ($this->data['list']) {
             foreach ($this->data['list'] as $k => $v) {
@@ -129,7 +135,7 @@ class My extends Core
         $this->data['config']['tax'] = $this->data['config']['cash_tx']/100;
 
         # 是否签约过
-        
+
         
         return $this->data;
     }