|
|
@ -457,7 +457,19 @@ class ThinkController extends AdminController {
|
|
|
|
|
|
|
|
|
|
|
|
$Model = D(get_table_name($model['id']));
|
|
|
|
$Model = D(get_table_name($model['id']));
|
|
|
|
$map = array('id' => array('in', $ids) );
|
|
|
|
$map = array('id' => array('in', $ids) );
|
|
|
|
|
|
|
|
if(CONTROLLER_NAME == "GameType"){
|
|
|
|
|
|
|
|
$yres = $Model->where($map)->select();
|
|
|
|
|
|
|
|
}
|
|
|
|
if($Model->where($map)->delete()){
|
|
|
|
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);
|
|
|
|
$this->success('删除成功',$url);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->error('删除失败!');
|
|
|
|
$this->error('删除失败!');
|
|
|
@ -483,6 +495,13 @@ class ThinkController extends AdminController {
|
|
|
|
$Model = $this->checkAttr($Model,$model['id']);
|
|
|
|
$Model = $this->checkAttr($Model,$model['id']);
|
|
|
|
if($Model->create() && $Model->save() !== false){
|
|
|
|
if($Model->create() && $Model->save() !== false){
|
|
|
|
\Think\Log::actionLog(CONTROLLER_NAME.'/edit',$model,1);
|
|
|
|
\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);
|
|
|
|
$this->success('保存'.$model['title'].'成功!',empty($url)? U('lists?model='.$model['name']):$url);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->error($Model->getError());//,empty($url)? U('lists?model='.$model['name']):$url
|
|
|
|
$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()){//
|
|
|
|
if($Model->create() && $Model->add()){//
|
|
|
|
\Think\Log::actionLog(CONTROLLER_NAME.'/add',$model,1);
|
|
|
|
\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);
|
|
|
|
$this->success('添加'.$model['title'].'成功!', empty($url)? U('lists?model='.$model['name']):$url);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->error($Model->getError());
|
|
|
|
$this->error($Model->getError());
|
|
|
|