Jason 1 anno fa
parent
commit
1af3328ad3

+ 1 - 1
application/admin/controller/trade/MoneyIn.php

@@ -87,7 +87,7 @@ class MoneyIn extends Backend
 
             //充值
             if ($status == $this->model::Success) {
-                (new MoneyLog())->change($row->user_id, $row->amount, MoneyLog::Recharge, $row->user_id, '充值');
+                (new MoneyLog())->change($row->user_id, $row->amount, MoneyLog::Recharge, '', '充值');
             }
 
             $result = $row->allowField(true)->save(['status' => $status, 'admin_id'=>$this->auth->id]);

+ 2 - 1
application/api/controller/Order.php

@@ -214,7 +214,8 @@ class Order extends Api
                 ->where('id', $user['id'])
                 ->update([
                     'task_num'		=>	Db::raw('task_num + 1'),
-                    'bonus_sum'		=>	Db::raw('bonus_sum + ' .$order_info['bonus']),
+                    'bonus_sum'		=>  Db::raw('bonus_sum + ' .$order_info['bonus']),
+                    'task_last_time'=>  time()
                 ]);
             //向上级发放
 

+ 1 - 1
application/common/model/MoneyLog.php

@@ -86,7 +86,7 @@ class MoneyLog extends Model
         //余额
         $balance = bcadd($user->balance, $amount, 2);
         //只有支付订单或系统调整的时候,可以余额为负数
-        if(($action != self::Pay && $action != self::SystemChange) && $balance < 0){
+        if(($action != self::Pay && $action != self::SystemChange) && $amount < 0 && $balance < 0){
             throw new Exception(__('余额不足'));
         }