逻辑调整

main
limu 1 year ago
parent 46dff41c41
commit 0c5afe6524
  1. 11
      app/controller/admin/user/User.php

@ -616,10 +616,19 @@ class User extends BaseController
$id = (int)$this->request->param('uid', '');
if (!$this->repository->exists($id))
return app('json')->fail('数据不存在');
$is_cf = false;
foreach ($partner_id as $k => $value) {
$count = array_count_values($partner_id); // 统计每个元素的出现次数
if (isset($count[$value]) && $count[$value] > 1) {
$is_cf = true;
}
$partner_ids[$k] = (int)$value;
if (!$partnerRepository->exists((int)$value))
if (!$partnerRepository->exists((int)$value)) {
return app('json')->fail('所选合作人角色不存在');
}
}
if($is_cf){
return app('json')->fail('请勿给用户设置重复的角色');
}
foreach ($user_role_id as $k => $value) {
$user_role_ids[$k] = (int)$value;

Loading…
Cancel
Save