update
This commit is contained in:
parent
6107e53b14
commit
ae32006a6e
@ -18,12 +18,12 @@ use app\common\{enum\notice\NoticeEnum,
|
|||||||
enum\user\UserTerminalEnum,
|
enum\user\UserTerminalEnum,
|
||||||
enum\YesNoEnum,
|
enum\YesNoEnum,
|
||||||
logic\BaseLogic,
|
logic\BaseLogic,
|
||||||
|
model\Company,
|
||||||
model\user\User,
|
model\user\User,
|
||||||
model\user\UserAuth,
|
model\user\UserAuth,
|
||||||
model\user\Withdraw,
|
model\user\Withdraw,
|
||||||
service\sms\SmsDriver,
|
service\sms\SmsDriver,
|
||||||
service\wechat\WeChatMnpService
|
service\wechat\WeChatMnpService};
|
||||||
};
|
|
||||||
use app\common\model\dict\DictData;
|
use app\common\model\dict\DictData;
|
||||||
use app\common\model\user\UserAccountLog;
|
use app\common\model\user\UserAccountLog;
|
||||||
use think\db\exception\DataNotFoundException;
|
use think\db\exception\DataNotFoundException;
|
||||||
@ -307,8 +307,13 @@ class UserLogic extends BaseLogic
|
|||||||
throw new DataNotFoundException('用户不存在');
|
throw new DataNotFoundException('用户不存在');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$company = Company::find(['id'=>$user->company_id]);
|
||||||
|
if ($company->isEmpty()) {
|
||||||
|
throw new DataNotFoundException('账户异常,关联公司不存在');
|
||||||
|
}
|
||||||
|
|
||||||
// 是否有在途的提现申请
|
// 是否有在途的提现申请
|
||||||
$withdraw = Withdraw::where(['user_id'=>$params['user_id'], 'status'=>0])->find();
|
$withdraw = Withdraw::where(['user_id'=>$params['user_id'], 'company_id'=>$company->id, 'status'=>0])->find();
|
||||||
if (!empty($withdraw)) {
|
if (!empty($withdraw)) {
|
||||||
throw new ValidateException('您已有一笔待审核的提现申请');
|
throw new ValidateException('您已有一笔待审核的提现申请');
|
||||||
}
|
}
|
||||||
@ -319,7 +324,7 @@ class UserLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 校验提现金额
|
// 校验提现金额
|
||||||
if ($params['amount'] > $user['user_money']) {
|
if ($params['amount'] > $company->company_money) {
|
||||||
throw new ValidateException('余额不足');
|
throw new ValidateException('余额不足');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user