|
|
|
@ -457,7 +457,19 @@ class ThinkController extends AdminController {
|
|
|
|
|
|
|
|
|
|
$Model = D(get_table_name($model['id']));
|
|
|
|
|
$map = array('id' => array('in', $ids) );
|
|
|
|
|
if(CONTROLLER_NAME == "GameType"){
|
|
|
|
|
$yres = $Model->where($map)->select();
|
|
|
|
|
}
|
|
|
|
|
if($Model->where($map)->delete()){
|
|
|
|
|
if(CONTROLLER_NAME == "GameType"){
|
|
|
|
|
foreach ($yres as $k => $v) {
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>2,
|
|
|
|
|
"key"=>$v['type_name'],
|
|
|
|
|
"url"=>U("GameType/lists")
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$this->success('删除成功',$url);
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('删除失败!');
|
|
|
|
@ -483,6 +495,13 @@ class ThinkController extends AdminController {
|
|
|
|
|
$Model = $this->checkAttr($Model,$model['id']);
|
|
|
|
|
if($Model->create() && $Model->save() !== false){
|
|
|
|
|
\Think\Log::actionLog(CONTROLLER_NAME.'/edit',$model,1);
|
|
|
|
|
if(CONTROLLER_NAME == "GameType"){
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>1,
|
|
|
|
|
"key"=>$_POST['type_name'],
|
|
|
|
|
"url"=>U("GameType/lists")
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
$this->success('保存'.$model['title'].'成功!',empty($url)? U('lists?model='.$model['name']):$url);
|
|
|
|
|
} else {
|
|
|
|
|
$this->error($Model->getError());//,empty($url)? U('lists?model='.$model['name']):$url
|
|
|
|
@ -514,6 +533,14 @@ class ThinkController extends AdminController {
|
|
|
|
|
|
|
|
|
|
if($Model->create() && $Model->add()){//
|
|
|
|
|
\Think\Log::actionLog(CONTROLLER_NAME.'/add',$model,1);
|
|
|
|
|
//操作日志
|
|
|
|
|
if(CONTROLLER_NAME == "GameType"){
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>0,
|
|
|
|
|
"key"=>$_POST['type_name'],
|
|
|
|
|
"url"=>U("GameType/lists")
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
$this->success('添加'.$model['title'].'成功!', empty($url)? U('lists?model='.$model['name']):$url);
|
|
|
|
|
} else {
|
|
|
|
|
$this->error($Model->getError());
|
|
|
|
|