Browse Source

购买关系卡单独列流水类型

lizhen_gitee 1 year ago
parent
commit
c9c2938ab3
2 changed files with 5 additions and 2 deletions
  1. 3 2
      application/api/controller/Relation.php
  2. 2 0
      application/extra/wallet.php

+ 3 - 2
application/api/controller/Relation.php

@@ -340,7 +340,8 @@ class Relation extends Api
         if(!$decorate) {
             $this->error("道具信息获取失败!");
         }
-        if($walletinfo['gold'] < $decorate['price']) {
+        $total_price = bcmul($decorate['price'],$number,0);
+        if($walletinfo['gold'] < $total_price) {
             $this->error("您的金币不足,请先充值!");
         }
         // 进行购买逻辑
@@ -364,7 +365,7 @@ class Relation extends Api
         }
 
         //扣钱
-        $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$decorate['price'],31,'购买关系卡','user_decorate_relation',0);
+        $rs = model('wallet')->lockChangeAccountRemain($this->auth->id,'gold',-$total_price,32,'购买关系卡','user_decorate_relation',0);
         if($rs['status'] === false){
             Db::rollback();
             $this->error($rs['msg']);

+ 2 - 0
application/extra/wallet.php

@@ -17,6 +17,8 @@ return [
         22 => '收益兑换金币',//gold +
 
         31 => '购买装扮消费', //gold -
+        32 => '购买关系卡', //gold -
+        33 => '购买联盟道具', //gold -
         41 => '签到赠送金币',