use yii\db\StaleObjectException;
use yii_app\records\AdminGroup;
+use yii_app\records\EmployeeOnShift;
use yii_app\records\StoreGuidBuh;
use kartik\select2\Select2;
use Yii;
public function actionStoreGuidBuh()
{
+ $admin = Admin::findOne(1527);
+
+ $model = EmployeeOnShift::findOne(355);
+ $model->guid = DataHelper::createGuidMy("06");
+ $model->created_at = date("Y-m-d H:i:s");
+ $model->status = EmployeeOnShift::STATUS_ACCEPT;
+ $model->status_source = EmployeeOnShift::STATUS_SOURCE_NOT_CREATED_IN_1C;
+ $model->active = EmployeeOnShift::ACTIVE_ON;
+ $model->save();
+ if ($model->getErrors()) {
+var_dump($model->getErrors());die();
+ }
+
+ $admin->guid = $model->guid;
+ $admin->save(false);
+
+
if (!in_array(Admin::findOne([Yii::$app->user->id])->group_id, [AdminGroup::GROUP_IT])) {
return $this->render('/site/index');
}