服务时间筛选修改
This commit is contained in:
parent
fdbc71651b
commit
4733bcceef
@ -100,35 +100,28 @@ trait OrderCardConcern
|
|||||||
$query->where('created_at', '<=', Carbon::parse($conditions['endtime']));
|
$query->where('created_at', '<=', Carbon::parse($conditions['endtime']));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($conditions['service_start_endtime'])) {
|
if (isset($conditions['service_start_starttime']) && isset($conditions['service_start_endtime'])) {
|
||||||
$date = Carbon::parse($conditions['service_start_starttime']);
|
$date = Carbon::parse($conditions['service_start_starttime']);
|
||||||
$havingRaw = sprintf("sim in (SELECT sim FROM virtual_order_cards_partition GROUP BY sim HAVING MIN(service_start_at) >= '%s')", $date);
|
$havingRaw = sprintf(
|
||||||
|
"sim in (SELECT sim FROM virtual_order_cards_partition GROUP BY sim HAVING MIN(service_start_at) >= '%s' AND MIN(service_start_at) <= '%s')",
|
||||||
|
Carbon::parse($conditions['service_start_starttime']),
|
||||||
|
Carbon::parse($conditions['service_start_endtime'])
|
||||||
|
);
|
||||||
$this->model = $this->model->whereRaw($havingRaw);
|
$this->model = $this->model->whereRaw($havingRaw);
|
||||||
|
|
||||||
// $query->where('service_start_at', '>=', Carbon::parse($conditions['service_start_starttime']));
|
// $query->where('service_start_at', '>=', Carbon::parse($conditions['service_start_starttime']));
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($conditions['service_start_endtime'])) {
|
|
||||||
$date = Carbon::parse($conditions['service_start_endtime']);
|
|
||||||
$havingRaw = sprintf("sim in (SELECT sim FROM virtual_order_cards_partition GROUP BY sim HAVING MIN(service_start_at) <= '%s')", $date);
|
|
||||||
$this->model = $this->model->whereRaw($havingRaw);
|
|
||||||
|
|
||||||
// $query->where('service_start_at', '<=', Carbon::parse($conditions['service_start_endtime']));
|
// $query->where('service_start_at', '<=', Carbon::parse($conditions['service_start_endtime']));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($conditions['service_end_starttime'])) {
|
if (isset($conditions['service_end_starttime']) && isset($conditions['service_end_endtime'])) {
|
||||||
$date = Carbon::parse($conditions['service_end_starttime']);
|
$havingRaw = sprintf(
|
||||||
$havingRaw = sprintf("sim in (SELECT sim FROM virtual_order_cards_partition GROUP BY sim HAVING MAX(service_end_at) >= '%s')", $date);
|
"sim in (SELECT sim FROM virtual_order_cards_partition GROUP BY sim HAVING MAX(service_end_at) >= '%s' AND MAX(service_end_at) <= '%s')",
|
||||||
|
Carbon::parse($conditions['service_end_starttime']),
|
||||||
|
Carbon::parse($conditions['service_end_endtime'])
|
||||||
|
);
|
||||||
$this->model = $this->model->whereRaw($havingRaw);
|
$this->model = $this->model->whereRaw($havingRaw);
|
||||||
|
|
||||||
// $query->where('service_end_at', '>=', Carbon::parse($conditions['service_end_starttime']));
|
// $query->where('service_end_at', '>=', Carbon::parse($conditions['service_end_starttime']));
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($conditions['service_end_endtime'])) {
|
|
||||||
$date = Carbon::parse($conditions['service_end_endtime']);
|
|
||||||
$havingRaw = sprintf("sim in (SELECT sim FROM virtual_order_cards_partition GROUP BY sim HAVING MAX(service_end_at) <= '%s')", $date);
|
|
||||||
$this->model = $this->model->whereRaw($havingRaw);
|
|
||||||
|
|
||||||
// $query->where('service_end_at', '<=', Carbon::parse($conditions['service_end_endtime']));
|
// $query->where('service_end_at', '<=', Carbon::parse($conditions['service_end_endtime']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user