@ -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'])) {