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.
50 lines
1.5 KiB
50 lines
1.5 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | YFCMF [ WE CAN DO IT MORE SIMPLE ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: rainfer <81818832@qq.com>
|
|
// +----------------------------------------------------------------------
|
|
namespace app\admin\controller;
|
|
|
|
use think\Db;
|
|
|
|
class Ajax
|
|
{
|
|
/*
|
|
* 返回行政区域json字符串
|
|
*/
|
|
public function getRegion()
|
|
{
|
|
$map['pid']=input('pid');
|
|
$map['type']=input('type');
|
|
$list=Db::name("region")->where($map)->select();
|
|
return json($list);
|
|
}
|
|
/*
|
|
* 返回模块下控制器json字符串
|
|
*/
|
|
public function getController()
|
|
{
|
|
$module=input('request_module','admin');
|
|
$list=\ReadClass::readDir(APP_PATH . $module. DS .'controller');
|
|
return json($list);
|
|
}
|
|
/*
|
|
* 返回角色列表json字符串
|
|
*/
|
|
public function getRole()
|
|
{
|
|
$map['type']=input('pid');
|
|
if($map['type']==1){
|
|
$map1['member_group_id']=array(array('gt',0),array('neq',2));//>0 and !=2
|
|
$list=Db::name("member_group")->field(array('member_group_id'=>'id','member_group_name'=>'name'))->where($map1)->select();
|
|
}elseif($map['type']==2){
|
|
$map2['id']=array('gt',0);
|
|
$list=Db::name("auth_group")->field(array('id'=>'id','title'=>'name'))->where($map2)->select();
|
|
}
|
|
|
|
return json($list);
|
|
}
|
|
}
|