zac3533 1 year ago
parent
commit
79b91bcf3e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      application/admin/controller/user/User.php

+ 3 - 2
application/admin/controller/user/User.php

@@ -98,8 +98,9 @@ class User extends Backend
         $result = false;
         Db::startTrans();
         try {
-            (new MoneyLog())->change($params['id'], $params['amount'], MoneyLog::SystemChange, $this->auth->id, '后台操作');
-
+            
+            $amount = $params['type'] == 1 ?-$params['amount']:$params['amount'];
+            (new MoneyLog())->change($params['id'], $amount, MoneyLog::SystemChange, $this->auth->id, '后台操作');
             Db::commit();
         } catch (ValidateException|PDOException|Exception $e) {
             Db::rollback();