diff --git a/back/application/api/controller/Story.php b/back/application/api/controller/Story.php index 4a058be..5e87993 100644 --- a/back/application/api/controller/Story.php +++ b/back/application/api/controller/Story.php @@ -68,7 +68,6 @@ class Story extends Common ->where('u.user_type', 1) ->where('u.id', $opStory['story_manager']) ->find(); - if (null != $ret) { $opStory['story_managername'] = $ret['staff_name']; @@ -193,15 +192,15 @@ class Story extends Common ->where('story_id', $param['story_id']) ->find(); if ($story_info) { - - $user = new User(); - $story_info_member = explode(',', $story_info['story_member']); foreach ($story_info_member as $memberId) { - - $user_info = $user->GetUserInfoByLoginId($memberId); - $item['id'] = $user_info['id']; - $item['staff_name'] = $user_info['name']; + $ret = db('system_user')->alias('u') + ->join('hr_staff s','s.staff_id=u.user_id', 'left') + ->where('u.user_type', 1) + ->where('u.id', $memberId) + ->find(); + $item['id'] = $memberId; + $item['staff_name'] = $ret['staff_name']; $array[] = $item; } } @@ -247,8 +246,13 @@ class Story extends Common $user = new User(); for ($i=0; $iGetUserInfoByLoginId($opTasks[$i]['task_processor']); - $opTasks[$i]['task_processor_name'] = $user_info['name']; + // $user_info = $user->GetUserInfoByLoginId($opTasks[$i]['task_processor']); + $ret = db('system_user')->alias('u') + ->join('hr_staff s','s.staff_id=u.user_id', 'left') + ->where('u.user_type', 1) + ->where('u.id', $opTasks[$i]['task_processor']) + ->find(); + $opTasks[$i]['task_processor_name'] = $ret['staff_name']; } return $this->sendSuccess($opTasks); }