作者 lyh

gx

@@ -75,17 +75,18 @@ class TaskController extends BaseController @@ -75,17 +75,18 @@ class TaskController extends BaseController
75 $map['manage_id'] = $this->map['manage_id']; 75 $map['manage_id'] = $this->map['manage_id'];
76 } 76 }
77 } 77 }
78 - }elseif (isset($this->map['content']) && !empty($this->map['content'])){  
79 - $ids = $task->where('content', 'like','%'.$this->map['content'].'%')->pluck('id')->toArray();  
80 - $manage_ids = $taskOwnerModel->formatQuery(['task_id'=>['in',$ids]])->pluck('manage_id')->toArray();  
81 - $map['manage_id'] = ['in',$manage_ids];  
82 }elseif (isset($this->map['search_type']) && !empty($this->map['search_type'])){ 78 }elseif (isset($this->map['search_type']) && !empty($this->map['search_type'])){
83 if(isset($this->map['search']) && !empty($this->map['search'])) { 79 if(isset($this->map['search']) && !empty($this->map['search'])) {
84 $projectModel = new Project(); 80 $projectModel = new Project();
85 - $ids = $projectModel->where('title', 'like', '%' . $this->map['search'] . '%')->pluck('id')->toArray();  
86 - $manage_ids = $taskOwnerModel->formatQuery(['project'=>['in',$ids]])->pluck('manage_id')->toArray();  
87 - $map['manage_id'] = ['in',$manage_ids];  
88 - 81 + if($this->map['search_type'] == 'project'){
  82 + $ids = $projectModel->where('title', 'like', '%' . $this->map['search'] . '%')->pluck('id')->toArray();
  83 + $manage_ids = $taskOwnerModel->formatQuery(['project'=>['in',$ids]])->pluck('manage_id')->toArray();
  84 + $map['manage_id'] = ['in',$manage_ids];
  85 + }else{
  86 + $ids = $task->where('content', 'like','%'.$this->map['search'].'%')->pluck('id')->toArray();
  87 + $manage_ids = $taskOwnerModel->formatQuery(['task_id'=>['in',$ids]])->pluck('manage_id')->toArray();
  88 + $map['manage_id'] = ['in',$manage_ids];
  89 + }
89 } 90 }
90 }else{ 91 }else{
91 if(isset($this->map['search_type']) && !empty($this->map['search_type'])){ 92 if(isset($this->map['search_type']) && !empty($this->map['search_type'])){
@@ -73,7 +73,7 @@ class ComController extends BaseController @@ -73,7 +73,7 @@ class ComController extends BaseController
73 ]); 73 ]);
74 $userLogic = new UserLogic(); 74 $userLogic = new UserLogic();
75 $this->param['id'] = $this->uid; 75 $this->param['id'] = $this->uid;
76 - $userLogic->edits($this->param); 76 + $userLogic->edits();
77 $this->response('编辑成功'); 77 $this->response('编辑成功');
78 } 78 }
79 79
@@ -74,7 +74,7 @@ class UserLogic extends BaseLogic @@ -74,7 +74,7 @@ class UserLogic extends BaseLogic
74 } 74 }
75 $this->param['type'] = 1; 75 $this->param['type'] = 1;
76 $this->param['operator_id'] = $this->user['id']; 76 $this->param['operator_id'] = $this->user['id'];
77 - $this->edits($this->param); 77 + $this->edits();
78 return $this->success(); 78 return $this->success();
79 } 79 }
80 80
@@ -116,20 +116,24 @@ class UserLogic extends BaseLogic @@ -116,20 +116,24 @@ class UserLogic extends BaseLogic
116 * @method :post 116 * @method :post
117 * @time :2023/6/17 16:41 117 * @time :2023/6/17 16:41
118 */ 118 */
119 - public function edits($param){  
120 - //查看密码是否修改  
121 - $info = $this->model->read(['id'=>$param['id']]);  
122 - $param['password'] = base64_encode(md5($param['password']));  
123 - if($param['password'] == $info['password']){  
124 - unset($param['password']); 119 + public function edits(){
  120 + if(!isset($this->param['password']) || empty($this->param['password'])){
  121 + unset($this->param['password']);
  122 + }else{
  123 + $this->param['password'] = base64_encode(md5($this->param['password']));
  124 + }
  125 + $info = $this->model->read(['mobile'=>$this->param['mobile'],
  126 + 'project_id'=>$this->user['project_id'],'id'=>['!=',$this->param['id']]]);
  127 + if($info !== false){
  128 + $this->fail('当前手机号码已注册');
125 } 129 }
126 //密码加密 130 //密码加密
127 - $rs = $this->model->edit($param,['id'=>$param['id']]); 131 + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
128 if($rs === false){ 132 if($rs === false){
129 $this->fail('系统错误,请联系管理员'); 133 $this->fail('系统错误,请联系管理员');
130 } 134 }
131 //清空当前用户登录缓存 135 //清空当前用户登录缓存
132 - Cache::pull($info['token']); 136 + Cache::pull($this->user['token']);
133 return $this->success(); 137 return $this->success();
134 } 138 }
135 } 139 }