$where = new Pano();
if ($cityName) {
if ($cityName == "-1") { //全部
$where = $where;
} else {
$where = $where->where("cityName", "=", $cityName);
}
}
if ($status) {
if ($status == "-1") { //全部
$where = $where;
} else {
$where = $where->where("status", "=", $status);
}
}
if ($keywords) {
$where = $where
->where("house_name", "like", "%" . $keywords . "%")
->orWhere("title", "like", "%" . $keywords . "%")
->orWhere("houseNum", "=", $keywords)
->orWhere("agentName", "like", "%" . $keywords . "%");
}
if ($createtTime) {
// 2020/07/14 - 2020/07/17
$createtTimeArr = explode("-", $createtTime);
$cTime_right_old = str_replace("/", "-", $createtTimeArr[1]);
$cTime_left_old = str_replace("/", "-", $createtTimeArr[0]);
$cTime_left = strtotime($cTime_left_old);
$cTime_right = strtotime($cTime_right_old);
if ($cTime_left == $cTime_right) {
$where = $where->whereDate("updated_at", $cTime_right_old);
} else {
$where = $where->whereDate("updated_at","<=",$cTime_right_old)
->whereDate("updated_at",">=",$cTime_left_old);
}
}
//过滤掉没有全景地址和不合规的全景数据
$panos = $where->where("panoUrl", "<>", null)->where("check_at", "<>", "3")->paginate($perPage);