1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\Db;
- class Document extends Base
- {
- // 新增
- public function save(){
- model('Document')->add();
- HelpHander::success([],'操作成功');
- }
- // 编辑
- public function update(){
- model('Document')->add();
- HelpHander::success([],'操作成功');
- }
- // 详情
- public function detail(){
- $id = input('id/d',0);
- $ret = model('Document')->info($id);
- HelpHander::success($ret);
- }
- // 列表
- public function queryDocumentList(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $cateId = input('cateId/d',0);
- $title = input('title','','trim');
- $name = input('name','','trim');
- $startTime = input('startTime','','trim');
- $endTime = input('endTime','','trim');
- $ret = model('Document')->lists($page,$size,$cateId,$title,$name,$startTime,$endTime,$this->userId,$this->orgId);
- HelpHander::success($ret);
- }
- // 删除
- public function del(){
- $id = input('id/d',0);
- model('Document')->del($id,$this->userId);
- HelpHander::success([],'操作成功');
- }
- public function updateViews(){
- $id = input('id/d',0);
- model('Document')->updateViews($id);
- HelpHander::success([],'操作成功');
- }
- public function queryDocumentByCate(){
- $cateId = input('cateId/d',0);
- $title = input('title','','trim');
- $ret = model('Document')->queryDocumentByCate($cateId,$title,$this->userId,$this->orgId);
- HelpHander::success($ret);
- }
- }
|