优化合同期限查询

master
chenzhi 5 years ago
parent 3ad0d447d4
commit 0197743266

@ -44,10 +44,10 @@ class PartnerController extends ThinkController
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$time_start = strtotime($_REQUEST['timestart']);
$time_end = strtotime($_REQUEST['timeend'])+ 86399;
$map["_string"] = "(contract_start_time BETWEEN {$time_start} AND {$time_end}) OR (contract_end_time BETWEEN {$time_start} AND {$time_end})";
$map["_string"] = "(contract_start_time BETWEEN {$time_start} AND {$time_end}) OR (contract_end_time BETWEEN {$time_start} AND {$time_end}) OR (contract_start_time <= {$time_end} AND contract_end_time >= {$time_end}) OR (contract_start_time >0 AND contract_end_time = 0)";
} elseif (isset($_REQUEST['timestart'])) {
$time_start = strtotime($_REQUEST['timestart']);
$map["_string"] = "(contract_start_time >= {$time_start} ) OR (contract_end_time >= {$time_start})";
$map["_string"] = "(contract_start_time >= {$time_start} ) OR (contract_end_time >= {$time_start}) OR ( contract_start_time >0 AND contract_end_time = 0)";
} elseif (isset($_REQUEST['timeend'])) {
$time_end = strtotime($_REQUEST['timeend'])+ 86399;
$map["_string"] = "(contract_start_time <= {$time_end} ) OR (contract_end_time <= {$time_end})";

Loading…
Cancel
Save