This commit is contained in:
chenbo 2023-09-11 09:47:21 +08:00
parent a7c5bd3390
commit e56acef076
2 changed files with 5 additions and 1 deletions

View File

@ -165,7 +165,7 @@ class UserController extends BaseApiController
public function getCurrCycleWithdraw()
{
$userInfo = User::find(['id' => $this->userId]);
// 数据字典 提周期 单位:天数
// 数据字典 提周期 单位:天数
$dictData = ConfigLogic::getDictByType('withdraw_cycle');
$endCycle = strtotime(date('Y-m-d', strtotime("-{$dictData['withdraw_cycle'][0]['value']} day")));
// 计算公司周期内所有用户已完成的 变动类型为任务收益金额增加 动作为增加的 未提现状态 的变动金额之和
@ -175,6 +175,9 @@ class UserController extends BaseApiController
public function withdraw()
{
$params = $this->request->param();
if(!isset($params['amount'])) {
return $this->fail('参数错误');
}
$params['user_id'] = $this->userId;
$result = UserLogic::withdraw($params);
if ($result) {

View File

@ -302,6 +302,7 @@ class UserLogic extends BaseLogic
Db::startTrans();
try {
$user = User::findOrEmpty($params['user_id']);
if ($user->isEmpty()) {
throw new DataNotFoundException('用户不存在');
}