PremisesController.php 769 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\admin\controller\marketing;
  3. use app\admin\validate\marketing\PremisesValidate;
  4. use app\controller\Curd;
  5. use app\model\Premises;
  6. use support\Request;
  7. use support\Response;
  8. class PremisesController extends Curd
  9. {
  10. public function __construct()
  11. {
  12. $this->model = new Premises();
  13. $this->validate = true;
  14. $this->validateClass = new PremisesValidate();
  15. }
  16. public function select(Request $request): Response
  17. {
  18. [$where, $format, $limit, $field, $order] = $this->selectInput($request);
  19. $order = $request->get('order', 'desc');
  20. $field = $field ?? 'premises_addtimes';
  21. $query = $this->doSelect($where, $field, $order);
  22. return $this->doFormat($query, $format, $limit);
  23. }
  24. }