update 更新前端代码
This commit is contained in:
parent
72069c7915
commit
9fb911b5fd
@ -134,6 +134,13 @@ class TaskTemplateLogic extends BaseLogic
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$company = Company::find($params['company_id']);
|
||||
if ($company->company_type == 41) {
|
||||
// 创建 镇农科公司 任务模板
|
||||
$taskScheduleAmount = 700;
|
||||
} else {
|
||||
$taskScheduleAmount = 200;
|
||||
}
|
||||
$find=TaskTemplate::where('task_scheduling', $params['task_scheduling'])->where('company_id',$params['company_id'])->where('type',$params['type'])->field('id,types,type,money,money_two,money_three')->find();
|
||||
if($find && $find['id']!=$params['id']&&$params['type']==$find['type']){
|
||||
self::setError('已经有同一种任务类型了');
|
||||
@ -147,17 +154,17 @@ class TaskTemplateLogic extends BaseLogic
|
||||
}
|
||||
}
|
||||
$moeny=TaskTemplate::where('company_id', $params['company_id'])->sum('money');
|
||||
if($moeny+$params['money']-$find['money']>200){
|
||||
if($moeny+$params['money']-$find['money']>$taskScheduleAmount){
|
||||
self::setError('任务模板一阶段合计金额不能大于任务调度金额');
|
||||
return false;
|
||||
}
|
||||
$money_two=TaskTemplate::where('company_id', $params['company_id'])->sum('money_two');
|
||||
if($money_two+$params['money_two']-$find['money_two']>200){
|
||||
if($money_two+$params['money_two']-$find['money_two']>$taskScheduleAmount){
|
||||
self::setError('任务模板二阶段合计金额不能大于任务调度金额');
|
||||
return false;
|
||||
}
|
||||
$money_three=TaskTemplate::where('company_id', $params['company_id'])->sum('money_three');
|
||||
if($money_three+$params['money_three']-$find['money_three']>200){
|
||||
if($money_three+$params['money_three']-$find['money_three']>$taskScheduleAmount){
|
||||
self::setError('任务模板长期合计金额不能大于任务调度金额');
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user