From: Aleksey Filippov Date: Wed, 4 Mar 2026 17:37:33 +0000 (+0300) Subject: fix(timetable): guard admin_checkin query against empty bigint fields X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e67ef5ac9a5ef735f55dc2442aef67df4bd33d72;p=erp24_rep%2Fyii-erp24%2F.git fix(timetable): guard admin_checkin query against empty bigint fields 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 --- 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'));