|
|
@@ -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) {
|