From: marina Date: Fri, 5 Jul 2024 02:57:42 +0000 (+0300) Subject: ERP-65 X-Git-Tag: 1.3~17^2~2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=50db43e0b007042a7a414e56488adb39ba741b17;p=erp24_rep%2Fyii-erp24%2F.git ERP-65 Перенести в новый фактический табель все смены сотрудников, которые были до 13.06 --- diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index a8fa85f8..2bf49427 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -155,13 +155,12 @@ class TimetableFactController extends Controller $query = Timetable::find() ->alias('t') - ->leftJoin('timetable_fact tf', 'tf.plan_id = t.plan_id') ->andWhere(['>=', 't.date', '2024-06-01']) ->andWhere(['<', 't.date', date('Y-m-d')]) + ->andWhere(new \yii\db\Expression('EXISTS (SELECT 1 FROM admin_checkin ac WHERE ac.plan_id = "t".id)')) ->select([ 't.*', new \yii\db\Expression('(SELECT ARRAY(SELECT ac.id FROM admin_checkin ac WHERE ac.plan_id = t.id)) AS admin_checkin_ids'), - new \yii\db\Expression('EXISTS (SELECT 1 FROM admin_checkin ac WHERE ac.plan_id = "t".id)'), ]); if ($action == 'applyPlus') {