From 4a268d1c13619b9e1dfdfeacd6b8e58120ff91d2 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Fri, 3 Jul 2020 22:39:26 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- application/index/controller/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 2371a7a..476cbf2 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -112,7 +112,7 @@ class Index extends BasicApi $sql = str_replace("`pms_", "`{$mysqlPrefix}", $sql); $pdo = new PDO("mysql:host={$mysqlHostname};port={$mysqlHostport}", $mysqlUsername, $mysqlPassword, array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb" + PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4" )); //检测是否支持innodb存储引擎 From e0b4393b2284cbdc4736d0f9ebaa87394c9e46f1 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Sat, 4 Jul 2020 07:40:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- favicon.ico | Bin 4286 -> 4286 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/favicon.ico b/favicon.ico index 8c33ea1b10394137d8ae80b180f1d55351afb20f..1f81ad607fdafc00ff2c0293902036fba08641cd 100644 GIT binary patch literal 4286 zcmcgw>rWh26kq=XKl!2in&PXa`a!8$O*DPP#wMEhsnHm%^@AqphbC%N6vV!S*2aRh zwAGaWKB&;rRuoHG@hwVi>x(MZ!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EG hz6`mx3iTy&88o;17SB`AVLr80jORB0{{ff#{eQ95b}Rq@ literal 4286 zcmdUxT}V_x6vyY@{ct5pF;p;GSLwqKFjPpwm6f1}=rIzB>Zu|ks)y(y30*Ks7sHI6 z0=0;UO4Fjij9M!ak&4{a#1=o0!jDXhC|z|=|FgR{3R}EhZ;)4hJLAlp^FQaz?A{SV z!k^71_*2}96(T_hkp?g%3IUG?AI!zA3K1GuVV_6rgJ_=;DPfAEZW$$+(2bkuiR__s_&{dt2pPLKLUH*;GHtL`s1O1L1AJN1d(T5qL)IL=;XwXUD0zZ$<-9)EHh%QeMt$nXb--$YD zzW)Rd4eZ$m_JQwpek1D6puZ5$JjMcqdlS#`yNl1Q=Ch|5vJb#_-Fx6q-M8OJ>hhD^ zK16bJ6G@L+NopUQl|8d(gb(*FzANkSgk#|M=S?sZ%<+Yfq;q>os;?ob@eYaF3uL@j zLDu`#{yg`kQ+rwu%8sYyI;e+Sgky+7TP*cZlcD*+i0PP(Oy#@3TN>(qB;Kv0tQHsL zKXZ}Y?HUITpqqZsQD`rOATn92b{*JwHg$f3GxK#$%lW2!w~Gn@G!?ER76ZohjRD>= z%2JtZFrHCro6M~*DzUd!jsB+1F}OiA&|N>hEJdU{Q%umW24k7!={xMtFP?zb6j1Vi zg1+Tn=yO8QW#U10T1k?*;AM>&T06mQ&;g3}4_64Zy5}Fsp}oz;dQl)Y-(4w#NK5~l zapGq>naFLxkE)=65T$b=9MeK1{{;u;9lVZVn}tY3WntWC2f;Mf&4mfzf0_bBKLH}& BeuDr2 From a5acbb0dee5a3a178034952da1f6066229f86f1c Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Fri, 17 Jul 2020 23:13:45 +0800 Subject: [PATCH 3/4] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 9021b57..8c73e54 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ ### 登录 ### 账号:123456 密码:123456 + +### 友情链接 ### + +**JAVA版本:https://gitee.com/wulon/mk-teamwork-server** + ### 界面截图 ### ![1](https://static.vilson.xyz/overview/1.png) From aad05516492ef4acf03b3a8311064b1e57a60f95 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Sun, 30 Aug 2020 17:19:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/Model/Task.php | 2 +- application/common/Model/TaskStages.php | 27 +++++++++++++++++++ application/project/controller/Task.php | 3 +++ application/project/controller/TaskStages.php | 18 +++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/application/common/Model/Task.php b/application/common/Model/Task.php index 08675ae..cb90c9f 100644 --- a/application/common/Model/Task.php +++ b/application/common/Model/Task.php @@ -345,7 +345,7 @@ class Task extends CommonModel throw new Exception('父任务已完成,无法重做子任务', 4); } if ($task['hasUnDone']) { - throw new Exception('子任务尚未全部完成,无法完成父任务', 5); + throw new Exception('子任务尚未全部完成,无法完成父任务', 55); } Db::startTrans(); diff --git a/application/common/Model/TaskStages.php b/application/common/Model/TaskStages.php index 7b714fd..aa6f026 100644 --- a/application/common/Model/TaskStages.php +++ b/application/common/Model/TaskStages.php @@ -4,6 +4,7 @@ namespace app\common\Model; use service\FileService; use service\RandomService; +use service\ToolsService; use think\File; /** @@ -100,6 +101,32 @@ class TaskStages extends CommonModel return $list; } + public function tasksTree($stageCode) + { + $taskModel = new Task(); + $list1 = $taskModel->where('stage_code', $stageCode)->where('done', 0)->where('deleted', 0)->order('sort asc,end_time desc, id asc')->select()->toArray(); + $list2 = $taskModel->where('stage_code', $stageCode)->where('done', 1)->where('deleted', 0)->order('sort asc,end_time desc, id asc')->select()->toArray(); + $list = array_merge($list1, $list2); + if ($list) { + foreach ($list as $key => &$item) { + $item = $taskModel->read($item['code']); + if ($item) { + $item = $item->toArray(); + } else { + $item = []; + } + if (empty($item['canRead'])) { + array_splice($list, $key, 1); + } + $item['type'] = 'task'; + $item['tasks'] = []; + } + unset($item); + } + $list = ToolsService::arr2tree($list, 'code', 'pcode', 'tasks'); + return $list; + } + /*public function tasks($stageCode, $deleted = 0, $done = -1) { $where = ['stage_code' => $stageCode, 'pcode' => '', 'deleted' => $deleted]; diff --git a/application/project/controller/Task.php b/application/project/controller/Task.php index 382c3cb..9ddcec1 100644 --- a/application/project/controller/Task.php +++ b/application/project/controller/Task.php @@ -94,6 +94,9 @@ class Task extends BasicApi $status = [0 => '普通', 1 => '紧急', 2 => '非常紧急']; if ($list['list']) { foreach ($list['list'] as &$task) { + $taskInfo = \app\common\Model\Task::get($task['id']); + $task['parentDone'] = $taskInfo['parentDone']; + $task['hasUnDone'] = $taskInfo['hasUnDone']; $task['priText'] = $status[$task['pri']]; $task['executor'] = Member::where(['code' => $task['assign_to']])->field('name,avatar')->find(); $task['projectInfo'] = \app\common\Model\Project::where(['code' => $task['project_code']])->field('name,code')->find(); diff --git a/application/project/controller/TaskStages.php b/application/project/controller/TaskStages.php index 73aef3c..62a8032 100644 --- a/application/project/controller/TaskStages.php +++ b/application/project/controller/TaskStages.php @@ -88,6 +88,24 @@ class TaskStages extends BasicApi $this->success('', $list); } + public function taskTree() + { + $where = []; + $code = Request::post('projectCode'); + if (!$code) { + $this->error("请选择一个项目"); + } + $where[] = ['project_code', '=', $code]; + $list = $this->model->where($where)->select(); + if ($list) { + foreach ($list as &$item) { + $item['type'] = 'stage'; + $item['tasks'] = $this->model->tasksTree($item['code']); + } + } + $this->success('', $list); + } + public function sort(Request $request) { $data = $request::only('preCode,nextCode');