From a9cd0783399aa7d3f1f21a472eee9ad22703b4e3 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 17 Nov 2023 19:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E8=82=A1=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/approve/ApproveController.php | 2 +- app/adminapi/lists/approve/ApproveLists.php | 9 +++++++++ app/api/controller/TaskController.php | 6 ++++-- app/common/logic/task/TaskLogic.php | 8 -------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/adminapi/controller/approve/ApproveController.php b/app/adminapi/controller/approve/ApproveController.php index 7e36407ab..e47bd731c 100644 --- a/app/adminapi/controller/approve/ApproveController.php +++ b/app/adminapi/controller/approve/ApproveController.php @@ -227,7 +227,7 @@ class ApproveController extends BaseAdminController // 村公司 $subordinateCompany = Company::where(['id'=>$approve->department_id])->find(); // 镇农科公司 负责区域包含有村公司的street码 - $parentCompany = Db::query("select id from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$subordinateCompany['street']], true)[0]; + $parentCompany = Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$subordinateCompany['street']], true)[0]; } $amount = $approve->amount; // 上交股金金额 diff --git a/app/adminapi/lists/approve/ApproveLists.php b/app/adminapi/lists/approve/ApproveLists.php index 51477fd3e..f56a3b341 100644 --- a/app/adminapi/lists/approve/ApproveLists.php +++ b/app/adminapi/lists/approve/ApproveLists.php @@ -99,11 +99,20 @@ class ApproveLists extends BaseAdminDataLists implements ListsSearchInterface }) ->withAttr('company_b_name',function($value,$data){ $task = Task::where('id', $data['task_id'])->find(); + if ($data['type'] == Approve::APPROVE_TYPE_11) { + return '下属小组服务公司'; + } + if ($data['type'] == Approve::APPROVE_TYPE_14) { + return '下属村管理公司'; + } return Company::where(['id' => $task['company_id']])->value('company_name'); }) ->withAttr('company_a_name',function($value,$data){ $task = Task::where('id', $data['task_id'])->find(); $companyB = Company::where(['id' => $task['company_id']])->find(); + if ($data['type'] == Approve::APPROVE_TYPE_12 || $data['type'] == Approve::APPROVE_TYPE_14) { + return Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$companyB['street']], true)[0]['company_name']; + } return Company::where(['village' => $companyB['village'], 'company_type'=>17])->value('company_name'); }) ->toArray(); diff --git a/app/api/controller/TaskController.php b/app/api/controller/TaskController.php index b2c284de2..641b4cc0f 100644 --- a/app/api/controller/TaskController.php +++ b/app/api/controller/TaskController.php @@ -73,6 +73,7 @@ class TaskController extends BaseApiController $villageTaskTypeList = DictData::where(['type_value' => 'village_task_type', 'status' => 1])->column('value', 'id'); $townTaskTypeList = DictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id'); $townMarketingManagerTaskTypeList = DictData::where(['type_value' => 'town_task_type_marketing_director', 'status' => 1])->column('value', 'id'); + $townMasterTaskTypeList = DictData::where(['type_value' => 'town_task_type_master', 'status' => 1])->column('value', 'id'); $res = Task::where($where) ->field(['id', 'title', 'money', 'template_id', 'director_uid', 'company_id', 'start_time', 'end_time', 'director_uid', 'type', 'status', 'content', 'extend']) @@ -80,6 +81,7 @@ class TaskController extends BaseApiController ->order(['id' => 'desc', 'status' => 'asc']) ->select()->toArray(); foreach ($res as $k => $item) { + $res[$k]['task_type_value'] = ''; if (isset($serviceGroupTaskTypeList[$item['type']])) { $res[$k]['task_type_value'] = $serviceGroupTaskTypeList[$item['type']]; } @@ -89,8 +91,8 @@ class TaskController extends BaseApiController if (isset($townTaskTypeList[$item['type']])) { $res[$k]['task_type_value'] = $townTaskTypeList[$item['type']]; } - if (isset($townMarketingManagerTaskTypeList[$item['type']])) { - $res[$k]['task_type_value'] = $townMarketingManagerTaskTypeList[$item['type']]; + if (isset($townMasterTaskTypeList[$item['type']])) { + $res[$k]['task_type_value'] = $townMasterTaskTypeList[$item['type']]; } if ($item['type'] == 33) { diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php index c5d7d3c70..78a0b7d84 100644 --- a/app/common/logic/task/TaskLogic.php +++ b/app/common/logic/task/TaskLogic.php @@ -730,14 +730,6 @@ class TaskLogic extends BaseLogic Log::info(['镇农科公司定时任务结算执行-'.$taskSchedulePlan['template_info']['title']]); $taskTemplateInfo = $taskSchedulePlan['template_info']; $dayCount = $taskTemplateInfo['day_count']; - $taskInfo = Task::where(['id' => $taskSchedulePlan['task_id']])->find(); - $townCompany = Company::where(['id' => $taskTemplateInfo['company_id']])->find(); - // 行政村数量 - $villageCount = Db::name('geo_village')->where(['street_code' => $townCompany['street']])->count(); - // 小组服务公司总数 - $groupServiceCompanyList = Company::where(['company_type'=> 18])->whereIn('street', $townCompany['responsible_area'])->select()->toArray(); - $groupServiceCompanyCount = count($groupServiceCompanyList); - // 任务累计天数 <= 任务天数 刷新任务 if ($dayCount <= $taskTemplateInfo['stage_day_one']) { self::flushTaskTime($taskSchedulePlan);