From 5add29fa6b48fc10c27a7162799a7adef4df722c Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Tue, 24 Nov 2020 18:18:04 +0800 Subject: [PATCH] =?UTF-8?q?11=E6=9C=88=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 27 +++++++++++-------- .../Admin/View/PromoteCompany/lists.html | 4 +-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 310477fb4..de6be4363 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -29,6 +29,11 @@ class PromoteCompanyController extends ThinkController //列表 public function lists() { + //设定默认时间 + if(!array_key_exists("begintime",$_REQUEST) && I('type') != 2){ + $this->redirect(ACTION_NAME, array('begintime' => date('Y-m-d',strtotime('-30 day')),"endtime"=>date('Y-m-d'))); + } + $model = M($this->modelName, 'tab_'); $is_export= false; if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ @@ -96,17 +101,17 @@ class PromoteCompanyController extends ThinkController } - if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { - $time_start = strtotime($_REQUEST['time_start']); - $time_end = strtotime($_REQUEST['time_end'])+ 86399; - $where["_string"] = "(begin_time BETWEEN {$time_start} AND {$time_end}) OR (end_time BETWEEN {$time_start} AND {$time_end}) OR (begin_time <= {$time_end} AND end_time >= {$time_end}) OR (begin_time >0 AND end_time = 0)"; - } elseif (isset($_REQUEST['time_start'])) { - $time_start = strtotime($_REQUEST['time_start']); - $where["_string"] = "end_time >= {$time_start} OR end_time = 0"; - } elseif (isset($_REQUEST['time_end'])) { - $time_end = strtotime($_REQUEST['time_end'])+ 86399; - $where["_string"] = "begin_time <= {$time_end}"; - } +// if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { +// $time_start = strtotime($_REQUEST['time_start']); +// $time_end = strtotime($_REQUEST['time_end'])+ 86399; +// $where["_string"] = "(begin_time BETWEEN {$time_start} AND {$time_end}) OR (end_time BETWEEN {$time_start} AND {$time_end}) OR (begin_time <= {$time_end} AND end_time >= {$time_end}) OR (begin_time >0 AND end_time = 0)"; +// } elseif (isset($_REQUEST['time_start'])) { +// $time_start = strtotime($_REQUEST['time_start']); +// $where["_string"] = "end_time >= {$time_start} OR end_time = 0"; +// } elseif (isset($_REQUEST['time_end'])) { +// $time_end = strtotime($_REQUEST['time_end'])+ 86399; +// $where["_string"] = "begin_time <= {$time_end}"; +// } // dd($map); diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index dc952541d..de0997f56 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -117,11 +117,11 @@
- -
-