1、设置超级岗位不能修改
2、超级管理员信息不支持修改
This commit is contained in:
parent
65575f970b
commit
83302f2501
@ -1095,7 +1095,7 @@ CREATE TABLE `oa_position` (
|
||||
-- ----------------------------
|
||||
-- Records of oa_position
|
||||
-- ----------------------------
|
||||
INSERT INTO `oa_position` VALUES (1, '超级岗位', 1000, '超级岗位,不能轻易修改权限', 1, 0, 0);
|
||||
INSERT INTO `oa_position` VALUES (1, '超级岗位', 1000, '超级岗位,不能修改', 1, 0, 0);
|
||||
INSERT INTO `oa_position` VALUES (2, '人事总监', 1000, '人事部的最大领导', 1, 0, 0);
|
||||
INSERT INTO `oa_position` VALUES (3, '普通员工', 500, '普通员工', 1, 0, 0);
|
||||
|
||||
|
@ -39,6 +39,9 @@ class Position extends BaseController
|
||||
$param = get_params();
|
||||
if (request()->isAjax()) {
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
if ($param['id'] == 1) {
|
||||
return to_assign(1, "超级岗位,不能修改");
|
||||
}
|
||||
try {
|
||||
validate(PositionCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
@ -162,7 +165,7 @@ class Position extends BaseController
|
||||
{
|
||||
$id = get_params("id");
|
||||
if ($id == 1) {
|
||||
return to_assign(0, "超级岗位,不能删除");
|
||||
return to_assign(1, "超级岗位,不能删除");
|
||||
}
|
||||
$data['status'] = '-1';
|
||||
$data['id'] = $id;
|
||||
|
@ -69,6 +69,9 @@ class User extends BaseController
|
||||
$username = $pinyin->name($param['name'], PINYIN_UMLAUT_V);
|
||||
$param['username'] = implode('', $username);
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
if($param['id'] == 1){
|
||||
return to_assign(1, '超级员工资料不支持修改');
|
||||
}
|
||||
$count = Db::name('Admin')->where([['username','=',$param['username']],['id','<>',$param['id']],['status','>=',0]])->count();
|
||||
if ($count > 0) {
|
||||
$count_e = Db::name('Admin')->where([['username', 'like', $param['username'].'%']])->count();
|
||||
|
Loading…
x
Reference in New Issue
Block a user