$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'));