]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-70] Автозакрытие смен через 14 часов после date_start.' '.time_stat origin/bug_smirnov_erp-70_autoclose_more_14_hourse_shift
authorAlexander Smirnov <fredeom@mail.ru>
Fri, 5 Jul 2024 07:10:00 +0000 (10:10 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Fri, 5 Jul 2024 07:10:00 +0000 (10:10 +0300)
erp24/commands/TimetableController.php

index b67ef3e8fda50c5f935b6f29daf99fe019eae473..3ffeee40fe016f315ffe952ac7ae8b9994624a43 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace yii_app\commands;
 
+use yii\db\Expression;
 use yii_app\records\TimetableFactModel;
 use yii\console\Controller;
 use yii\helpers\Json;
@@ -11,7 +12,7 @@ class TimetableController extends Controller
 {
     public function actionAutocloseShifts() {
         $timetableFactModels = TimetableFactModel::find()->with(['checkinStart'])->where(['status' => AdminCheckin::TYPE_START])
-            ->andWhere(['<=', 'date_start', date('Y-m-d H:i:s', strtotime('-14 hours', time()))])->all();
+            ->andWhere(['<=', new Expression('CONCAT(date_start, \' \', time_start)'), date('Y-m-d H:i:s', strtotime('-14 hours', time()))])->all();
 
         foreach ($timetableFactModels as $timetableFactModel) {
             /** @var $timetableFactModel TimetableFactModel */