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;