12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\App;
- use think\Db;
- class Supervise extends Base
- {
- public function list(){
- $page = input('page',1);
- $size= input('size',20);
- $list = Db::name('supervise')
- ->field('id,title,create_time,content,remark')
- ->where('del',0)
- ->where('enable',1)
- ->page($page,$size)
- ->order('id desc')
- ->select();
- foreach ($list as $k=>$v){
- $list[$k]['content'] = json_decode($v['content'],true);
- }
- HelpHander::success($list);
- }
- public function detail(){
- $id = input('id',0);
- $info = Db::name('supervise')->where('id',$id)->find();
- if(!$info){
- HelpHander::success('参数错误');
- }
- $info['content'] = json_decode($info['content'],true);
- HelpHander::success($info);
- }
- }
|