|
|
|
@ -96,7 +96,24 @@ class MarketEvent extends Controller
|
|
|
|
|
$gid = M("auth_group_access")->where("uid = '{$uid}'")->getField('group_id');
|
|
|
|
|
return M('department','sys_')->where("id = '{$department_id}' and leader_group = '$gid'")->field("id")->find();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加部门总监的会长权限
|
|
|
|
|
* $uid,$promote_id
|
|
|
|
|
*/
|
|
|
|
|
public function addPresident($uid,$promote_id)
|
|
|
|
|
{
|
|
|
|
|
$leader_group = M("auth_group_access")
|
|
|
|
|
->alias("acc")
|
|
|
|
|
->where(['acc.uid'=>$uid])
|
|
|
|
|
->join("sys_auth_group as gro on acc.group_id = gro.id")
|
|
|
|
|
->join("sys_department as dep on gro.department_id = dep.id")
|
|
|
|
|
->getField("dep.leader_group",1);
|
|
|
|
|
if(!$leader_group){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
$info = M('auth_group','sys_')->where(['id'=>$leader_group])->find();
|
|
|
|
|
return M('auth_group','sys_')->where(['id'=>$leader_group])->save(['data_president'=>$info['data_president'].",".$promote_id]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getDepartmentUserId($department_id)
|
|
|
|
|
{
|
|
|
|
|