Topic.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace addon\topic\api\controller;
  11. use app\api\controller\BaseApi;
  12. use addon\topic\model\Topic as TopicModel;
  13. /**
  14. * 专题活动
  15. */
  16. class Topic extends BaseApi
  17. {
  18. /**
  19. * 列表信息
  20. */
  21. public function page()
  22. {
  23. $page = isset($this->params[ 'page' ]) ? $this->params[ 'page' ] : 1;
  24. $page_size = isset($this->params[ 'page_size' ]) ? $this->params[ 'page_size' ] : PAGE_LIST_ROWS;
  25. $condition = [
  26. [ 'status', '=', 2 ],
  27. [ 'site_id', '=', $this->site_id ]
  28. ];
  29. $order = 'create_time desc';
  30. $field = 'topic_id,topic_name,topic_adv,status,remark,start_time,end_time';
  31. $topic_model = new TopicModel();
  32. $list = $topic_model->getTopicPageList($condition, $page, $page_size, $order, $field);
  33. return $this->response($list);
  34. }
  35. }