From 4bd54271582b4ddfa2eac556eb427504fe3be6f9 Mon Sep 17 00:00:00 2001
From: mkm <727897186@qq.com>
Date: Thu, 7 Sep 2023 10:05:30 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B0=8F=E9=98=9F=20?=
 =?UTF-8?q?=E5=92=8C=20=E7=BB=93=E7=AE=97=E7=9A=84types3=E7=9A=84=E5=B1=8F?=
 =?UTF-8?q?=E8=94=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/api/controller/UserController.php | 11 +++++++++++
 app/common/logic/task/TaskLogic.php   | 15 ++++++++-------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/app/api/controller/UserController.php b/app/api/controller/UserController.php
index 9ca60e57d..915a95c47 100755
--- a/app/api/controller/UserController.php
+++ b/app/api/controller/UserController.php
@@ -21,6 +21,7 @@ use app\api\validate\SetUserInfoValidate;
 use app\api\validate\UserValidate;
 use app\common\logic\contract\ContractLogic;
 use app\common\model\contract\Contract;
+use app\common\model\user\User;
 use Common;
 use think\facade\Db;
 
@@ -209,4 +210,14 @@ class UserController extends BaseApiController
             return $this->fail(ContractLogic::getError());
         }
     }
+
+    /**
+     * 获取公司以设置的小队
+     */
+    public function company_brigade(){
+        $company_id=$this->userInfo['company_id'];
+        $res=User::where('company_id',$company_id)->where('is_captain',1)->column('brigade');
+        return $this->success('发送成功', $res);
+
+    }
 }
diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php
index 536ff5438..0f7d93376 100644
--- a/app/common/logic/task/TaskLogic.php
+++ b/app/common/logic/task/TaskLogic.php
@@ -75,12 +75,13 @@ class TaskLogic extends BaseLogic
     {
         try {
             if ($v['types'] == 3) {
-                $task = Task::where('template_id', $v['id'])->find();
-                if ($task) {
-                    Task::where('template_id', $v['id'])->update(['start_time' => $task['start_time'] + 86400, 'end_time' => $task['end_time'] + 86400]);
-                    TaskTemplate::where('id', $v['id'])->inc('day_count')->update();
-                    return true;
-                }
+                return true;
+                // $task = Task::where('template_id', $v['id'])->find();
+                // if ($task) {
+                //     Task::where('template_id', $v['id'])->update(['start_time' => strtotime($task['start_time']) + 86400, 'end_time' => strtotime($task['end_time']) + 86400]);
+                //     TaskTemplate::where('id', $v['id'])->inc('day_count')->update();
+                //     return true;
+                // }
             }
             $time = strtotime(date('Y-m-d'));
             $TaskSchedulingPlan_data = [
@@ -177,7 +178,7 @@ class TaskLogic extends BaseLogic
             TaskTemplate::where('id', $v['id'])->inc('day_count')->update();
             return true;
         } catch (\Exception $e) {
-            Log::error('定时任务添加失败'.$e->getMessage().'line'.$e->getLine());
+            Log::error('定时任务添加失败'.$e->getMessage().'。line:'.$e->getLine());
             return false;
         }
     }