更新接口文件
This commit is contained in:
36
app/controller/api/Attach.php
Normal file
36
app/controller/api/Attach.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\api;
|
||||
|
||||
use app\model\Attach as AttachModel;
|
||||
|
||||
/**
|
||||
* @title 附件管理
|
||||
*/
|
||||
class Attach extends Base {
|
||||
|
||||
/**
|
||||
* @title 附件列表
|
||||
*/
|
||||
public function index(){
|
||||
$param = $this->request->param();
|
||||
$map = [];
|
||||
$order = "id desc";
|
||||
|
||||
if(isset($param['type']) && $param['type']){
|
||||
$map[] = ['type', '=', $param['type']];
|
||||
}
|
||||
|
||||
$list = AttachModel::where($map)->order($order)->paginate($this->request->pageConfig);
|
||||
|
||||
$this->data['data'] = $list;
|
||||
$this->data['code'] = 1;
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,10 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\api;
|
||||
|
||||
use think\facade\Db;
|
||||
use app\model\Category;
|
||||
use app\model\Model;
|
||||
use app\model\Attribute;
|
||||
|
||||
/**
|
||||
* @title 内容管理
|
||||
@@ -40,7 +43,7 @@ class Content extends Base {
|
||||
}
|
||||
|
||||
$list = $this->model->where($map)->order($order)->paginate($this->request->pageConfig);
|
||||
|
||||
$this->data['code'] = 1;
|
||||
$this->data['data'] = $list;
|
||||
return $this->data;
|
||||
}
|
||||
@@ -56,7 +59,7 @@ class Content extends Base {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
$info = $this->model->find($id);
|
||||
|
||||
$this->data['code'] = 1;
|
||||
$this->data['data'] = $info;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
33
app/controller/api/Message.php
Normal file
33
app/controller/api/Message.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\api;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* @title 消息管理
|
||||
*/
|
||||
class Message extends Base {
|
||||
|
||||
/**
|
||||
* @title 消息列表
|
||||
*/
|
||||
public function index(){
|
||||
$this->data['code'] = 1;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 通知列表
|
||||
*/
|
||||
public function notice(){
|
||||
$this->data['code'] = 1;
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user