Jelajahi Sumber

茶宝调整

afa 10 bulan lalu
induk
melakukan
d5879f4d91

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

@@ -129,9 +129,8 @@ class User extends Backend
             $this->error('会员等级错误');
         }
 
+        //茶宝
         $newPower       = bcadd($params['new_power'], 0, 6);
-        $newSmh         = bcadd($params['new_smh'], 0, 6);
-
         // 启动事务
         Db::startTrans();
         try {
@@ -142,22 +141,11 @@ class User extends Backend
                     throw new Exception('更新会员等级影响行数为0');
                 }
             }
-
-            // 更新总算力并账变
+            // 更新茶宝
             if (bccomp($newPower, 0, 6) !== 0) {
-                (new LedgerWalletModel)->changeWalletAccount($ids, Asset::POWER, $newPower, Action::Reversal);
-
-                // 更新所有上级的总算力和团队人数
-                if($newPower > 0){
-                    (new UserModel())->updateForRental($ids, $newPower);
-                }
-            }
+                (new LedgerWalletModel)->changeWalletAccount($ids, Asset::TOKEN, $newPower, LedgerWalletModel::System);
 
-            // 更新SHM并账变
-            if (bccomp($newSmh, 0, 6) !== 0) {
-                (new LedgerWalletModel)->changeWalletAccount($ids, Asset::SMH, $newSmh, Action::Reversal);
             }
-
             // 提交事务
             Db::commit();
         } catch (Exception $e) {

+ 4 - 11
application/admin/view/user/user/edit.html

@@ -1,5 +1,5 @@
-<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
-
+<form id="edit-form" role="form" data-toggle="validator" method="POST" action="">
+    <div class="form-horizontal">
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">用户ID:</label>
         <div class="col-xs-12 col-sm-2">
@@ -22,21 +22,13 @@
     </div>
 
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">算力调整(+/-):</label>
+        <label class="control-label col-xs-12 col-sm-2">茶宝调整(+/-):</label>
         <div class="col-xs-12 col-sm-8">
             <label for="c-power"></label>
             <input id="c-power" class="form-control" placeholder="不填则不调整" name="row[new_power]" type="text" value="" />
         </div>
     </div>
 
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">SMH调整(+/-):</label>
-        <div class="col-xs-12 col-sm-8">
-            <label for="c-smh"></label>
-            <input id="c-smh" class="form-control" placeholder="不填则不调整" name="row[new_smh]" type="text" value="" />
-        </div>
-    </div>
-
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">会员等级调整:</label>
         <div class="col-xs-8">
@@ -55,4 +47,5 @@
             <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
         </div>
     </div>
+</div>
 </form>

+ 1 - 0
application/api/lang/en.php

@@ -19,4 +19,5 @@ return [
     '退回'                                   => 'Return',
     '赠送'                                   => 'Gift fee',
     '直推收益'                               => 'Direct income',
+    '系统调整'                               => 'System Adjustments',
 ]; 

+ 1 - 0
application/api/lang/zh-cn.php

@@ -107,4 +107,5 @@ return [
     'The withdrawal amount cannot be less than'                                  => '提现金额不能小于',
     'Withdrawal failed, please contact customer service.'                        => '提现失败,请联系客服。',
     'Signature verification failed'                                              => '签名校验失败',
+    '系统调整'                                                                    => '系统调整'
 ];

+ 4 - 1
application/common/model/LedgerWalletModel.php

@@ -34,6 +34,7 @@ class LedgerWalletModel extends Model
     const Return            = 6;
     const Giveaway          = 7;
     const Direct            = 8;
+    const System            = 9;
 
     /*
      * 支付状态
@@ -50,6 +51,7 @@ class LedgerWalletModel extends Model
         self::Return            => '退回',
         self::Giveaway          => '赠送手续费',
         self::Direct            => '直推收益',
+        self::System            => '系统调整',
     ];
 
     public static function getWalletChaBao($userID)
@@ -77,7 +79,8 @@ class LedgerWalletModel extends Model
     public static function getStatusList()
     {
         return [self::Popular => __('热销支付'), self::Payment  => __('转让支付'), self::Receive => __('转让收款'), self::Recharge => __('充值'), 
-        self::Withdraw  => __('提现'), self::Share => __('分享'), self::Return => __('退回'), self::Giveaway => __('赠送'), self::Direct => __('直推收益')];
+        self::Withdraw  => __('提现'), self::Share => __('分享'), self::Return => __('退回'), self::Giveaway => __('赠送'), self::Direct => __('直推收益'),
+        self::System => __('系统调整')];
     }
 
     /**

+ 2 - 0
public/assets/js/backend/ledger/ledger_token_change.js

@@ -42,6 +42,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 5: '分享',
                                 6: '提现退回',
                                 7: '赠送手续费',
+                                8: '直推收益',
+                                9: '系统赠送',
                             }, operate: 'FIND_IN_SET', formatter: Table.api.formatter.label
                         },
                     ]