From eb09f95ff8da9507b5b4cdce591434e575dbcd92 Mon Sep 17 00:00:00 2001 From: akosse Date: Fri, 24 Jan 2020 11:04:48 +0300 Subject: [PATCH] remove spaces from password --- backend/modules/card/models/UserCard.php | 6 ++++++ console/controllers/SqlController.php | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 console/controllers/SqlController.php diff --git a/backend/modules/card/models/UserCard.php b/backend/modules/card/models/UserCard.php index 6ffdef5..1cf853c 100755 --- a/backend/modules/card/models/UserCard.php +++ b/backend/modules/card/models/UserCard.php @@ -64,6 +64,12 @@ class UserCard extends \common\models\UserCard } } + public function beforeSave($insert) + { + $this->salary = str_replace(' ', '', \Yii::$app->request->post('UserCard')['salary']); + return parent::beforeSave($insert); // TODO: Change the autogenerated stub + } + public function afterSave($insert, $changedAttributes) { $post = \Yii::$app->request->post('UserCard'); diff --git a/console/controllers/SqlController.php b/console/controllers/SqlController.php new file mode 100644 index 0000000..2657a51 --- /dev/null +++ b/console/controllers/SqlController.php @@ -0,0 +1,17 @@ +db->createCommand($sql)->execute(); + } +} \ No newline at end of file