From a47c4c8d31bcc82a6b65abaf0e048a3e906e10a9 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Wed, 28 Aug 2019 10:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=90=E5=91=98=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=B1=95=E7=A4=BA=EF=BC=8C=E6=94=AF=E6=8C=81=E4=BB=8E?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=E4=BB=BB=E5=8A=A1=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E8=80=85=E5=A4=84=E5=BF=AB=E9=80=9F=E6=9F=A5=E7=9C=8B=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=BD=93=E5=89=8D=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- application/common/Model/Task.php | 2 +- application/project/controller/Account.php | 3 +++ .../project/controller/DepartmentMember.php | 14 ++++++++++++++ application/project/controller/TaskMember.php | 5 ++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/application/common/Model/Task.php b/application/common/Model/Task.php index 5f634bc..51c3e12 100644 --- a/application/common/Model/Task.php +++ b/application/common/Model/Task.php @@ -484,7 +484,7 @@ class Task extends CommonModel if ($done != -1) { $doneSql = " and t.done = {$done}"; } - $sql = "select *,t.id as id,t.name as name,t.code as code,t.create_time as create_time from {$prefix}task as t join {$prefix}project as p on t.project_code = p.code where t.deleted = 0 {$doneSql} and t.assign_to = '{$memberCode}' and p.deleted = 0 order by t.id desc"; + $sql = "select *,t.id as id,t.name as name,t.code as code,t.create_time as create_time,t.end_time,t.begin_time from {$prefix}task as t join {$prefix}project as p on t.project_code = p.code where t.deleted = 0 {$doneSql} and t.assign_to = '{$memberCode}' and p.deleted = 0 order by t.id desc"; $total = Db::query($sql); $total = count($total); $sql .= " limit {$offset},{$limit}"; diff --git a/application/project/controller/Account.php b/application/project/controller/Account.php index 1a314fa..c0a405f 100644 --- a/application/project/controller/Account.php +++ b/application/project/controller/Account.php @@ -73,11 +73,14 @@ class Account extends BasicApi } $list = $this->model->_list($where, 'id asc'); if ($list['list']) { + $organizaionCode = getCurrentOrganizationCode(); foreach ($list['list'] as &$item) { $memberInfo = Member::where(['code' => $item['member_code']])->field('id', true)->find(); if ($memberInfo) { $item['avatar'] = $memberInfo['avatar']; } + $memberAccount = MemberAccount::where(['member_code' => $memberInfo['code'], 'organization_code' => $organizaionCode])->field('code,status,authorize')->find(); + $item['membar_account_code'] = $memberAccount ? $memberAccount['code'] : ''; $departments = []; $departmentCodes = $item['department_code']; if ($departmentCodes) { diff --git a/application/project/controller/DepartmentMember.php b/application/project/controller/DepartmentMember.php index 91315c9..84b9beb 100644 --- a/application/project/controller/DepartmentMember.php +++ b/application/project/controller/DepartmentMember.php @@ -48,6 +48,20 @@ class DepartmentMember extends BasicApi $this->success('', $list); } + /** + * 成员详情 + * @throws DataNotFoundException + * @throws DbException + * @throws ModelNotFoundException + */ + public function detail() + { + $code = Request::param('code'); + $organization = Request::param('organization'); + $member = MemberAccount::alias('m')->join('projectAuth a', 'a.id = m.authorize')->join('member mb','mb.code = m.member_code')->where(['m.member_code' => $code,'m.organization_code'=>$organization])->field('*,m.member_code as code,m.name as name')->find(); + $this->success('', $member); + } + /** * 邀请成员查询 diff --git a/application/project/controller/TaskMember.php b/application/project/controller/TaskMember.php index 73be49d..d2506a2 100644 --- a/application/project/controller/TaskMember.php +++ b/application/project/controller/TaskMember.php @@ -29,11 +29,14 @@ class TaskMember extends BasicApi $taskCode = Request::post('taskCode'); $where = []; $where[] = ['task_code', '=', $taskCode]; - $list = $this->model->_list($where,'is_owner desc'); + $list = $this->model->_list($where, 'is_owner desc'); if ($list['list']) { + $organizaionCode = getCurrentOrganizationCode(); foreach ($list['list'] as &$item) { $member = Member::where(['code' => $item['member_code']])->field('id,name,avatar,code')->find(); !$member && $member = []; + $memberAccount = MemberAccount::where(['member_code' => $member['code'], 'organization_code' => $organizaionCode])->field('code,status,authorize')->find(); + $member['membar_account_code'] = $memberAccount ? $memberAccount['code'] : ''; $member['is_executor'] = $item['is_executor']; $member['is_owner'] = $item['is_owner']; $item = $member;