优化订单显示

master
chenzhi 3 years ago
parent 7d3dc9f8d2
commit a9400d3c0b

@ -34,6 +34,7 @@ class CompanyStatementController extends ThinkController
]; ];
public $admininfo; public $admininfo;
public $DBModel; public $DBModel;
private $MarketEvent;
static $specialCompoent; static $specialCompoent;
@ -42,6 +43,7 @@ class CompanyStatementController extends ThinkController
{ {
$this->admininfo = $_SESSION['onethink_admin']['user_auth']; $this->admininfo = $_SESSION['onethink_admin']['user_auth'];
$this->DBModel = SM("CompanyStatement","tab_"); $this->DBModel = SM("CompanyStatement","tab_");
$this->MarketEvent = A("Market","Event");
$Factory = BaseFactory::getInstance(); $Factory = BaseFactory::getInstance();
self::$specialCompoent = $Factory->factoryClass("SpecialCompoent"); self::$specialCompoent = $Factory->factoryClass("SpecialCompoent");
@ -60,16 +62,26 @@ class CompanyStatementController extends ThinkController
$map = [ $map = [
"_string"=>"1=1" "_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'])) { if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$time_start = strtotime($_REQUEST['time_start']); $time_start = strtotime($_REQUEST['time_start']);
$time_end = strtotime($_REQUEST['time_end'])+ 86399; $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'])) { } elseif (isset($_REQUEST['time_start'])) {
$time_start = strtotime($_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'])) { } elseif (isset($_REQUEST['time_end'])) {
$time_end = strtotime($_REQUEST['time_end'])+ 86399; $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'])) { if (isset($_REQUEST['time_start2']) && isset($_REQUEST['time_end2'])) {

Loading…
Cancel
Save