|
|
@@ -5,7 +5,7 @@ namespace app\admin\controller\user;
|
|
|
use app\common\controller\Backend;
|
|
|
use app\common\model\LedgerWalletModel;
|
|
|
use app\common\model\LedgerTokenChangeModel;
|
|
|
-use app\common\model\UserModel;
|
|
|
+use app\common\model\LedgerFrozenChangeModel;
|
|
|
use Exception;
|
|
|
use fast\GoogleAuthenticator;
|
|
|
use fast\Asset;
|
|
|
@@ -112,6 +112,7 @@ class User extends Backend
|
|
|
if (false === $this->request->isPost()) {
|
|
|
$wallet = (new LedgerWalletModel())->get($ids);
|
|
|
$row['token'] = $wallet['token'] ?? "-";
|
|
|
+ $row['frozen'] = $wallet['frozen'] ?? "-";
|
|
|
//$google=new GoogleAuthenticator();
|
|
|
//生成验证秘钥
|
|
|
//$secret=$google->createSecret();
|
|
|
@@ -127,15 +128,18 @@ class User extends Backend
|
|
|
$google=new GoogleAuthenticator();
|
|
|
$checkResult = $google->verifyCode(config('google_secret'), $params['code'], 6);
|
|
|
if (!$checkResult) $this->error('谷歌验证码错误');
|
|
|
- //茶宝
|
|
|
- $newPower = bcadd($params['new_power'], 0, 6);
|
|
|
+ //资金
|
|
|
+ $newPower = bcadd($params['new_power'], 0, 6);
|
|
|
// 启动事务
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
- // 更新茶宝
|
|
|
+ // 更新资金
|
|
|
if (bccomp($newPower, 0, 6) !== 0) {
|
|
|
- (new LedgerWalletModel)->changeWalletAccount($ids, Asset::TOKEN, $newPower, LedgerTokenChangeModel::System);
|
|
|
-
|
|
|
+ if (empty($params['type_id'])) {
|
|
|
+ (new LedgerWalletModel)->changeWalletAccount($ids, Asset::TOKEN, $newPower, LedgerTokenChangeModel::System);
|
|
|
+ }else{
|
|
|
+ (new LedgerWalletModel)->changeWalletAccount($ids, Asset::FROZEN, $newPower, LedgerFrozenChangeModel::System);
|
|
|
+ }
|
|
|
}
|
|
|
// 提交事务
|
|
|
Db::commit();
|