This commit is contained in:
mkm 2023-08-18 18:11:32 +08:00
parent 1223a858ed
commit 42e20bc12f
4 changed files with 16 additions and 5 deletions

View File

@ -18,7 +18,7 @@ class CeshiController extends BaseApiController
{ {
// $all=TaskSchedulingPlan::whereDay('end_time','yesterday')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); // $all=TaskSchedulingPlan::whereDay('end_time','yesterday')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
// halt($all); // halt($all);
$all=TaskSchedulingPlan::where('id',411)->with(['template_info','scheduling'])->select()->toArray(); $all=TaskSchedulingPlan::whereDay('end_time')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
foreach($all as $k=>$v){ foreach($all as $k=>$v){
queue(TaskInformationJob::class,$v); queue(TaskInformationJob::class,$v);
} }

View File

@ -42,11 +42,22 @@ class TaskTemplateLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
$moeny=TaskTemplate::where('company_id', $params['company_id'])->sum('money'); $moeny=TaskTemplate::where('company_id', $params['company_id'])->sum('money');
$money_two=TaskTemplate::where('company_id', $params['company_id'])->sum('money_two');
$money_three=TaskTemplate::where('company_id', $params['company_id'])->sum('money_three');
$SchedulingMoney=TaskScheduling::where('company_id', $params['company_id'])->value('money'); $SchedulingMoney=TaskScheduling::where('company_id', $params['company_id'])->value('money');
if($moeny+$params['money']>$SchedulingMoney){ if($moeny+$params['money']>$SchedulingMoney){
self::setError('任务模板合计金额不能大于任务调度金额'); self::setError('任务模板合计金额不能大于任务调度金额');
return false; return false;
} }
if($money_two+$params['money']>$SchedulingMoney){
self::setError('任务模板合计金额不能大于任务调度金额');
return false;
}
if($money_three+$params['money']>$SchedulingMoney){
self::setError('任务模板合计金额不能大于任务调度金额');
return false;
}
TaskTemplate::create([ TaskTemplate::create([
'title' => $params['title'], 'title' => $params['title'],
'admin_id' => $params['admin_id'], 'admin_id' => $params['admin_id'],

View File

@ -13,8 +13,8 @@ class TaskCron extends Task{
public function configure() public function configure()
{ {
// $this->daily(); //设置任务的周期,每天执行一次,更多的方法可以查看源代码,都有注释 $this->daily(); //设置任务的周期,每天执行一次,更多的方法可以查看源代码,都有注释
$this->everyMinute(); // $this->everyMinute();
} }
/** /**
* 执行任务 * 执行任务

View File

@ -11,8 +11,8 @@ class TaskSettlementCron extends Task{
public function configure() public function configure()
{ {
// $this->daily(); //设置任务的周期,每天执行一次,更多的方法可以查看源代码,都有注释 $this->daily(); //设置任务的周期,每天执行一次,更多的方法可以查看源代码,都有注释
$this->everyMinute(); // $this->everyMinute();
} }
/** /**
* 任务结算 * 任务结算