1.提交缺失的东西

This commit is contained in:
2025-05-15 15:43:23 +08:00
parent 23d2fe7db5
commit 4bbb96d217
2 changed files with 21 additions and 0 deletions

View File

@ -74,6 +74,15 @@ class UserController extends BaseApiController
return $this->fail(UserLogic::getError());
}
/**
* note 我的钱包
* create_time 2020/11/27 16:58
*/
public function myWallet()
{
$info = UserLogic::myWallet($this->userId);
return $this->success('获取成功', $info);
}
/**
* @notes 修改密码

View File

@ -21,9 +21,11 @@ use app\common\{enum\notice\NoticeEnum,
logic\BaseLogic,
model\user\User,
model\user\UserAuth,
service\ConfigServer,
service\FileService,
service\sms\SmsDriver,
service\wechat\WeChatMnpService};
use think\facade\Db;
use think\facade\Config;
/**
@ -80,7 +82,17 @@ class UserLogic extends BaseLogic
return $user->toArray();
}
public static function myWallet($user_id)
{
$info = Db::name('user')
->where(['id' => $user_id])
->field('user_money,total_order_amount,total_recharge_amount,user_growth')
->find();
$info['open_racharge'] = ConfigServer::get('recharge', 'open_racharge', 0);
return $info;
}
/**
* @notes 设置用户信息
* @param int $userId