第一次成功创建任务模板,初始化公司的提现截止时间
This commit is contained in:
parent
88f026f321
commit
c3995792c8
@ -221,16 +221,16 @@ class TaskTemplateLogic extends BaseLogic
|
||||
return TaskTemplate::findOrEmpty($params['id'])->toArray();
|
||||
}
|
||||
|
||||
public static function initCompanyWithdrawDeadline($params)
|
||||
public static function initCompanyWithdrawDeadline($companyId)
|
||||
{
|
||||
// 如果是公司第一次创建安排任务,初始化公司的可提现周期截止时间
|
||||
$templateCount = TaskTemplate::where(['company_id'=>$params['company_id']])->count();
|
||||
$templateCount = TaskTemplate::where(['company_id' => $companyId])->count();
|
||||
if ($templateCount == 1) {
|
||||
$dictData = ConfigLogic::getDictTypeValueByType('withdraw_cycle');
|
||||
$cycle = $dictData['withdraw_cycle_1']['value']; // 数据字典-提现周期 单位:天数
|
||||
$today = strtotime(date('Y-m-d'));
|
||||
$withdrawDeadline = $today + $cycle * 24 * 60 * 60 + 86400;
|
||||
$company = Company::find([$params['company_id']]);
|
||||
$company = Company::find($companyId);
|
||||
$company->withdraw_deadline = $withdrawDeadline;
|
||||
$company->save();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user