|
|
@ -567,71 +567,100 @@ class AdminController extends Controller {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function addShortcutIcon() {
|
|
|
|
public function addShortcutIcon() {
|
|
|
|
|
|
|
|
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
|
|
|
|
|
|
|
|
$result = $Kuaijieicon->where(['url'=>$_REQUEST['url']])->find();
|
|
|
|
$result = $Kuaijieicon->where(['url'=>$_REQUEST['url']])->find();
|
|
|
|
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
if ($result) {
|
|
|
|
|
|
|
|
|
|
|
|
if ($result['status'] == 0) {
|
|
|
|
if ($result['status'] == 0) {
|
|
|
|
|
|
|
|
|
|
|
|
$data = array('status'=>1,'id'=>$result['id']);
|
|
|
|
$data = array('status'=>1,'id'=>$result['id']);
|
|
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->save($data);
|
|
|
|
$id = $Kuaijieicon->save($data);
|
|
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
if($id){
|
|
|
|
//记录行为
|
|
|
|
//记录行为
|
|
|
|
action_log('Kuaijie/edit', 'Kuaijieicon', $result['id'], UID);
|
|
|
|
action_log('Kuaijie/edit', 'Kuaijieicon', $result['id'], UID);
|
|
|
|
$this->success('添加成功');
|
|
|
|
$this->success('添加成功');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->error('添加失败');
|
|
|
|
$this->error('添加失败');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
$this->error('已添加过常用设置');
|
|
|
|
$this->error('已添加过常用设置');
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = array('title'=>$_REQUEST['title'],'status'=>1,'url'=>$_REQUEST['url'],'value'=>0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->add($data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
|
|
|
|
//记录行为
|
|
|
|
|
|
|
|
action_log('Kuaijie/add', 'Kuaijieicon', $id, UID);
|
|
|
|
|
|
|
|
$this->success('添加成功');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$this->error('添加失败');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function delShortcutIcon($id=0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($id) || $id<1) {$this->error('参数错误');}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
|
|
|
|
|
|
|
|
$data = array('title'=>$_REQUEST['title'],'status'=>1,'url'=>$_REQUEST['url'],'value'=>0);
|
|
|
|
$data = array('status'=>0,'id'=>$id);
|
|
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->add($data);
|
|
|
|
$res = $Kuaijieicon->save($data);
|
|
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
if($res){
|
|
|
|
//记录行为
|
|
|
|
//记录行为
|
|
|
|
action_log('Kuaijie/add', 'Kuaijieicon', $id, UID);
|
|
|
|
action_log('Kuaijie/del', 'Kuaijieicon', $id, UID);
|
|
|
|
$this->success('添加成功');
|
|
|
|
$this->success('删除成功');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->error('添加失败');
|
|
|
|
$this->error('删除失败');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 验证列表的展示或者统计权限
|
|
|
|
public function delShortcutIcon($id=0) {
|
|
|
|
* @param [type] $type 0:"_list_check",1:"_count_check"
|
|
|
|
|
|
|
|
* @return void
|
|
|
|
if (!is_numeric($id) || $id<1) {$this->error('参数错误');}
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function checkListOrCountAuthRestMap(&$map,$checkarr = false,$countfield = "rule_count_check"){
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
//验证count
|
|
|
|
|
|
|
|
if(IS_ROOT){
|
|
|
|
$data = array('status'=>0,'id'=>$id);
|
|
|
|
$this->assign($countfield,true);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
$res = $Kuaijieicon->save($data);
|
|
|
|
$countRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_count_check");
|
|
|
|
|
|
|
|
$this->assign($countfield,$this->checkRule($countRule,array('in','1,2')));
|
|
|
|
if($res){
|
|
|
|
//验证list
|
|
|
|
//记录行为
|
|
|
|
$listrule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_list_check");
|
|
|
|
action_log('Kuaijie/del', 'Kuaijieicon', $id, UID);
|
|
|
|
$listflag = $this->checkRule($listrule,array('in','1,2'));
|
|
|
|
$this->success('删除成功');
|
|
|
|
if(!$listflag && $checkarr){
|
|
|
|
} else {
|
|
|
|
foreach ($checkarr as $v) {
|
|
|
|
$this->error('删除失败');
|
|
|
|
if(isset($map[$v])){
|
|
|
|
}
|
|
|
|
//如果有模糊查询改精准查询
|
|
|
|
|
|
|
|
if($map[$v][0] == "like"){
|
|
|
|
|
|
|
|
$map[$v] = trim($map[$v][1],"%");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$listflag = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!$listflag){
|
|
|
|
|
|
|
|
$map["_string"] = "1=0";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|