$mainId, 'delStatus' => 0]; return self::getList('*', $where, 'addTime DESC'); } //获取商家所有的角色名称 ssh 2019.12.10 public static function getNameList($sjId) { $respond = self::getRoleList($sjId); return isset($respond['list']) && !empty($respond['list']) ? array_column($respond['list'], 'roleName') : []; } //更新角色 ssh 2019.12.10 public static function updateRole($role, $data) { $sjId = $role['sjId']; if ($role['roleName'] != $data['roleName']) { $name = $data['roleName']; $nameList = self::getNameList($sjId); if (in_array($name, $nameList)) { util::fail('名称已经存在'); } } $id = $role['id']; return self::updateById($id, $data); } //删除角色 ssh 2019.12.10 public static function deleteRole($role) { if (isset($role['num']) && !empty($role['num'])) { util::fail('还有成员,不能删除'); } $id = $role['id']; return self::updateById($id, ['delStatus' => 1]); } //创建管理员角色 ssh 2020.2.8 public static function addAdminRole($data) { return self::add($data); } }