1、后台的一些bug修复

2、内核更新
3、后台的扩展模型做了一点更新一点,还不够完善
This commit is contained in:
2016-07-19 14:08:00 +08:00
parent 124745c341
commit 783369c9e4
26 changed files with 492 additions and 238 deletions

View File

@@ -42,8 +42,8 @@ class Action extends Admin {
$model = model('Action');
if(IS_POST){
$data = input('post.');
$result = $model->save();
if ($result) {
$result = $model->save($data);
if (false != $result) {
action_log('add_action', 'Action', $result, session('user_auth.uid'));
return $this->success('添加成功!',url('index'));
}else{

View File

@@ -43,8 +43,7 @@ class Ad extends Admin {
public function add(){
$place = model('AdPlace');
if (IS_POST) {
$data = input('post.');
$result = $place->save($data);
$result = $place->change();
if (false !== false) {
return $this->success("添加成功!");
}else{
@@ -63,14 +62,9 @@ class Ad extends Admin {
public function edit($id = null){
$place = model('AdPlace');
if (IS_POST) {
$data = $this->request->post();
if ($data) {
$result = $place->save($data,array('id'=>$data['id']));
if ($result) {
return $this->success("修改成功!", url('admin/ad/index'));
}else{
return $this->error($this->adplace->getError());
}
$result = $place->change();
if ($result) {
return $this->success("修改成功!", url('admin/ad/index'));
}else{
return $this->error($this->adplace->getError());
}
@@ -122,14 +116,9 @@ class Ad extends Admin {
public function addad($id){
$ad = model('ad');
if (IS_POST) {
$data = $this->request->post();
if ($data) {
$result = $ad->save($data);
if ($result) {
return $this->success("添加成功!", url('admin/ad/lists',array('id'=>$data['place_id'])));
}else{
return $this->error($ad->getError());
}
$result = $ad->change();
if ($result) {
return $this->success("添加成功!", url('admin/ad/lists',array('id'=>$data['place_id'])));
}else{
return $this->error($ad->getError());
}
@@ -148,14 +137,9 @@ class Ad extends Admin {
public function editad($id = null){
$ad = model('ad');
if (IS_POST) {
$data = $this->request->post();
if ($data) {
$result = $ad->save($data,array('id'=>$data['id']));
if ($result) {
return $this->success("修改成功!", url('admin/ad/lists',array('id'=>$data['place_id'])));
}else{
return $this->error($ad->getError());
}
$result = $ad->change();
if ($result) {
return $this->success("修改成功!", url('admin/ad/lists',array('id'=>$data['place_id'])));
}else{
return $this->error($ad->getError());
}

View File

@@ -24,28 +24,17 @@ class Addons extends Admin {
/**
* 插件列表
*/
public function index(){
$row = $this->addons->getList();
foreach($row as $key => $value){
$value['status_text'] = '';
if($value['uninstall'] == 1){
$value['uninstall_text'] = '未安装';
}else{
$value['uninstall_text'] = '已安装';
if($value['status'] == 0){
$value['status_text'] = '禁用';
}else{
$value['status_text'] = '启用';
}
}
$list[] = $value;
public function index($refresh = 0){
if ($refresh) {
$this->addons->refresh();
}
$list = $this->addons->order('id desc')->paginate(25);
// 记录当前列表页的cookie
Cookie('__forward__',$_SERVER['REQUEST_URI']);
$data = array(
'list' => $list,
//'page' => $page->show()
'page' => $list->render()
);
$this->setMeta("插件管理");
$this->assign($data);

View File

@@ -75,7 +75,7 @@ class Attribute extends Admin {
if ($result) {
return $this->success("创建成功!",url('Attribute/index',array('model_id'=>$model_id)));
}else{
return $this->error($this->model->getError(),'');
return $this->error($this->model->getError());
}
}else{
if (!$model_id) {

View File

@@ -82,9 +82,9 @@ class Content extends Admin{
if (IS_POST) {
$result = $this->model->change();
if ($result) {
return $this->success("添加成功!",url('admin/content/index',array('model_id'=>$this->modelInfo['id'])));
return $this->success("添加成功!", url('admin/content/index',array('model_id'=>$this->modelInfo['id'])));
}else{
return $this->error($this->model->getError(),'');
return $this->error($this->model->getError(), url('admin/content/add',array('model_id'=>$this->modelInfo['id'])));
}
}else{
$info = array(
@@ -109,16 +109,15 @@ class Content extends Admin{
* 内容修改
* @author molong <ycgpp@126.com>
*/
public function edit(){
public function edit($id){
if (IS_POST) {
$result = $this->model->change();
if ($result !== false) {
return $this->success("更新成功!",url('admin/content/index',array('model_id'=>$this->modelInfo['id'])));
}else{
return $this->error($this->model->getError(),'');
return $this->error($this->model->getError(), url('admin/content/edit',array('model_id'=>$this->modelInfo['id'],'id'=>$id)));
}
}else{
$id = input('id','','trim,intval');
if (!$id) {
return $this->error("非法操作!");
}

View File

@@ -57,6 +57,7 @@
{/volist}
</tbody>
</table>
{$page}
</div>
</div>
</div>