info($this->userId,$this->orgId); if($info){ $orgName = Db::name('org') ->where('id',$this->orgId) ->value('name'); $info['orgName'] = $orgName; $info['h5pre'] = config('app.addr_url'); HelpHander::success($info); }else{ HelpHander::error(model('User')->getError()); } } //维修人员分组列表 public function wxGroup(){ $list= Db::name('repair_group') ->where([ 'org_id'=>$this->orgId, 'del'=>0, 'enable'=>1 ])->field('id,title')->select(); HelpHander::success($list); } //维修分组人员 public function wxGroupUser(){ $id = input('id/d',0); $userIds = Db::name('repair_group') ->where([ 'del'=>0, 'enable'=>1, 'id'=>$id ]) ->value('users'); $list = explode(',',$userIds); $users = []; $ids = Db::name('roles') ->where('org_id',$this->orgId) ->where('parent_id',7) ->where('del',0) ->where('enable',1) ->column('id'); $user = Db::name('user') ->alias('a') ->join('user_org b','a.id = b.user_id') ->join('user_roles c','a.id = c.user_id') ->where('a.del',0) ->where('a.enable',1) ->where('b.org_id',$this->orgId) ->where('c.roles_id','in',$ids) ->column('real_name','a.id'); foreach ($list as $k=>$v){ $users[] = ['id'=>$v,'real_name'=>$user[$v]]; } HelpHander::success($users); } public function exusers(){ $id = input('id/d',0); $work = input('work/d',1); if(!in_array($work,[-1,0,1])){ HelpHander::error('参数错误'); } $users = model('WorkTypeMode')->getRolesUserApp($id,$this->orgId,$work); HelpHander::success($users); } //品控执行人列表 public function qualityUserList(){ $users = model('WorkTypeMode')->getRolesUser(18,$this->orgId,1); $list = []; foreach ($users as $k=>$v){ foreach ($v['user'] as $v1){ $list[] = $v1; } } HelpHander::success($list); } //品控知会人列表 public function qualityIformUserList(){ $id = input('id/d',0); $users = model('WorkTypeMode')->commonRolesUserList($id,$this->orgId); HelpHander::success($users); } //公共角色列表 public function commonRoles(){ $commons = model('Roles')->getCommonList(1); $a = []; foreach ($commons as $k=>$v){ $a[] = [ 'id'=>$v['id'], 'title'=>$v['name'], ]; } HelpHander::success($a); } //获取二级调度角色 public function getTwoDispatchRoles(){ $type = input('id/d',1); $list = model('user')->get_two_dispatch_role1($this->orgId,$type); HelpHander::success($list); } //判断工人是否可以自发 public function isSpontaneous(){ $workType = input('WorkTypeMode/d',1); $roles = input('rolesId/d',0); if(!in_array($workType,[0,1,2,3,4])){ HelpHander::error('订单类型错误'); } $rolesInfo = Db::name('roles') ->where('id',$roles) ->find(); if($rolesInfo['parent_id'] >0){ $roles = $rolesInfo['parent_id']; } $map[] = ['','exp',Db::raw("FIND_IN_SET(".$roles.",roles)")]; $info = Db::name('work_type_mode') ->where($map) ->column('id'); if(empty($info)){ $off = 0; }else{ if(!in_array($workType,$info)){ $off = 0; }else{ $off = 1; } } HelpHander::success($off); } public function updateHeadImage(){ $headimage = input('imageUrl','','trim'); $ret=Db::name('user') ->where('id',$this->userId) ->update(['head_image'=>$headimage]); if($ret){ HelpHander::success(null,'修改成功'); }else{ HelpHander::error('修改失败'); } } }