智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.6 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace core\base;
use app\model\campus_person_role\CampusPersonRole;
use app\model\personnel\Personnel;
/**
* 后台基础服务层
* Class BaseAdminService
* @package app\service\admin
*/
class BaseAdminService extends BaseService
{
protected $username;
protected $uid;
protected $campus_id;
public function __construct()
{
parent::__construct();
$this->username = $this->request->username();
$this->uid = $this->request->uid();
$this->campus_id = '';
$person = new Personnel();
$campusPersonRole = new CampusPersonRole();
if($this->uid > 1){
$person_id = $person->where(['sys_user_id' => $this->uid])->value("id");
$role_info = $campusPersonRole->where(['person_id' => $person_id])->find();
if (in_array($role_info['role_id'], [1, 7])) {
$this->campus_id = '';
}else{
$this->campus_id = $role_info['campus_id'];
}
}
}
}