Dongtai.php 817 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 最新动态
  7. */
  8. class Dongtai extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. public function dongtai()
  13. {
  14. $zgs_id = 1;
  15. $list = Db::name('dongtai')->field('content',true)
  16. ->where('company_id','IN',[$this->auth->company_id,$zgs_id])
  17. ->order('id' , 'desc')
  18. ->autopage()
  19. ->select();
  20. $list = list_domain_image($list, ['image']);
  21. $this->success(1, $list);
  22. }
  23. public function info(){
  24. $id = input('id',0);
  25. $list = Db::name('dongtai')
  26. ->where('id',$id)
  27. ->find();
  28. $list = info_domain_image($list, ['image']);
  29. $this->success(1, $list);
  30. }
  31. }