diff --git a/Application/Admin/Controller/ToolController.class.php b/Application/Admin/Controller/ToolController.class.php index e09f0ac5c..61660dd06 100644 --- a/Application/Admin/Controller/ToolController.class.php +++ b/Application/Admin/Controller/ToolController.class.php @@ -1048,7 +1048,7 @@ class ToolController extends ThinkController { $paramsName = $status.'_start'; for ($i = 1; $i < 13; $i++) { $name = $paramsName.$i; - if (empty($_REQUEST[$name])) { + if ($_REQUEST[$name] == '') { return $this->error('时间选择不能为空'); }else { if ($i < 7) { @@ -1057,10 +1057,40 @@ class ToolController extends ThinkController { $endTime .= $_REQUEST[$name]; } } - + $this->checkTimeFormat($i, $startTime, $endTime, $_REQUEST[$name]); } + $start_timeArr = str_split($startTime, 1); + $startTimeStr = ''; + foreach ($start_timeArr as $timeKey => $start_time) { + if ($timeKey == 1 || $timeKey == 3) { + $startTimeStr .= $start_time.':'; + }else { + $startTimeStr .= $start_time; + } + + } + + $st = '2020-03-23'.' '.$startTimeStr; + $startTimeStamp = strtotime($st); + + $end_timeArr = str_split($endTime, 1); + $endTimeStr = ''; + foreach ($end_timeArr as $timeKey1 => $end_time) { + if ($timeKey1 == 1 || $timeKey1 == 3) { + $endTimeStr .= $end_time.':'; + }else { + $endTimeStr .= $end_time; + } + + } + + $et = '2020-03-23'.' '.$endTimeStr; + $endTimeStamp = strtotime($et); + if ($startTimeStamp >= $endTimeStamp) { + return $this->error('开始时间不能大于结束时间'); + } switch($status) { case 'daily': $limit_time_type = 'day'; diff --git a/Application/Admin/View/Tool/addLimitPay.html b/Application/Admin/View/Tool/addLimitPay.html index 58f207cd5..af4290066 100644 --- a/Application/Admin/View/Tool/addLimitPay.html +++ b/Application/Admin/View/Tool/addLimitPay.html @@ -79,16 +79,16 @@
- - + + :
- - + + :
- - + +
@@ -96,16 +96,16 @@
- - + + :
- - + + :
- - + +
@@ -113,7 +113,7 @@
- 说明:时间格式(00:00:00) + 说明:时间格式(24小时制,时间设置范围00:00:00 23:59:59)