->indexBy('store_id')
->asArray()->all();
- $date_start = $data->shift_type == 2 ?
+ $date_start = $data->shift_type == Shift::NIGHT ?
date("Y-m-d 20:00:00", strtotime($currentDate)) :
- ($data->shift_type == 1 ?
+ ($data->shift_type == Shift::DAY ?
date("Y-m-d 08:00:00", strtotime($currentDate)) :
date("Y-m-d 00:00:00", strtotime($currentDate)));
- $date_end = $data->shift_type == 1 ?
+ $date_end = $data->shift_type == Shift::DAY ?
date("Y-m-d 20:00:00", strtotime($currentDate)) :
- ($data->shift_type == 2 ?
+ ($data->shift_type == Shift::NIGHT ?
date("Y-m-d 08:00:00", strtotime("+1 day", strtotime($currentDate))) :
date("Y-m-d 00:00:00", strtotime("+1 day", strtotime($currentDate))));
'store_id',
]);
- if ($data->shift_type == 1) {
+ if ($data->shift_type == Shift::DAY) {
$storeVisitorsQuery->andWhere(['>=', 'date_hour', 8])->andWhere(['<=', 'date_hour', 20])
->andWhere(['date' => date("Y-m-d", strtotime($currentDate))]);
}
- if ($data->shift_type == 2) {
+ if ($data->shift_type == Shift::NIGHT) {
$storeVisitorsQuery->andWhere([
'or',
[
->indexBy('store_id')
->asArray()->all();
- $date_start = $data->shift_type == 2 ?
+ $date_start = $data->shift_type == Shift::NIGHT ?
date("Y-m-d 20:00:00", strtotime($currentDate)) :
- ($data->shift_type == 1 ?
+ ($data->shift_type == Shift::DAY ?
date("Y-m-d 08:00:00", strtotime($currentDate)) :
date("Y-m-d 00:00:00", strtotime($currentDate)));
- $date_end = $data->shift_type == 1 ?
+ $date_end = $data->shift_type == Shift::DAY ?
date("Y-m-d 20:00:00", strtotime($currentDate)) :
- ($data->shift_type == 2 ?
+ ($data->shift_type == Shift::NIGHT ?
date("Y-m-d 08:00:00", strtotime("+1 day", strtotime($currentDate))) :
date("Y-m-d 00:00:00", strtotime("+1 day", strtotime($currentDate))));
'store_id'
]);
- if ($data->shift_type == 1) {
+ if ($data->shift_type == Shift::DAY) {
$storeVisitorsQuery->andWhere(['>=', 'date_hour', 8])->andWhere(['<=', 'date_hour', 20])
->andWhere(['date' => date("Y-m-d", strtotime($currentDate))]);
}
- if ($data->shift_type == 2) {
+ if ($data->shift_type == Shift::NIGHT) {
$storeVisitorsQuery->andWhere([
'or',
[
->indexBy('store_id')
->asArray()->all();
- if ($data->shift_type == 2) {
+ if ($data->shift_type == Shift::NIGHT) {
// Ночная смена
$date_start = date("Y-m-d 20:00:00", strtotime($day));
$date_end = date("Y-m-d 08:00:00", strtotime("+1 day", strtotime($day)));
- } elseif ($data->shift_type == 1) {
+ } elseif ($data->shift_type == Shift::DAY) {
// Дневная смена
$date_start = date("Y-m-d 08:00:00", strtotime($day));
$date_end = date("Y-m-d 20:00:00", strtotime($day));
'store_id'
]);
- if ($data->shift_type == 1) {
+ if ($data->shift_type == Shift::DAY) {
$storeVisitorsQuery->andWhere(['>=', 'date_hour', 8])->andWhere(['<=', 'date_hour', 20])
->andWhere(['date' => date("Y-m-d", strtotime($day))]);
}
- if ($data->shift_type == 2) {
+ if ($data->shift_type == Shift::NIGHT) {
$storeVisitorsQuery->andWhere([
'or',
[