12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- /**
- * 话题中心
- */
- class Topichub extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- //全部话题
- public function lists(){
- $list = Db::name('topic_hub')->where('status',1)->order('weight desc,id desc')->autopage()->select();
- $list = list_domain_image($list,['image']);
- $this->success('success',$list);
- }
- //某个话题详情
- public function info(){
- $id = input('id',0);
- $info = Db::name('topic_hub')->where(['status'=>1,'id'=>$id])->find();
- $info = info_domain_image($info,['image']);
- $this->success('success',$info);
- }
- //轮播图
- public function banner(){
- $list = Db::name('topic_banner')->where('status',1)->order('weight desc')->select();
- $list = list_domain_image($list,['image']);
- $this->success(1,$list);
- }
- }
|