mysql判断两个时间段是否有交集
时间:2021-07-01 10:21:17
帮助过:179人阅读
判断两个时间段是否有交集
private function checkTimeCross($start_time,$end_time){
$sql = "
select id
from dkh_recharge_activity
where ( status
= 1 AND is_del
= 0 )
AND ((start_time
> {$start_time}
AND start_time
< {$end_time})
OR (start_time
< {$start_time}
AND end_time
> {$end_time})
OR (end_time
> {$start_time}
AND end_time
< {$end_time}))";
$getOne = $this
->dkhRechargeActivityModel
->baseExecuteSql($sql);
return $getOne;
}
mysql判断两个时间段是否有交集
标签:ret stat sql ros where ase har one turn