NewsPageController.php 733 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\admin\controller\content;
  3. use app\controller\Curd;
  4. use app\model\Content;
  5. use app\model\SysCategory;
  6. use support\Request;
  7. use support\Response;
  8. class NewsPageController extends Curd{
  9. public function __construct()
  10. {
  11. $this->model = new Content();
  12. }
  13. public function select(Request $request) : Response
  14. {
  15. $categoryIds = SysCategory::where('category_super_id',61)->select('category_id')->get()->toArray();
  16. $where['join_content_category_id'] = ['in',$categoryIds];
  17. [$where, $format, $limit, $field, $order] = $this->selectInput($request);
  18. $query = $this->doSelect($where, $field, $order);
  19. return $this->doFormat($query, $format, $limit);
  20. }
  21. }