12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\api\controller\zzz;
- use app\common\controller\Api;
- use think\Db;
- /**
- *
- */
- class News extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- //分类
- public function typelist()
- {
- $list = Db::name('zzz_newstype')->field('id, name')->select();
- $this->success(1, $list);
- }
- public function newslist(){
- $type_id = input('type_id',0);
- $list = Db::name('zzz_news')->field('content',true)->where('type_id',$type_id)->autopage()->select();
- $list = list_domain_image($list,['image']);
- $this->success(1, $list);
- }
- public function newsinfo(){
- $id = input('id',0);
- $info = Db::name('zzz_news')->where('id',$id)->find();
- $info = info_domain_image($info,['image']);
- $this->success(1, $info);
- }
- }
|