From e67ef5ac9a5ef735f55dc2442aef67df4bd33d72 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Wed, 4 Mar 2026 20:37:33 +0300 Subject: [PATCH] fix(timetable): guard admin_checkin query against empty bigint fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Prevent PDO exception when StartForm fields are empty strings — add null check before querying admin_checkin to avoid PostgreSQL bigint cast error. Co-Authored-By: Claude Sonnet 4.6 --- .../timetable/StartShiftStepThreeAction.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/erp24/actions/timetable/StartShiftStepThreeAction.php b/erp24/actions/timetable/StartShiftStepThreeAction.php index 6c42d6a8..524d8c09 100755 --- a/erp24/actions/timetable/StartShiftStepThreeAction.php +++ b/erp24/actions/timetable/StartShiftStepThreeAction.php @@ -32,12 +32,15 @@ class StartShiftStepThreeAction extends Action $model->load($request->post(null,'StartForm')); } - $currentCheckin = AdminCheckin::find() - ->andWhere(['admin_id' => $model->admin_id]) - ->andWhere(['store_id' => $model->store_id]) - ->andWhere(['type_id' => $model->type_id]) - ->andWhere(['id' => $model->checkin_id]) - ->one(); + $currentCheckin = null; + if ($model->admin_id && $model->store_id && $model->type_id && $model->checkin_id) { + $currentCheckin = AdminCheckin::find() + ->andWhere(['admin_id' => $model->admin_id]) + ->andWhere(['store_id' => $model->store_id]) + ->andWhere(['type_id' => $model->type_id]) + ->andWhere(['id' => $model->checkin_id]) + ->one(); + } //отрабатывает только для открытия $fact = TimetableFactModel::getLast($userModel->id, date('Y-m-d')); -- 2.39.5