Browse Source

钱包操作方法统一

lizhen_gitee 1 month ago
parent
commit
8d9620316e

+ 1 - 1
application/api/controller/Payios.php

@@ -436,7 +436,7 @@ class Payios extends Api
         $args = json_decode($order_info['args'],true);
         //先充值
         if($order_info['table_name'] == 'gold_recharge'){
-            $result = model('Wallet')->lockChangeAccountRemain($order_info['user_id'],'gold',$args['gold'],10, '金币充值','pay_order',$order_info['id']);
+            $result = model('Wallet')->lockChangeAccountRemain($order_info['user_id'],$args['gold'],'gold',10, '金币充值','pay_order',$order_info['id']);
             if($result['status']===false)
             {
                 filePut($prefix.'逻辑添加金币失败');

+ 1 - 1
application/api/controller/Task.php

@@ -138,7 +138,7 @@ class Task extends Api
         Db::startTrans();
         try{
             // 增加用户金币
-            $res1 = model('wallet')->lockChangeAccountRemain($this->auth->id,'bean',$taskInfo["exp"],102,$taskInfo['name'],'task_log',$tasklogInfo['id']);
+            $res1 = model('wallet')->lockChangeAccountRemain($this->auth->id,$taskInfo["exp"],'bean',102,$taskInfo['name'],'task_log',$tasklogInfo['id']);
             if($res1['status'] === false){
                 Db::rollback();
                 $this->error($res1['msg']);

+ 1 - 1
application/api/controller/Usersign.php

@@ -94,7 +94,7 @@ class Usersign extends Api
         }
 
         //加钱
-        $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'bean',$data['goldnum'],101,'签到奖励','user_sign',$log_id);
+        $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,$data['goldnum'],'bean',101,'签到奖励','user_sign',$log_id);
         if($rs['status'] === false){
             Db::rollback();
             $this->error($rs['msg']);

+ 3 - 3
application/common/model/Wallet.php

@@ -84,7 +84,7 @@ class Wallet extends BaseModel
      *
      * @param floatval $number 金额(正数进账,负数出账)
      * @param $accountType 货币类型,money,score
-     * @param $logtype 日志的类型
+     * @param $log_type 日志的类型
      * @param $remark  备注
      * @param $user_id  用户id
      * @param $table  来源表
@@ -96,7 +96,7 @@ class Wallet extends BaseModel
      * @return array[log_table]
      * @return array[log_id]
      */
-    public function lockChangeAccountRemain($user_id, $accountType = 'money', $number, $logtype = '', $remark = '', $table = '', $table_id = 0, $isAdmin = false)
+    public function lockChangeAccountRemain($user_id, $number, $accountType = 'money',  $log_type = '', $remark = '', $table = '', $table_id = 0)
     {
         //初始化
         $result = array(
@@ -144,7 +144,7 @@ class Wallet extends BaseModel
                 //钱币记录
                 $data             = array();
                 $data['user_id']  = $user_id;
-                $data['log_type'] = $logtype;
+                $data['log_type'] = $log_type;
 //                $data['money_type'] = $accountType;
                 $data['before']       = $wallet[$accountType];
                 $data['change_value'] = $number;