This commit is contained in:
devil_gong
2018-12-18 11:10:53 +08:00
parent 9e44b316b7
commit baf80871ab
147 changed files with 1236 additions and 1538 deletions

View File

@ -204,7 +204,7 @@ class AppSlide extends Common
// 是否ajax请求
if(!IS_AJAX)
{
$this->error(lang('common_unauthorized_access'));
$this->error('非法访问');
}
// 图片
@ -249,9 +249,9 @@ class AppSlide extends Common
// 数据添加
if($m->add())
{
$this->ajaxReturn(lang('common_operation_add_success'));
$this->ajaxReturn('新增成功');
} else {
$this->ajaxReturn(lang('common_operation_add_error'), -100);
$this->ajaxReturn('新增失败', -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
@ -286,9 +286,9 @@ class AppSlide extends Common
// 更新数据库
if($m->where(array('id'=>I('id')))->save())
{
$this->ajaxReturn(lang('common_operation_edit_success'));
$this->ajaxReturn('编辑成功');
} else {
$this->ajaxReturn(lang('common_operation_edit_error'), -100);
$this->ajaxReturn('编辑失败或数据未改变', -100);
}
} else {
$this->ajaxReturn($m->getError(), -1);
@ -307,7 +307,7 @@ class AppSlide extends Common
// 是否ajax请求
if(!IS_AJAX)
{
$this->error(lang('common_unauthorized_access'));
$this->error('非法访问');
}
// 参数处理
@ -323,7 +323,7 @@ class AppSlide extends Common
$data = $m->find($id);
if(empty($data))
{
$this->ajaxReturn(lang('common_data_no_exist_error'), -2);
$this->ajaxReturn('资源不存在或已被删除', -2);
}
if($data['is_enable'] == 1)
{
@ -333,12 +333,12 @@ class AppSlide extends Common
// 删除
if($m->where(array('id'=>$id))->delete() !== false)
{
$this->ajaxReturn(lang('common_operation_delete_success'));
$this->ajaxReturn('删除成功');
} else {
$this->ajaxReturn(lang('common_operation_delete_error'), -100);
$this->ajaxReturn('删除失败或资源不存在', -100);
}
} else {
$this->ajaxReturn(lang('common_param_error'), -1);
$this->ajaxReturn('参数错误', -1);
}
}
@ -354,15 +354,15 @@ class AppSlide extends Common
// 参数
if(empty($_POST['id']) || !isset($_POST['state']))
{
$this->ajaxReturn(lang('common_param_error'), -1);
$this->ajaxReturn('参数错误', -1);
}
// 数据更新
if(db('AppSlide')->where(array('id'=>I('id')))->save(array('is_enable'=>I('state'))))
{
$this->ajaxReturn(lang('common_operation_edit_success'));
$this->ajaxReturn('编辑成功');
} else {
$this->ajaxReturn(lang('common_operation_edit_error'), -100);
$this->ajaxReturn('编辑失败或数据未改变', -100);
}
}
}