|
@@ -9240,7 +9240,9 @@ class NewsService implements NewsServiceInterface
|
|
|
Db::rollBack();
|
|
Db::rollBack();
|
|
|
return Result::error('添加失败');
|
|
return Result::error('添加失败');
|
|
|
}
|
|
}
|
|
|
- $users = json_decode($users_id ?? '[]',true);
|
|
|
|
|
|
|
+ if(!empty($users_id) && is_string($users_id)){
|
|
|
|
|
+ $users = json_decode($users_id ?? '[]',true);
|
|
|
|
|
+ }
|
|
|
$users_type4 = User::where('type_id', 4)->pluck('id');
|
|
$users_type4 = User::where('type_id', 4)->pluck('id');
|
|
|
$type4_num = array_intersect($users, $users_type4->toArray());
|
|
$type4_num = array_intersect($users, $users_type4->toArray());
|
|
|
if(count($users) != count($type4_num)){
|
|
if(count($users) != count($type4_num)){
|
|
@@ -9248,7 +9250,7 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::error('请选择调研员!');
|
|
return Result::error('请选择调研员!');
|
|
|
}
|
|
}
|
|
|
// return Result::success($users);
|
|
// return Result::success($users);
|
|
|
- if(!empty($users)){
|
|
|
|
|
|
|
+ if(!empty($users) && is_array($users)){
|
|
|
// 去重:确保同一 retopic_id + user_id 组合唯一
|
|
// 去重:确保同一 retopic_id + user_id 组合唯一
|
|
|
$users = array_values(array_unique($users));
|
|
$users = array_values(array_unique($users));
|
|
|
// 组装关联数据
|
|
// 组装关联数据
|
|
@@ -9336,7 +9338,9 @@ class NewsService implements NewsServiceInterface
|
|
|
Db::rollBack();
|
|
Db::rollBack();
|
|
|
return Result::error('编辑调研选题失败!');
|
|
return Result::error('编辑调研选题失败!');
|
|
|
}
|
|
}
|
|
|
- $users = json_decode($users_id ?? '[]',true);
|
|
|
|
|
|
|
+ if(!empty($users_id) && is_string($users_id)){
|
|
|
|
|
+ $users = json_decode($users_id ?? '[]',true);
|
|
|
|
|
+ }
|
|
|
// return Result::success($users);
|
|
// return Result::success($users);
|
|
|
$retopic_users = RetopicUser::where('retopic_id', $id)->pluck('user_id')->toArray();
|
|
$retopic_users = RetopicUser::where('retopic_id', $id)->pluck('user_id')->toArray();
|
|
|
if(!empty($retopic_users)){
|
|
if(!empty($retopic_users)){
|
|
@@ -9346,7 +9350,7 @@ class NewsService implements NewsServiceInterface
|
|
|
return Result::error('编辑同行人员失败!');
|
|
return Result::error('编辑同行人员失败!');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(!empty($users)){
|
|
|
|
|
|
|
+ if(!empty($users) && is_array($users)){
|
|
|
// 去重:确保同一 retopic_id + user_id 组合唯一
|
|
// 去重:确保同一 retopic_id + user_id 组合唯一
|
|
|
$users = array_values(array_unique($users));
|
|
$users = array_values(array_unique($users));
|
|
|
// 组装关联数据
|
|
// 组装关联数据
|