Merge pull request 'feature/finance_payment_20210115' (#270) from feature/finance_payment_20210115 into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/270
master
廖金灵 4 years ago
commit 036ef1943c

@ -160,7 +160,7 @@ function get_marking($id)
return $game['marking'];
}
function get_auth_group_name($uid){
$model = D("auth_group_access");
$model = SM("auth_group_access");
$res = $model->join("sys_auth_group on sys_auth_group.id = sys_auth_group_access.group_id")
->field("title")
->where("uid=".$uid)
@ -1584,7 +1584,7 @@ function getGameList($partner_id) {
}
function getAdminData ($uid) {
$adminData = M('auth_group_access')
$adminData = SM('auth_group_access','sys_')
->field('data_empower_type,data_president,show_data,show_market_admin,show_promote')
->join('left join sys_auth_group on sys_auth_group_access.group_id=sys_auth_group.id')
->where(array('uid'=>$uid))->find();

@ -1057,21 +1057,6 @@ function showNumPercent($num)
}
}
//优化子站点实例化方法
function SM($name='', $tablePrefix='tab_',$is_subsiteTable=false)
{
if(empty($name)){
if(IS_SUBSITE){
return M($name, $tablePrefix,SUBSITE_DB);
}
}else{
$tableName = strtolower($tablePrefix.unCamelize($name));
if(is_subsiteTable($tableName) || $is_subsiteTable){
return M($name, $tablePrefix,SUBSITE_DB);
}
}
return M($name, $tablePrefix);
}
//判断是否有子站点表格
function is_subsiteTable($tableName,$is_subsiteTable=false)
{

@ -117,6 +117,13 @@ return array(
/*分库的表格*/
'SUBSITE_TABLE'=>[
"sys_auth_group",
"sys_auth_group_access",
"sys_ucenter_member",
"sys_menu",
"sys_member",
'sys_auth_rule',
"sys_action_log",
"sub_user_statement",
"tab_index_chart",
"tab_company_statement",
@ -125,7 +132,6 @@ return array(
"tab_market_altogether",
"tab_cmd_tasks",
"tab_operation_log",
"sys_action_log",
"tab_reward_detail",
"tab_reward_record",
"tab_new_company_statement_info",

@ -22,7 +22,7 @@ class ActionController extends AdminController {
public function actionLog(){
//获取列表数据
$map['status'] = array('gt', -1);
$list = $this->lists('ActionLog', $map);
$list = $this->lists('ActionLog', $map,'id desc',true,true);
int_to_string($list);
foreach ($list as $key=>$value){
$model_id = get_document_field($value['model'],"name","id");
@ -48,7 +48,7 @@ class ActionController extends AdminController {
public function edit($id = 0){
empty($id) && $this->error('参数错误!');
$info = M('ActionLog')->field(true)->find($id);
$info = SM('ActionLog')->field(true)->find($id);
$this->assign('info', $info);
$this->meta_title = '查看行为日志';
@ -73,7 +73,7 @@ class ActionController extends AdminController {
}elseif (is_numeric($ids)){
$map['id'] = $ids;
}
$res = M('ActionLog')->where($map)->delete();
$res = SM('ActionLog')->where($map)->delete();
\Think\Log::actionLog("Action/remove",'Action',1);
if($res !== false){
$this->success('删除成功!');
@ -86,7 +86,7 @@ class ActionController extends AdminController {
* 清空日志
*/
public function clear(){
$res = M('ActionLog')->where('1=1')->delete();
$res = SM('ActionLog')->where('1=1')->delete();
\Think\Log::actionLog("Action/clear",'Action',1);
if($res !== false){
$this->success('日志清空成功!');

@ -20,6 +20,7 @@ class AdminController extends Controller {
* 后台控制器初始化
*/
protected function _initialize(){
// 获取当前用户ID
if(defined('UID')) return ;
define('UID',is_login());
@ -90,12 +91,11 @@ class AdminController extends Controller {
}
$map2['uid'] = session("user_auth.uid");
$res = M('auth_group_access','sys_')->field('uid,group_id')->where($map2)->find();
$res = SM('auth_group_access','sys_')->field('uid,group_id')->where($map2)->find();
$map1['id'] = $res['group_id'];
$res1 = M('auth_group','sys_')->field('title')->where($map1)->find();
$res1 = SM('auth_group','sys_')->field('title')->where($map1)->find();
$this->assign('res',$res);
$this->assign('res1',$res1);
$this->assign('__MENU__', $this->getMenus());
$this->assign('is_admin', IS_ROOT);
}
@ -106,7 +106,7 @@ class AdminController extends Controller {
{
$flag =false;
$id= 0;
$ruleres = M("auth_rule")->field("id,type")->where("name LIKE '%{$rule}%'")->select();
$ruleres = SM("auth_rule","sys_")->field("id,type")->where("name LIKE '%{$rule}%'")->select();
foreach ($ruleres as $k => $v) {
$checkRule = $this->checkRule($rule,array('eq',$v['type']));
if(!$checkRule){
@ -123,10 +123,10 @@ class AdminController extends Controller {
$where['pid'] = 0;
$where['hide'] = 0;
$where['url'] = array("like",$rulearr[1]."/".$rulearr[2]);
$second_id = M('Menu')->where($where)->field('id')->find()['id'];
$second_id = SM('Menu',"sys_")->where($where)->field('id')->find()['id'];
$where2['pid'] = $second_id;
$where2['hide'] = 0;
$menu = M('Menu')->where($where2)->field('id,url')->order('sort asc')->select();
$menu = SM('Menu',"sys_")->where($where2)->field('id,url')->order('sort asc')->select();
foreach ($menu as $k=>$v) {
$to_check_url = $v['url'];
if( stripos($to_check_url,MODULE_NAME)!==0 ){
@ -210,17 +210,22 @@ class AdminController extends Controller {
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
final protected function editRow ( $model ,$data, $where , $msg ){
final protected function editRow ( $model ,$data, $where , $msg = [] , $is_subsite = false){
$id = array_unique((array)I('id',0));
$id = is_array($id) ? implode(',',$id) : $id;
if( $is_subsite ) {
$Model = SM($model);
}else {
$Model = M($model);
}
//如存在id字段则加入该条件
$fields = D($model)->getDbFields();
$fields = $Model->getDbFields();
if(in_array('id',$fields) && !empty($id)){
$where = array_merge( array('id' => array('in', $id )) ,(array)$where );
}
$msg = array_merge( array( 'success'=>'操作成功!', 'error'=>'操作失败!', 'url'=>'' ,'ajax'=>IS_AJAX) , (array)$msg );
if( D($model)->where($where)->save($data)!==false ) {
if( $Model->where($where)->save($data)!==false ) {
$this->success($msg['success'],$msg['url'],$msg['ajax']);
}else{
$this->error($msg['error'],$msg['url'],$msg['ajax']);
@ -324,7 +329,7 @@ class AdminController extends Controller {
if(!C('DEVELOP_MODE')){ // 是否开发者模式
$where['is_dev'] = 0;
}
$menus['main'] = M('Menu')->where($where)->order('sort asc')->field('id,title,url')->select();
$menus['main'] = SM('Menu','sys_')->where($where)->order('sort asc')->field('id,title,url')->select();
$menus['child'] = array(); //设置子节点
foreach ($menus['main'] as $key => $item) {
@ -340,16 +345,16 @@ class AdminController extends Controller {
}
// 查找当前子菜单
$pid = M('Menu')->where("pid !=0 AND url like '%{$controller}/".ACTION_NAME."%'")->getField('pid');
$pid = SM('Menu','sys_')->where("pid !=0 AND url like '%{$controller}/".ACTION_NAME."%'")->getField('pid');
if($pid){
// 查找当前主菜单
$nav = M('Menu')->find($pid);
$nav = SM('Menu','sys_')->find($pid);
// if($nav['pid']){
// $nav = M('Menu')->find($nav['pid']);
// }
while ($nav['pid'] != 0) {
$nav = M('Menu')->find($nav['pid']);
$nav = SM('Menu','sys_')->find($nav['pid']);
}
//var_dump($nav);exit;
foreach ($menus['main'] as $key => $item) {
@ -358,7 +363,7 @@ class AdminController extends Controller {
if($item['id'] == $nav['id']){
$menus['main'][$key]['class']='current';
//生成child树
$groups = M('Menu')->where(array('group'=>array('neq',''),'pid' =>$item['id']))->order('sort asc')->distinct(true)->getField("group",true);
$groups = SM('Menu','sys_')->where(array('group'=>array('neq',''),'pid' =>$item['id']))->order('sort asc')->distinct(true)->getField("group",true);
//获取二级分类的合法url
$where = array();
$where['pid'] = $item['id'];
@ -366,7 +371,7 @@ class AdminController extends Controller {
if(!C('DEVELOP_MODE')){ // 是否开发者模式
$where['is_dev'] = 0;
}
$second_urls = M('Menu')->where($where)->getField('id,url');
$second_urls = SM('Menu','sys_')->where($where)->getField('id,url');
if(!IS_ROOT){
// 检测菜单权限
@ -397,7 +402,7 @@ class AdminController extends Controller {
if(!C('DEVELOP_MODE')){ // 是否开发者模式
$map['is_dev'] = 0;
}
$menuList = M('Menu')->where($map)->field('id,pid,title,url,tip')->order('sort asc')->select();
$menuList = SM('Menu','sys_')->where($map)->field('id,pid,title,url,tip')->order('sort asc')->select();
$menus['child'][$g] = list_to_tree($menuList, 'id', 'pid', 'operater', $item['id']);
}
@ -425,7 +430,7 @@ class AdminController extends Controller {
return $tree_nodes[$tree];
}
if((int)$tree){
$list = M('Menu')->field('id,pid,title,url,tip,hide')->where('hide = 0')->order('sort asc')->select();
$list = SM('Menu',"sys_")->field('id,pid,title,url,tip,hide')->where('hide = 0')->order('sort asc')->select();
foreach ($list as $key => $value) {
if( stripos($value['url'],MODULE_NAME)!==0 ){
$list[$key]['url'] = MODULE_NAME.'/'.$value['url'];
@ -439,7 +444,7 @@ class AdminController extends Controller {
}
}
}else{
$nodes = M('Menu')->field('title,url,tip,pid')->order('sort asc')->select();
$nodes = SM('Menu',"sys_")->field('title,url,tip,pid')->order('sort asc')->select();
foreach ($nodes as $key => $value) {
if( stripos($value['url'],MODULE_NAME)!==0 ){
$nodes[$key]['url'] = MODULE_NAME.'/'.$value['url'];
@ -470,11 +475,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');

@ -27,7 +27,7 @@ class AuthManagerController extends AdminController{
//需要新增的节点必然位于$nodes
$nodes = $this->returnNodes(false);
$AuthRule = M('AuthRule');
$AuthRule = SM('AuthRule');
$map = array('module'=>'admin','type'=>array('in','1,2'));//status全部取出,以进行更新
//需要更新和删除的节点必然位于$rules
$rules = $AuthRule->where($map)->order('name')->select();
@ -90,7 +90,7 @@ class AuthManagerController extends AdminController{
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
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 );
@ -128,7 +128,7 @@ class AuthManagerController extends AdminController{
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
public function editGroup(){
$auth_group = M('AuthGroup')->where( array('module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
$auth_group = SM('AuthGroup')->where( array('module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
->find( (int)$_GET['id'] );
$this->assign('auth_group',$auth_group);
$this->meta_title = '编辑用户组';
@ -151,9 +151,9 @@ class AuthManagerController extends AdminController{
->getfield('id,id,title,rules');
$node_list = $this->returnNodes();
$map = array('module'=>'admin','type'=>AuthRuleModel::RULE_MAIN,'status'=>1);
$main_rules = M('AuthRule')->where($map)->getField('name,id');
$main_rules = SM('AuthRule')->where($map)->getField('name,id');
$map = array('module'=>'admin','type'=>AuthRuleModel::RULE_URL,'status'=>1);
$child_rules = M('AuthRule')->where($map)->getField('name,id');
$child_rules = SM('AuthRule')->where($map)->getField('name,id');
$this->assign('main_rules', $main_rules);
$this->assign('auth_rules', $child_rules);
@ -205,40 +205,30 @@ class AuthManagerController extends AdminController{
}
}
if(isset($_POST['rules'])){
$isrules = true;
if(!empty($ruleiddata)){
$_POST['rules'] = array_merge($_POST['rules'],$ruleiddata);
}
sort($_POST['rules']);
$_POST['rules'] = implode( ',' , array_unique($_POST['rules']));
}else{
$isrules = false;
$_POST['rules'] = '';
}
$_POST['module'] = 'admin';
$_POST['type'] = AuthGroupModel::TYPE_ADMIN;
$AuthGroup = D('AuthGroup');
$AuthGroup = SM('AuthGroup');
$data = $AuthGroup->create();
if ( $data ) {
if ( empty($data['id']) ) {
if(!IS_SUBSITE){
\Think\Log::actionLog('AuthManager/createGroup','authGroup',1);
}
$r = $AuthGroup->syncAdd($data);
\Think\Log::actionLog('AuthManager/createGroup','authGroup',1);
$r = $AuthGroup->add($data);
addOperationLog(array(
"op_type"=>0,
"key"=> $_POST['title'],
"url"=>U("AuthManager/index")
));
}else{
if(!IS_SUBSITE){
\Think\Log::actionLog('AuthManager/editGroup','authGroup',1);
}
if($isrules){
$r = SM("auth_group","sys_")->save($data);
}else{
$r = $AuthGroup->where("id={$data['id']}")->syncSave($data);
}
\Think\Log::actionLog('AuthManager/editGroup','authGroup',1);
$r = SM("auth_group","sys_")->save($data);
//操作日志不传title表示是访问授权
$oparr = array(
@ -275,7 +265,7 @@ class AuthManagerController extends AdminController{
}else{
$ids = $_REQUEST['id'];
}
$lr = M("AuthGroup")->field('title,status')->where("id in ({$ids})")->select();
$lr = SM("AuthGroup")->field('title,status')->where("id in ({$ids})")->select();
$status = 0;
$op_name ='';
$op_type =1;
@ -319,7 +309,7 @@ class AuthManagerController extends AdminController{
"status"=>$status
];
// dd($savedata);
$res = D("AuthGroup")->where("id in ({$ids})")->syncSave($savedata);
$res = SM("AuthGroup")->where("id in ({$ids})")->save($savedata);
if($res !==false ){
$this->success($msg['success'],$msg['url'],$msg['ajax']);
}else{
@ -339,14 +329,14 @@ class AuthManagerController extends AdminController{
$this->error('参数错误');
}
$auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
$auth_group = SM('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
->getfield('id,id,title,rules');
$prefix = C('DB_PREFIX');
$l_table = $prefix.(AuthGroupModel::MEMBER);
$r_table = $prefix.(AuthGroupModel::AUTH_GROUP_ACCESS);
$model = M()->table( $l_table.' m' )->join ( $r_table.' a ON m.uid=a.uid' );
$model = SM()->table( $l_table.' m' )->join ( $r_table.' a ON m.uid=a.uid' );
$_REQUEST = array();
$list = $this->lists($model,array('a.group_id'=>$group_id,'m.status'=>array('egt',0)),'m.uid asc','m.uid,m.nickname,m.last_login_time,m.last_login_ip,m.status');
$list = $this->lists($model,array('a.group_id'=>$group_id,'m.status'=>array('egt',0)),'m.uid asc','m.uid,m.nickname,m.last_login_time,m.last_login_ip,m.status',true,true);
int_to_string($list);
$this->assign( '_list', $list );
$this->assign('auth_group', $auth_group);
@ -418,7 +408,7 @@ class AuthManagerController extends AdminController{
}
$AuthGroup = D('AuthGroup');
if(is_numeric($uid)){
if ( is_administrator($uid) ) {
if ( $uid == 1 ) {
$this->error('该用户为超级管理员');
}
if( !M('Member')->where(array('uid'=>$uid))->find() ){

@ -5688,7 +5688,7 @@ class ExportController extends Controller
$row = $_REQUEST['row']?$_REQUEST['row']:10;
$data=M('Member')
$data=SM('Member')
->where($map)
->order('uid desc')
->select();
@ -7766,7 +7766,7 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
$model = M('AuthGroup');
$model = SM('AuthGroup');
$xlsCell = array(
array('title','用户组'),
@ -7821,7 +7821,7 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
$model = M('ActionLog');
$model = SM('ActionLog');
$xlsCell = array(
array('id','编号'),

@ -27,11 +27,11 @@ class MenuController extends AdminController {
}
$title = trim(I('get.title'));
$type = C('CONFIG_GROUP_LIST');
$all_menu = M('Menu')->getField('id,title');
$all_menu = SM('Menu')->getField('id,title');
$map['pid'] = $pid;
if($title)
$map['title'] = array('like',"%{$title}%");
$list = M("Menu")->where($map)->field(true)->order('sort asc,id asc')->select();
$list = SM("Menu")->where($map)->field(true)->order('sort asc,id asc')->select();
int_to_string($list,array('hide'=>array(1=>'是',0=>'否'),'is_dev'=>array(1=>'是',0=>'否')));
if($list) {
@ -45,15 +45,11 @@ class MenuController extends AdminController {
}
// 记录当前列表页的cookie
Cookie('__forward__',$_SERVER['REQUEST_URI']);
$this->meta_title = '菜单列表';
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->display();
}
@ -63,7 +59,7 @@ class MenuController extends AdminController {
*/
public function add(){
if(IS_POST){
$Menu = D('Menu');
$Menu = SM('Menu');
$data = $Menu->create();
if($data){
$id = $Menu->add();
@ -80,17 +76,16 @@ class MenuController extends AdminController {
}
} else {
$this->assign('info',array('pid'=>I('pid')));
$menus = M('Menu')->field(true)->select();
$menus = SM('Menu')->field(true)->select();
$menus = D('Common/Tree')->toFormatTree($menus);
$menus = array_merge(array(0=>array('id'=>0,'title_show'=>'顶级菜单')), $menus);
$this->assign('Menus', $menus);
$this->meta_title = '新增后台菜单';
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->display('edit');
}
@ -102,7 +97,7 @@ class MenuController extends AdminController {
*/
public function edit($id = 0){
if(IS_POST){
$Menu = D('Menu');
$Menu = SM('Menu');
$data = $Menu->create();
if($data){
if($Menu->save()!== false){
@ -119,8 +114,8 @@ class MenuController extends AdminController {
} else {
$info = array();
/* 获取数据 */
$info = M('Menu')->field(true)->find($id);
$menus = M('Menu')->field(true)->select();
$info = SM('Menu')->field(true)->find($id);
$menus = SM('Menu')->field(true)->select();
$menus = D('Common/Tree')->toFormatTree($menus);
$menus = array_merge(array(0=>array('id'=>0,'title_show'=>'顶级菜单')), $menus);
@ -131,11 +126,10 @@ class MenuController extends AdminController {
$this->assign('info', $info);
$this->meta_title = '编辑后台菜单';
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->display();
}
@ -153,7 +147,7 @@ class MenuController extends AdminController {
}
$map = array('id' => array('in', $id) );
if(M('Menu')->where($map)->delete()){
if(SM('Menu')->where($map)->delete()){
session('ADMIN_MENU_LIST',null);
//记录行为
action_log('update_menu', 'Menu', $id, UID);
@ -165,12 +159,12 @@ class MenuController extends AdminController {
public function toogleHide($id,$value = 1){
session('ADMIN_MENU_LIST',null);
$this->editRow('Menu', array('hide'=>$value), array('id'=>$id));
$this->editRow('Menu', array('hide'=>$value), array('id'=>$id),[],true);
}
public function toogleDev($id,$value = 1){
session('ADMIN_MENU_LIST',null);
$this->editRow('Menu', array('is_dev'=>$value), array('id'=>$id));
$this->editRow('Menu', array('is_dev'=>$value), array('id'=>$id),[],true);
}
public function importFile($tree = null, $pid=0){
@ -178,7 +172,7 @@ class MenuController extends AdminController {
$file = APP_PATH."Admin/Conf/Menu.php";
$tree = require_once($file);
}
$menuModel = D('Menu');
$menuModel = SM('Menu');
foreach ($tree as $value) {
$add_pid = $menuModel->add(
array(
@ -200,7 +194,7 @@ class MenuController extends AdminController {
if(IS_POST){
$tree = I('post.tree');
$lists = explode(PHP_EOL, $tree);
$menuModel = M('Menu');
$menuModel = SM('Menu');
if($lists == array()){
$this->error('请按格式填写批量导入的菜单,至少一个菜单');
}else{
@ -227,13 +221,13 @@ class MenuController extends AdminController {
$this->meta_title = '批量导入后台菜单';
$pid = (int)I('get.pid');
$this->assign('pid', $pid);
$data = M('Menu')->where("id={$pid}")->field(true)->find();
$data = SM('Menu')->where("id={$pid}")->field(true)->find();
$this->assign('data', $data);
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->display();
@ -258,24 +252,21 @@ class MenuController extends AdminController {
$map['pid'] = $pid;
}
}
$list = M('Menu')->where($map)->field('id,title')->order('sort asc,id asc')->select();
$list = SM('Menu')->where($map)->field('id,title')->order('sort asc,id asc')->select();
$this->assign('list', $list);
$this->meta_title = '菜单排序';
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->m_title = '菜单管理';
$url = 'Menu/index';
$this->m_url = $url;
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>$url,'status'=>1])->find());
$this->display();
}elseif (IS_POST){
$ids = I('post.ids');
$ids = explode(',', $ids);
foreach ($ids as $key=>$value){
$res = M('Menu')->where(array('id'=>$value))->setField('sort', $key+1);
$res = SM('Menu')->where(array('id'=>$value))->setField('sort', $key+1);
}
if($res !== false){
session('ADMIN_MENU_LIST',null);

@ -24,10 +24,6 @@ class PublicController extends \Think\Controller
if (!check_verify($verify)) {
$this->error('验证码输入错误!');
}
/* 财务账号只能登陆子系统*/
if(!IS_SUBSITE && $username == "cw"){
$this->error('账户或密码错误!');
}
/* 调用UC登录接口登录 */
$User = new UserApi;

@ -42,7 +42,7 @@ class UserController extends AdminController
$map['nickname'] = array('like', '%' . (string)$nickname . '%');
}
$list = $this->lists('Member', $map);
$list = $this->lists('Member', $map,"uid desc",true,true);
int_to_string($list);
$this->checkListOrCountAuthRestMap($map,[]);
@ -148,8 +148,8 @@ class UserController extends AdminController
public function action()
{
//获取列表数据
$Action = M('Action')->where(array('status' => array('gt', -1)));
$list = $this->lists($Action);
$Action = SM('Action')->where(array('status' => array('gt', -1)));
$list = $this->lists($Action,[],'',true,true);
int_to_string($list);
// 记录当前列表页的cookie
Cookie('__forward__', $_SERVER['REQUEST_URI']);
@ -216,10 +216,10 @@ class UserController extends AdminController
$map['uid'] = array('in', $id);
$map1['id'] = array('in', $id);
$status = I('method') == 'forbidUser' ? 0 : 1;
$res = M('UcenterMember')->where($map1)->setField('status', $status);
$res1 = M('Member')->where($map)->setField('status', $status);
$res = SM('UcenterMember')->where($map1)->setField('status', $status);
$res1 = SM('Member')->where($map)->setField('status', $status);
if ($res && $res1) {
$nickname = M('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历
$nickname = SM('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历
addOperationLog(array(
"op_type"=>1,
"key"=> $nickname,
@ -282,16 +282,16 @@ class UserController extends AdminController
if ($password != $repassword) {
$this->error('管理员密码和确认密码不一致!');
}
$usernameUser = M('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find();
$usernameUser = SM('UcenterMember', 'sys_')->field('username')->where(['username' => $username])->find();
if (!empty($usernameUser)) {
$this->error('用户名已存在!');
}
$emailUser = M('UcenterMember', 'sys_')->field('id')->where(['email' => $email])->find();
$emailUser = SM('UcenterMember', 'sys_')->field('id')->where(['email' => $email])->find();
if (!empty($emailUser)) {
$this->error('邮箱已存在!');
}
$moblieUser = M('UcenterMember', 'sys_')->field('id')->where(['mobile' => $_POST['mobile']])->find();
$moblieUser = SM('UcenterMember', 'sys_')->field('id')->where(['mobile' => $_POST['mobile']])->find();
if (!empty($moblieUser)) {
$this->error('手机号码已存在!');
@ -304,8 +304,8 @@ class UserController extends AdminController
$user = array('uid' => $uid,'real_name'=>$real_name, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
$data['uid'] = $uid;
$data['group_id'] = I('auth');
M('auth_group_access')->data($data)->add();
if (!M('Member')->add($user)) {
SM('auth_group_access')->data($data)->add();
if (!SM('Member')->add($user)) {
$this->error('用户添加失败!');
} else {
//操作日志
@ -322,7 +322,7 @@ class UserController extends AdminController
$this->error($this->showRegError($uid));
}
} else {
$list = D('AuthGroup')->where(array('status' => 1))->select();
$list = SM('AuthGroup')->where(array('status' => 1))->select();
$this->assign('lists', $list);
$this->meta_title = '新增管理员';
@ -433,9 +433,9 @@ class UserController extends AdminController
// break;
// }
// }
$Member = D('UcenterMember');
$mem = D('Member');
$au = D('AuthGroupAccess');
$Member = SM('UcenterMember');
$mem = SM('Member');
$au = SM('AuthGroupAccess');
$map['id'] = $id;
$maps['uid'] = $id;
$info['username'] = $_POST['username'];
@ -473,7 +473,9 @@ class UserController extends AdminController
}
if ($smember !== false || $meb || $ag) {
M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password']));
if(!IS_SUBSITE){
M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password']));
}
addOperationLog(array(
"op_type"=>1,
"key"=>$_POST['username'],
@ -493,18 +495,18 @@ class UserController extends AdminController
}
} else {
$map['id'] = $_GET['id'];
$Member = D('UcenterMember')->where($map)->find();
$Member = SM('UcenterMember')->where($map)->find();
$Member['apply_leave_time']?($Member['apply_leave_time'] = date("Y-m-d",$Member['apply_leave_time'])):($Member['apply_leave_time']='');
$Member['leave_time']?($Member['leave_time'] = date("Y-m-d",$Member['leave_time'])):($Member['leave_time']='');
$Member['become_time']?($Member['become_time'] = date("Y-m-d",$Member['become_time'])):($Member['become_time']='');
$data = D('Member')->where(array('uid' => $_GET['id']))->find();
$data = SM('Member')->where(array('uid' => $_GET['id']))->find();
$au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find();
$au = SM('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find();
$this->assign("authid", $au["group_id"]);
$this->assign("houtai", $au["houtai"]);
$list = D('AuthGroup')->where(array('status' => 1))->select();
$list = SM('AuthGroup')->where(array('status' => 1))->select();
$username = $_POST['username'];
$password = $_POST['password'];
$this->assign('lists', $list);
@ -701,13 +703,13 @@ class UserController extends AdminController
public function delete($id)
{
M()->startTrans();
$nickname = M('Member')->where("uid = '{$id}'")->field("nickname")->find()['nickname'];
$res1 = M('member')->delete($id);
$res2 = M('ucenter_member')->delete($id);
$res3 = M('auth_group_access')->where(array('uid' => $id))->delete();
SM()->startTrans();
$nickname = SM('Member')->where("uid = '{$id}'")->field("nickname")->find()['nickname'];
$res1 = SM('member')->delete($id);
$res2 =SM('ucenter_member')->delete($id);
$res3 = SM('auth_group_access')->where(array('uid' => $id))->delete();
if ($res1 && $res2 && $res3) {
M()->commit();
SM()->commit();
addOperationLog(array(
"op_type"=>2,
"key"=> $nickname,
@ -715,7 +717,7 @@ class UserController extends AdminController
));
$this->success('删除成功');
} else {
M()->rollback();
SM()->rollback();
$this->error('删除失败' . M()->getError());
}
}

@ -15,7 +15,7 @@ use Think\Model;
* Class AuthGroupModel
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
class AuthGroupModel extends SubsiteModel {
class AuthGroupModel extends Model {
const TYPE_ADMIN = 1; // 管理员用户组类型标识
const MEMBER = 'member';
const UCENTER_MEMBER = 'ucenter_member';
@ -53,7 +53,7 @@ class AuthGroupModel extends SubsiteModel {
$uid = is_array($uid)?implode(',',$uid):trim($uid,',');
$gid = is_array($gid)?$gid:explode( ',',trim($gid,',') );
$Access = M(self::AUTH_GROUP_ACCESS);
$Access = SM(self::AUTH_GROUP_ACCESS);
if( isset($_REQUEST['batch']) ){
//为单个用户批量添加用户组时,先删除旧数据
$del = $Access->where( array('uid'=>array('in',$uid)) )->delete();
@ -65,7 +65,7 @@ class AuthGroupModel extends SubsiteModel {
if( $del!==false ){
foreach ($uid_arr as $u){
//判断用户id是否合法
if(M('Member')->getFieldByUid($u,'uid') == false){
if(SM('Member')->getFieldByUid($u,'uid') == false){
$this->error = "编号为{$u}的账号不存在!";
return false;
}
@ -246,7 +246,7 @@ class AuthGroupModel extends SubsiteModel {
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
public function removeFromGroup($uid,$gid){
return M(self::AUTH_GROUP_ACCESS)->where( array( 'uid'=>$uid,'group_id'=>$gid) )->delete();
return SM(self::AUTH_GROUP_ACCESS)->where( array( 'uid'=>$uid,'group_id'=>$gid) )->delete();
}
/**

@ -69,10 +69,6 @@ class MemberModel extends Model {
'last_login_time' => NOW_TIME,
'last_login_ip' => get_client_ip(1),
);
if(!IS_SUBSITE){
$this->save($data);
}
$adminData = getAdminData($user['uid']);
$groupId = getGameGroup($user['uid']);

@ -13,9 +13,9 @@
<div class="tab_nav">
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li class="current"><a href="javascript:;">市场专员分成</a></li>
<li class="fr tab_select">
<select name="group">

@ -13,9 +13,9 @@
<div class="tab_nav">
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li class="current"><a href="javascript:;">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<if condition="$_GET['group_id'] eq 11 or $_GET['group_id'] eq 12 or $_GET['group_id'] eq 21">
<li><a href="{:U('AuthManager/AuthMarketMember',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">市场专员分成</a></li>
</if>

@ -13,10 +13,10 @@
<div class="tab_nav">
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<!-- <li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>-->
<li class="current"><a href="javascript:;">数据授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<if condition="$_GET['group_id'] eq 11 or $_GET['group_id'] eq 12 or $_GET['group_id'] eq 21">
<li><a href="{:U('AuthManager/AuthMarketMember',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">市场专员分成</a></li>
</if>

@ -5,16 +5,14 @@
<h3 class="page_title">角色权限</h3>
<p class="description_text">说明:可以设置管理账号的不同操作权限</p>
</div>
<if condition="!IS_SUBSITE">
<div class="cf top_nav_list">
<div class="fl button_list">
<a id="add-group" class="" href="{:U('createGroup')}"><span class="button_icon button_icon1"></span>新增</a>
<a url="{:U('changestatus?method=resumeGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon4"></span>正常</a>
<a url="{:U('changestatus?method=forbidGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon5"></span>禁用</a>
<a url="{:U('changestatus?method=deleteGroup')}" class="ajax-post confirm" target-form="ids" ><span class="button_icon button_icon2"></span>删除</a>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<a id="add-group" class="" href="{:U('createGroup')}"><span class="button_icon button_icon1"></span>新增</a>
<a url="{:U('changestatus?method=resumeGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon4"></span>正常</a>
<a url="{:U('changestatus?method=forbidGroup')}" class="ajax-post" target-form="ids" ><span class="button_icon button_icon5"></span>禁用</a>
<a url="{:U('changestatus?method=deleteGroup')}" class="ajax-post confirm" target-form="ids" ><span class="button_icon button_icon2"></span>删除</a>
</div>
</if>
</div>
<!-- 数据列表 -->
<div class="data_list">
<table class="">
@ -52,9 +50,9 @@
</td>
<td>
<a href="{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >访问授权</a>
<a href="{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
<if condition="!IS_SUBSITE">
<a href="{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >分类授权</a>
<a href="{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
<a href="{:U('AuthManager/dataempower?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >数据授权</a>
<if condition="$vo['id'] eq 11 or $vo['id'] eq 12 or $vo['id'] eq 21">
<a href="{:U('AuthManager/AuthMarketMember?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >市场专员分成</a>
@ -66,14 +64,12 @@
<else /><span class="disabled_status">{:get_status_title($vo['status'])}</span></eq>
</td>
<td>
<if condition="!IS_SUBSITE">
<eq name="vo.status" value="1">
<a href="{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}" class="ajax-get">禁用</a>
<else/>
<a href="{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}" class="ajax-get">正常</a>
</eq>
<a href="{:U('AuthManager/changeStatus?method=deleteGroup&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
</if>
<eq name="vo.status" value="1">
<a href="{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}" class="ajax-get">禁用</a>
<else/>
<a href="{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}" class="ajax-get">正常</a>
</eq>
<a href="{:U('AuthManager/changeStatus?method=deleteGroup&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
</td>
</tr>
</volist>

@ -13,12 +13,14 @@
<div class="tab_nav">
<ul>
<li class="current"><a href="javascript:;">访问授权</a></li>
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<if condition="$_GET['group_id'] eq 11 or $_GET['group_id'] eq 12 or $_GET['group_id'] eq 21">
<li><a href="{:U('AuthManager/AuthMarketMember',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">市场专员分成</a></li>
</if>
<if condition="!IS_SUBSITE">
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<if condition="$_GET['group_id'] eq 11 or $_GET['group_id'] eq 12 or $_GET['group_id'] eq 21">
<li><a href="{:U('AuthManager/AuthMarketMember',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">市场专员分成</a></li>
</if>
</if>
<li class="fr tab_select">
<select name="group">
<volist name="auth_group" id="vo">

@ -13,12 +13,14 @@
<div class="tab_nav">
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<li class="current"><a href="javascript:;">成员授权</a></li>
<if condition="$_GET['group_id'] eq 11 or $_GET['group_id'] eq 12 or $_GET['group_id'] eq 21">
<li><a href="{:U('AuthManager/AuthMarketMember',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">市场专员分成</a></li>
</if>
<li class="current"><a href="javascript:;">成员授权</a></li>
<if condition="!IS_SUBSITE">
<li><a href="{:U('AuthManager/category',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
<if condition="$_GET['group_id'] eq 11 or $_GET['group_id'] eq 12 or $_GET['group_id'] eq 21">
<li><a href="{:U('AuthManager/AuthMarketMember',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">市场专员分成</a></li>
</if>
</if>
<li class="fr tab_select">
<select name="group">
<volist name="auth_group" id="vo">

@ -508,7 +508,7 @@ function get_nickname($uid = 0)
if (isset($list[$key])) { //已缓存,直接使用
$name = $list[$key];
} else { //调用接口获取用户信息
$info = M('Member')->field('nickname')->find($uid);
$info = SM('Member')->field('nickname')->find($uid);
if ($info !== false && $info['nickname']) {
$nickname = $info['nickname'];
$name = $list[$key] = $nickname;
@ -659,7 +659,7 @@ function action_log($action = null, $model = null, $record_id = null, $user_id =
}
//查询行为,判断是否执行
$action_info = M('Action')->getByName($action);
$action_info = SM('Action','sys_')->getByName($action);
if ($action_info['status'] != 1) {
return '该行为被禁用或删除';
}
@ -1445,7 +1445,7 @@ function getAdminNickname($adminId)
{
$adminId = intval($adminId);
if ($adminId) {
return M('member')->where(array('id' => $adminId))->getField('nickname');
return SM('member',"sys_")->where(array('id' => $adminId))->getField('nickname');
}
return '未知';
}
@ -1480,7 +1480,7 @@ function getGameTypes()
function getGameGroup($uid) {
$groupId = M('auth_group_access')->field('group_id')->where(['uid'=>$uid])->find();
$groupId = SM('auth_group_access',"sys_")->field('group_id')->where(['uid'=>$uid])->find();
return $groupId['group_id']?$groupId['group_id']:0;

@ -24,6 +24,14 @@ class UcenterMemberModel extends Model{
*/
protected $connection = UC_DB_DSN;
public function __construct()
{
if(IS_SUBSITE){
parent::__construct("UcenterMember", $this->tablePrefix, SUBSITE_DB);
}else{
parent::__construct("UcenterMember", $this->tablePrefix);
}
}
/* 用户模型自动验证 */
protected $_validate = array(
/* 验证用户名 */
@ -123,14 +131,14 @@ class UcenterMemberModel extends Model{
$data['mobile'] = $mobile;
// dump($data);die();
try {
$status = M('UcenterMember', 'sys_')->add($data);
$status = SM('UcenterMember', 'sys_')->add($data);
} catch (\Throwable $th) {
$status = false;
dump($th);
}
$uid = 0;
if ($status) {
$uid = M()->getLastInsID();
$uid = SM()->getLastInsID();
}
return $uid; //0-未知错误大于0-注册成功
} else {
@ -168,7 +176,7 @@ class UcenterMemberModel extends Model{
}
/* 获取用户数据 */
$user = M('UcenterMember','sys_')->where($map)->find();
$user = SM('UcenterMember','sys_')->where($map)->find();
if(is_array($user) && $user['status']){
/* 验证用户密码 */
if(think_ucenter_md5($password, UC_AUTH_KEY) === $user['password']||$type==5){

@ -626,6 +626,29 @@ function M($name='', $tablePrefix='',$connection='') {
return $_model[$guid];
}
/**
* 实例化模型,判断是否是子站,如果是,自动接入子站
*
* @param string $name Model名称 支持指定基础模型 例如 MongoModel:User
* @param string $tablePrefix 表前缀
* @param boolean $is_subsiteTable 是否强制使用子站
* @return Think\Model
*/
function SM($name='', $tablePrefix='sys_',$is_subsiteTable=false)
{
if(empty($name)){
if(IS_SUBSITE){
return M($name, $tablePrefix,SUBSITE_DB);
}
}else{
$tableName = strtolower($tablePrefix.unCamelize($name));
if(is_subsiteTable($tableName) || $is_subsiteTable){
return M($name, $tablePrefix,SUBSITE_DB);
}
}
return M($name, $tablePrefix);
}
/**
* 解析资源地址并导入类库文件

@ -148,7 +148,7 @@ class Auth{
static $groups = array();
if (isset($groups[$uid]))
return $groups[$uid];
$user_base = M()->table($this->_config['AUTH_GROUP_ACCESS'])->where("uid = {$uid}")->field('uid,group_id')->find();
$user_base = SM()->table($this->_config['AUTH_GROUP_ACCESS'])->where("uid = {$uid}")->field('uid,group_id')->find();
$user_rule= SM("auth_group","sys_")->where("id = {$user_base['group_id']} and status = 1")->field('title,rules')->find();
if(empty($user_base) || empty($user_rule)){
return [];
@ -164,6 +164,7 @@ class Auth{
* @param integer $type
*/
protected function getAuthList($uid,$type) {
static $_authList = array(); //保存用户验证通过的权限列表
$t = implode(',',(array)$type);
if (isset($_authList[$uid.$t])) {
@ -175,6 +176,7 @@ class Auth{
//读取用户所属用户组
$groups = $this->getGroups($uid);
$ids = array();//保存用户所属用户组设置的所有权限规则id
foreach ($groups as $g) {
$ids = array_merge($ids, explode(',', trim($g['rules'], ',')));
@ -191,7 +193,7 @@ class Auth{
'status'=>1,
);
//读取用户组所有权限规则
$rules = M()->table($this->_config['AUTH_RULE'])->where($map)->field('condition,name')->select();
$rules = SM()->table($this->_config['AUTH_RULE'])->where($map)->field('condition,name')->select();
//循环规则,判断结果。
$authList = array(); //
@ -224,7 +226,7 @@ class Auth{
protected function getUserInfo($uid) {
static $userinfo=array();
if(!isset($userinfo[$uid])){
$userinfo[$uid]=M()->where(array('uid'=>$uid))->table($this->_config['AUTH_USER'])->find();
$userinfo[$uid]=SM()->where(array('uid'=>$uid))->table($this->_config['AUTH_USER'])->find();
}
return $userinfo[$uid];
}

@ -114,7 +114,7 @@ class Log {
$user_id = is_login();
//查询行为,判断是否执行
$action_info = M('Action')->getByName($action);
$action_info = SM('Action')->getByName($action);
if($action_info['status'] != 1){
return '该行为被禁用或删除';
}
@ -166,6 +166,6 @@ class Log {
$data['remark'] = '操作url'.$_SERVER['REQUEST_URI'];
}
M('ActionLog')->add($data);
SM('ActionLog')->add($data);
}
}
Loading…
Cancel
Save