Previous.php 728 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\home\controller;
  3. use app\common\model\PreviousModel;
  4. use app\common\model\ReservedModel;
  5. use app\home\HomeBaseController;
  6. class Previous extends HomeBaseController
  7. {
  8. public function index()
  9. {
  10. $same_month = date('n');
  11. $month = input('month/d', $same_month);
  12. $previous = PreviousModel::where('status', ReservedModel::STATUS_SHOW)
  13. ->where('month', $month)
  14. ->order(['priority' => 'desc', 'id' => 'desc'])
  15. ->select();
  16. $previous = array_split($previous,3);
  17. return view('', [
  18. 'previous' => $previous,
  19. 'month_list' => PreviousModel::MONTH,
  20. 'month_index' => $month,
  21. ]);
  22. }
  23. }