diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index 871080661..bc4fcf5f5 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -470,11 +470,16 @@ class AdminController extends Controller { * @return array|false * 返回数据集 */ - protected function lists ($model,$where=array(),$order='',$field=true){ + protected function lists ($model,$where=array(),$order='',$field=true,$check_subsite=false){ $options = array(); $REQUEST = (array)I('request.'); if(is_string($model)){ - $model = M($model); + if($check_subsite){ + $model = SM($model); + }else{ + $model = M($model); + } + } $OPT = new \ReflectionProperty($model,'options'); diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index 655740236..297837013 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -90,7 +90,7 @@ class AuthManagerController extends AdminController{ * @author 朱亚杰 */ public function index(){ - $list = $this->lists('AuthGroup',array('module'=>'admin'),'id asc'); + $list = $this->lists('AuthGroup',array('module'=>'admin'),'id asc',true,true); $list = int_to_string($list); $this->assign( '_list', $list ); $this->assign( '_use_tip', true ); diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 39bca125e..00ed20b9c 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -502,6 +502,7 @@ class UserController extends AdminController $this->assign("authid", $au["group_id"]); $this->assign("houtai", $au["houtai"]); $list = D('AuthGroup')->where(array('status' => 1))->select(); + dd(D('AuthGroup')); $username = $_POST['username']; $password = $_POST['password']; $this->assign('lists', $list); diff --git a/Application/Admin/Model/AuthGroupModel.class.php b/Application/Admin/Model/AuthGroupModel.class.php index 30c10b25e..59dabdf40 100644 --- a/Application/Admin/Model/AuthGroupModel.class.php +++ b/Application/Admin/Model/AuthGroupModel.class.php @@ -15,7 +15,7 @@ use Think\Model; * Class AuthGroupModel * @author 朱亚杰 */ -class AuthGroupModel extends SubsiteModel { +class AuthGroupModel extends Model { const TYPE_ADMIN = 1; // 管理员用户组类型标识 const MEMBER = 'member'; const UCENTER_MEMBER = 'ucenter_member'; diff --git a/ThinkPHP/Common/functions.php b/ThinkPHP/Common/functions.php index af258c2ba..049d2265f 100644 --- a/ThinkPHP/Common/functions.php +++ b/ThinkPHP/Common/functions.php @@ -634,7 +634,7 @@ function M($name='', $tablePrefix='',$connection='') { * @param boolean $is_subsiteTable 是否强制使用子站 * @return Think\Model */ -function SM($name='', $tablePrefix='tab_',$is_subsiteTable=false) +function SM($name='', $tablePrefix='sys_',$is_subsiteTable=false) { if(empty($name)){ if(IS_SUBSITE){