|
@@ -741,7 +741,7 @@ class ApproveInfoService
|
|
|
*
|
|
|
* @param integer $id 申请ID
|
|
|
* @param mixed $user 用户信息
|
|
|
- * @param string $group 类别:0=审批人/后台,1=提交人 审批详情,我的申请详情/信息
|
|
|
+ * @param string $group 类别:0=审批人/后台,1=提交人申请人 审批详情,我的申请详情/信息
|
|
|
* @param string $type 类型:detail=详情,info=信息
|
|
|
**/
|
|
|
public static function get_detail($id, $user, $group, $type)
|
|
@@ -778,25 +778,42 @@ class ApproveInfoService
|
|
|
if ($info) {
|
|
|
$module = $info['module'];
|
|
|
if ($group == CommonConstant::IS_WHO_1) {
|
|
|
- // 提交人
|
|
|
- $apply_user = [
|
|
|
+ // 先默认当前是提交人
|
|
|
+ $create_user = [
|
|
|
'id' => $user['id'],
|
|
|
'userid' => $user['userid'],
|
|
|
'name' => $user['name'],
|
|
|
'avatar' => $user['avatar'],
|
|
|
];
|
|
|
- $create_user = $apply_user;
|
|
|
+ $apply_user = $create_user;
|
|
|
if (in_array($module, [CommonConstant::MODULE_5, CommonConstant::MODULE_6, CommonConstant::MODULE_7])) {
|
|
|
- if ($info['user_id'] != $info['apply_user_id']) {
|
|
|
- $apply_user_info = User::field('id,userid,name,avatar')
|
|
|
- ->where('userid', $info['apply_user_id'])
|
|
|
- ->find();
|
|
|
- $apply_user = [
|
|
|
- 'id' => $apply_user_info['id'],
|
|
|
- 'userid' => $apply_user_info['userid'],
|
|
|
- 'name' => $apply_user_info['name'],
|
|
|
- 'avatar' => $apply_user_info['avatar'],
|
|
|
- ];
|
|
|
+ if($user['userid'] == $info['user_id']){
|
|
|
+ // 当前是提交人
|
|
|
+ if ($info['user_id'] != $info['apply_user_id']) {
|
|
|
+ $apply_user_info = User::field('id,userid,name,avatar')
|
|
|
+ ->where('userid', $info['apply_user_id'])
|
|
|
+ ->find();
|
|
|
+ $apply_user = [
|
|
|
+ 'id' => $apply_user_info['id'],
|
|
|
+ 'userid' => $apply_user_info['userid'],
|
|
|
+ 'name' => $apply_user_info['name'],
|
|
|
+ 'avatar' => $apply_user_info['avatar'],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($user['userid'] == $info['apply_user_id']){
|
|
|
+ // 当前是申请人
|
|
|
+ if ($info['user_id'] != $info['apply_user_id']) {
|
|
|
+ $apply_user_info = User::field('id,userid,name,avatar')
|
|
|
+ ->where('userid', $info['user_id'])
|
|
|
+ ->find();
|
|
|
+ $create_user = [
|
|
|
+ 'id' => $apply_user_info['id'],
|
|
|
+ 'userid' => $apply_user_info['userid'],
|
|
|
+ 'name' => $apply_user_info['name'],
|
|
|
+ 'avatar' => $apply_user_info['avatar'],
|
|
|
+ ];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -805,13 +822,13 @@ class ApproveInfoService
|
|
|
$apply_user = User::field('id,userid,name,avatar')
|
|
|
->where('userid', $info['apply_user_id'])
|
|
|
->find();
|
|
|
- $apply_user = [
|
|
|
+ $create_user = [
|
|
|
'id' => $apply_user['id'],
|
|
|
'userid' => $apply_user['userid'],
|
|
|
'name' => $apply_user['name'],
|
|
|
'avatar' => $apply_user['avatar'],
|
|
|
];
|
|
|
- $create_user = $apply_user;
|
|
|
+ $apply_user = $create_user;
|
|
|
if (in_array($module, [CommonConstant::MODULE_5, CommonConstant::MODULE_6, CommonConstant::MODULE_7])) {
|
|
|
|
|
|
if ($info['user_id'] != $info['apply_user_id']) {
|