UtilController.php 581 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace frontend\modules\api\controllers;
  3. use common\util\Holiday;
  4. use frontend\modules\api\components\BaseAdminController;
  5. use yii\web\Response;
  6. class UtilController extends BaseAdminController
  7. {
  8. /**
  9. * 时间特征查询
  10. * @param $time
  11. * @return Response
  12. */
  13. public function actionTimeFeature($time)
  14. {
  15. list($day_type, $time_type) = Holiday::getDayTypeAndTimeType($time);
  16. $data["data"] = [
  17. "day_type" => $day_type,
  18. "time_type" => $time_type,
  19. ];
  20. return $this->asJson($data);
  21. }
  22. }