From bcd62dddd73616b89469d7a947dedfaaadd9a121 Mon Sep 17 00:00:00 2001 From: vguanyiwgd Date: Thu, 6 Jun 2024 17:01:19 +0800 Subject: [PATCH] update Change-Id: Ie1f508ed9b6ecae20513e7fc72d0960f4b9fe837 --- .../backstage/controllers/Recharge.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/backstage/application/backstage/controllers/Recharge.php b/backstage/application/backstage/controllers/Recharge.php index cca6821..f37b864 100644 --- a/backstage/application/backstage/controllers/Recharge.php +++ b/backstage/application/backstage/controllers/Recharge.php @@ -1469,9 +1469,9 @@ class Recharge extends CI_Controller $data['many_times_consume_start'] = trim($info['many_times_consume_start']); $data['many_times_consume_end'] = trim($info['many_times_consume_end']); - $data['user_type_id'] = $info['user_type_id']; - $data['effective_type'] = $info['effective_type']; - $data['gift_type'] = $info['gift_type']; + $data['user_type_id'] = $info['user_type_id'] ?: null; + $data['effective_type'] = $info['effective_type'] ?: null; + $data['gift_type'] = $info['gift_type'] ?: null; $data['status'] = $info['status']; if(empty($data['name'])){ @@ -1515,6 +1515,19 @@ class Recharge extends CI_Controller exit; } + // 把时间格式:替换成: + $data['start_time'] = str_replace(":", ":", $data['start_time']); + $data['end_time'] = str_replace(":", ":", $data['end_time']); + // 判断时间格式是否正确 + if(!preg_match("/^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/", $data['start_time'])){ + echo $this->lw_load->jsonResult(false,array('msg'=>'开始时间格式不正确')); + exit; + } + if(!preg_match("/^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/", $data['end_time'])){ + echo $this->lw_load->jsonResult(false,array('msg'=>'结束时间格式不正确')); + exit; + } + if(in_array("*", $data['user_type_id'])){ $data['user_type_id'] = '*'; }else{