private function whereDate($s,$e,$col="dateline") {
$where = 'AND ';
if(!empty($s) and !empty($e)) {
$where .= "`$col` >= '{$s}' AND `$col` <= '{$e}' ";
} elseif (!empty($s) AND empty($e)) {
$now = time();
$where .= "`$col` >= '{$s}' AND `$col` <= '{$now}' ";
} elseif (empty($s) AND !empty($e)) {
$time = time()-86400;
$where .= "`$col` >= '{$time}' AND `$col` <= '{$e}' ";
} else {
$where = "";
}
return $where;
}
php date function
最新推荐文章于 2022-11-07 12:29:15 发布