From 115761bba347639fab77cb4e5d97ee593291f85a Mon Sep 17 00:00:00 2001 From: weiz Date: Tue, 12 Dec 2023 14:04:45 +0800 Subject: [PATCH] update --- app/adminapi/lists/project/ProjectFollowUpLists.php | 12 +----------- app/adminapi/logic/project/ProjectFollowUpLogic.php | 2 -- .../validate/project/ProjectFollowUpValidate.php | 11 ----------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/app/adminapi/lists/project/ProjectFollowUpLists.php b/app/adminapi/lists/project/ProjectFollowUpLists.php index 4bdbe37da..1fc0f59bd 100644 --- a/app/adminapi/lists/project/ProjectFollowUpLists.php +++ b/app/adminapi/lists/project/ProjectFollowUpLists.php @@ -42,7 +42,7 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte { return [ '=' => ['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'); $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) ->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) @@ -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']) : ''; $project = Project::field('id,custom_id,name')->where('id',$item['project_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['custom_name'] = $custom['name']; return $item; @@ -115,10 +109,6 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte $projectIds = Project::where('custom_id','in',$customIds)->column('id'); $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(); } diff --git a/app/adminapi/logic/project/ProjectFollowUpLogic.php b/app/adminapi/logic/project/ProjectFollowUpLogic.php index 0803495f8..bcbae7827 100644 --- a/app/adminapi/logic/project/ProjectFollowUpLogic.php +++ b/app/adminapi/logic/project/ProjectFollowUpLogic.php @@ -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']) : ''; $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(); - $executor = Admin::field('name')->where('id',$data['executor'])->findOrEmpty(); - $data['executor'] = $executor['name']; $data['project_name'] = $project['name']; $data['project_code'] = $project['project_code']; $data['custom_name'] = $custom['name']; diff --git a/app/adminapi/validate/project/ProjectFollowUpValidate.php b/app/adminapi/validate/project/ProjectFollowUpValidate.php index f6a27d8e0..1c5d6b76b 100644 --- a/app/adminapi/validate/project/ProjectFollowUpValidate.php +++ b/app/adminapi/validate/project/ProjectFollowUpValidate.php @@ -36,7 +36,6 @@ class ProjectFollowUpValidate extends BaseValidate protected $rule = [ 'id' => 'require', 'project_id' => 'require|checkProject', - 'executor' => 'require|integer|checkExecutor', 'theme' => 'require', 'follow_date' => 'require|date', 'follow_type' => 'require|checkType', @@ -49,8 +48,6 @@ class ProjectFollowUpValidate extends BaseValidate protected $message = [ 'id.require' => '缺少必要参数', 'project_id.require' => '请选择项目', - 'executor.require' => '请选择执行人', - 'executor.integer' => '执行人数据格式错误', 'theme.require' => '请填写主题', 'follow_date.require' => '请选择日期', 'follow_date.date' => '日期格式错误', @@ -125,14 +122,6 @@ class ProjectFollowUpValidate extends BaseValidate } 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 { $dictData = DictData::where('type_value','follow_type')->column('value');