Merge pull request 'update' (#21) from zhangwei into dev
Reviewed-on: #21
This commit is contained in:
commit
608cfdb38a
@ -42,7 +42,7 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['follow_type', 'project_assurance', 'follow_status', 'follow_stage'],
|
'=' => ['follow_type', 'project_assurance', 'follow_status', 'follow_stage'],
|
||||||
'%like%' => ['theme','contacts','contact_information'],
|
'%like%' => ['executor','theme','contacts','contact_information'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,10 +69,6 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
$projectIds = Project::where('custom_id','in',$customIds)->column('id');
|
$projectIds = Project::where('custom_id','in',$customIds)->column('id');
|
||||||
$where[] = ['project_id','in',$projectIds];
|
$where[] = ['project_id','in',$projectIds];
|
||||||
}
|
}
|
||||||
if(isset($params['executor']) && $params['executor'] != ''){
|
|
||||||
$adminIds = Admin::where('name','like','%'.$params['executor'].'%')->column('id');
|
|
||||||
$where[] = ['executor','in',$adminIds];
|
|
||||||
}
|
|
||||||
return ProjectFollowUp::where($this->searchWhere)->where($where)
|
return ProjectFollowUp::where($this->searchWhere)->where($where)
|
||||||
->field(['id', 'project_id', 'executor', 'follow_date', 'follow_type', 'theme', 'project_assurance', 'follow_status', 'follow_stage', 'next_follow_up_date', 'create_time'])
|
->field(['id', 'project_id', 'executor', 'follow_date', 'follow_type', 'theme', 'project_assurance', 'follow_status', 'follow_stage', 'next_follow_up_date', 'create_time'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
@ -86,8 +82,6 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
$item['next_follow_up_date'] = !empty($item['next_follow_up_date']) ? date('Y-m-d',$item['next_follow_up_date']) : '';
|
$item['next_follow_up_date'] = !empty($item['next_follow_up_date']) ? date('Y-m-d',$item['next_follow_up_date']) : '';
|
||||||
$project = Project::field('id,custom_id,name')->where('id',$item['project_id'])->findOrEmpty();
|
$project = Project::field('id,custom_id,name')->where('id',$item['project_id'])->findOrEmpty();
|
||||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||||
$executor = Admin::field('name')->where('id',$item['executor'])->findOrEmpty();
|
|
||||||
$item['executor'] = $executor['name'];
|
|
||||||
$item['project_name'] = $project['name'];
|
$item['project_name'] = $project['name'];
|
||||||
$item['custom_name'] = $custom['name'];
|
$item['custom_name'] = $custom['name'];
|
||||||
return $item;
|
return $item;
|
||||||
@ -115,10 +109,6 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
$projectIds = Project::where('custom_id','in',$customIds)->column('id');
|
$projectIds = Project::where('custom_id','in',$customIds)->column('id');
|
||||||
$where[] = ['project_id','in',$projectIds];
|
$where[] = ['project_id','in',$projectIds];
|
||||||
}
|
}
|
||||||
if(isset($params['executor']) && $params['executor'] != ''){
|
|
||||||
$adminIds = Admin::where('name','like','%'.$params['executor'].'%')->column('id');
|
|
||||||
$where[] = ['executor','in',$adminIds];
|
|
||||||
}
|
|
||||||
return ProjectFollowUp::where($this->searchWhere)->where($where)->count();
|
return ProjectFollowUp::where($this->searchWhere)->where($where)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,8 +140,6 @@ class ProjectFollowUpLogic extends BaseLogic
|
|||||||
$data['next_follow_up_date'] = !empty($data['next_follow_up_date']) ? date('Y-m-d',$data['next_follow_up_date']) : '';
|
$data['next_follow_up_date'] = !empty($data['next_follow_up_date']) ? date('Y-m-d',$data['next_follow_up_date']) : '';
|
||||||
$project = Project::field('id,custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
$project = Project::field('id,custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
||||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||||
$executor = Admin::field('name')->where('id',$data['executor'])->findOrEmpty();
|
|
||||||
$data['executor'] = $executor['name'];
|
|
||||||
$data['project_name'] = $project['name'];
|
$data['project_name'] = $project['name'];
|
||||||
$data['project_code'] = $project['project_code'];
|
$data['project_code'] = $project['project_code'];
|
||||||
$data['custom_name'] = $custom['name'];
|
$data['custom_name'] = $custom['name'];
|
||||||
|
@ -36,7 +36,6 @@ class ProjectFollowUpValidate extends BaseValidate
|
|||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require',
|
||||||
'project_id' => 'require|checkProject',
|
'project_id' => 'require|checkProject',
|
||||||
'executor' => 'require|integer|checkExecutor',
|
|
||||||
'theme' => 'require',
|
'theme' => 'require',
|
||||||
'follow_date' => 'require|date',
|
'follow_date' => 'require|date',
|
||||||
'follow_type' => 'require|checkType',
|
'follow_type' => 'require|checkType',
|
||||||
@ -49,8 +48,6 @@ class ProjectFollowUpValidate extends BaseValidate
|
|||||||
protected $message = [
|
protected $message = [
|
||||||
'id.require' => '缺少必要参数',
|
'id.require' => '缺少必要参数',
|
||||||
'project_id.require' => '请选择项目',
|
'project_id.require' => '请选择项目',
|
||||||
'executor.require' => '请选择执行人',
|
|
||||||
'executor.integer' => '执行人数据格式错误',
|
|
||||||
'theme.require' => '请填写主题',
|
'theme.require' => '请填写主题',
|
||||||
'follow_date.require' => '请选择日期',
|
'follow_date.require' => '请选择日期',
|
||||||
'follow_date.date' => '日期格式错误',
|
'follow_date.date' => '日期格式错误',
|
||||||
@ -125,14 +122,6 @@ class ProjectFollowUpValidate extends BaseValidate
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public function checkExecutor($value): bool|string
|
|
||||||
{
|
|
||||||
$admin = Admin::where('id',$value)->findOrEmpty();
|
|
||||||
if($admin->isEmpty()){
|
|
||||||
return '执行人不存在';
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public function checkType($value): bool|string
|
public function checkType($value): bool|string
|
||||||
{
|
{
|
||||||
$dictData = DictData::where('type_value','follow_type')->column('value');
|
$dictData = DictData::where('type_value','follow_type')->column('value');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user