From a9400d3c0b98273f8f986acfb7b962d623afd09d Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 27 Jul 2021 16:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementController.class.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index d126b051d..0acc9fe2f 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -34,6 +34,7 @@ class CompanyStatementController extends ThinkController ]; public $admininfo; public $DBModel; + private $MarketEvent; static $specialCompoent; @@ -42,6 +43,7 @@ class CompanyStatementController extends ThinkController { $this->admininfo = $_SESSION['onethink_admin']['user_auth']; $this->DBModel = SM("CompanyStatement","tab_"); + $this->MarketEvent = A("Market","Event"); $Factory = BaseFactory::getInstance(); self::$specialCompoent = $Factory->factoryClass("SpecialCompoent"); @@ -60,16 +62,26 @@ class CompanyStatementController extends ThinkController $map = [ "_string"=>"1=1" ]; + + $gid = session('user_group_id'); + $markerGroup = $this->MarketEvent->isMarketAdminGroup($gid); + if($markerGroup){ + $companyIds = $this->MarketEvent->getAdminCompanyId(); + $map['_string'] .= ' AND company_id in(' . $companyIds . ') and company_belong not in (0,9)'; + } + + + if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { $time_start = strtotime($_REQUEST['time_start']); $time_end = strtotime($_REQUEST['time_end'])+ 86399; - $map["_string"] = "( (statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end}) )"; + $map["_string"] .= " AND ( (statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end}) )"; } elseif (isset($_REQUEST['time_start'])) { $time_start = strtotime($_REQUEST['time_start']); - $map["_string"] = "( (statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start}) )"; + $map["_string"] .= " AND ( (statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start}) )"; } elseif (isset($_REQUEST['time_end'])) { $time_end = strtotime($_REQUEST['time_end'])+ 86399; - $map["_string"] = "( (statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end}) )"; + $map["_string"] .= " AND ( (statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end}) )"; } if (isset($_REQUEST['time_start2']) && isset($_REQUEST['time_end2'])) {