第一次成功创建任务模板,初始化公司的提现截止时间

This commit is contained in:
chenbo 2023-09-20 10:01:50 +08:00
parent 055152f6c9
commit 4855bb5959
3 changed files with 12 additions and 3 deletions

View File

@ -54,7 +54,14 @@ class TaskTemplateController extends BaseAdminController
{ {
$params = (new TaskTemplateValidate())->post()->goCheck('add'); $params = (new TaskTemplateValidate())->post()->goCheck('add');
$params['admin_id'] = $this->adminId; $params['admin_id'] = $this->adminId;
$result = TaskTemplateLogic::add($params); $company = Company::find($params['company_id']);
if ($company->company_type == 41) {
// 创建 镇管理公司 任务模板
$result = TaskTemplateLogic::addTownTaskTemplate($params);
} else {
$result = TaskTemplateLogic::add($params);
}
if (true === $result) { if (true === $result) {
/** /**
* 如果是公司第一次创建安排任务,则初始化公司的提现周期截止时间 * 如果是公司第一次创建安排任务,则初始化公司的提现周期截止时间

View File

@ -52,7 +52,7 @@ class WithdrawLists extends BaseAdminDataLists implements ListsSearchInterface
->where($this->queryWhere()) ->where($this->queryWhere())
->withAttr('company_name', function ($value, $data) { ->withAttr('company_name', function ($value, $data) {
$company = Company::where(['admin_id'=>$data['admin_id']])->find(); $company = Company::where(['admin_id'=>$data['admin_id']])->find();
return $company['company_name']; return $company['company_name']??'';
}) })
->withAttr('s_date', function ($value, $data) { ->withAttr('s_date', function ($value, $data) {
$withdrawedCount = Withdraw::where(['user_id'=>$data['user_id'], 'status'=>3])->count(); $withdrawedCount = Withdraw::where(['user_id'=>$data['user_id'], 'status'=>3])->count();

View File

@ -225,7 +225,7 @@ class TaskTemplateLogic extends BaseLogic
{ {
// 如果是公司第一次创建安排任务,初始化公司的可提现周期截止时间 // 如果是公司第一次创建安排任务,初始化公司的可提现周期截止时间
$templateCount = TaskTemplate::where(['company_id'=>$params['company_id']])->count(); $templateCount = TaskTemplate::where(['company_id'=>$params['company_id']])->count();
if ($templateCount == 0) { if ($templateCount == 1) {
$dictData = ConfigLogic::getDictTypeValueByType('withdraw_cycle'); $dictData = ConfigLogic::getDictTypeValueByType('withdraw_cycle');
$cycle = $dictData['withdraw_cycle_1']['value']; // 数据字典-提现周期 单位:天数 $cycle = $dictData['withdraw_cycle_1']['value']; // 数据字典-提现周期 单位:天数
$today = strtotime(date('Y-m-d')); $today = strtotime(date('Y-m-d'));
@ -293,6 +293,8 @@ class TaskTemplateLogic extends BaseLogic
'stage_day_two' => $params['stage_day_two']??0, 'stage_day_two' => $params['stage_day_two']??0,
'proportion_two' => $params['proportion_two']??0, 'proportion_two' => $params['proportion_two']??0,
'recharge' => $params['recharge']??0, 'recharge' => $params['recharge']??0,
'stage_day_three' => $params['stage_day_three']??0,
'new_money_three' => $params['new_money_three']??0,
]); ]);
Db::commit(); Db::commit();
return true; return true;