链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
624 B

  1. <?php
  2. namespace App\Admin\Common;
  3. use Dcat\Admin\Controllers\AdminController;
  4. class Common extends AdminController
  5. {
  6. /**
  7. * 获取一个时间段内的日期
  8. */
  9. public static function periodDateArr($start_time,$end_time){
  10. $start_time = strtotime($start_time);
  11. $end_time = strtotime($end_time);
  12. $i=0;
  13. $arr = [];
  14. while ($start_time<=$end_time){
  15. $arr[date('Y-m-d',$start_time)]=date('Y年m月d日',$start_time);
  16. $start_time = strtotime('+1 day',$start_time);
  17. $i++;
  18. }
  19. return array_reverse($arr);
  20. }
  21. }