diff --git a/backend/controllers/AccountsController.php b/backend/controllers/AccountsController.php index 8fc6c88..e291f25 100755 --- a/backend/controllers/AccountsController.php +++ b/backend/controllers/AccountsController.php @@ -86,7 +86,8 @@ class AccountsController extends Controller $cities = DicCities::find()->all(); $margin = Margins::find()->all(); $users = User::find()->all(); - + $model->load(Yii::$app->request->post()); + die( var_dump($model->validate())); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { @@ -116,6 +117,7 @@ class AccountsController extends Controller $model->dt = date("Y.m.d" , $model->dt); if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('update', [ diff --git a/backend/controllers/NewsController.php b/backend/controllers/NewsController.php index 438b11d..cfebf06 100755 --- a/backend/controllers/NewsController.php +++ b/backend/controllers/NewsController.php @@ -31,7 +31,7 @@ class NewsController extends Controller 'class' => AccessControl::className(), 'rules' => [ [ - 'actions' => ['login', 'error', 'download-photo','delete-image' ], + 'actions' => ['login', 'error', 'price-list-upload','file-upload' ], 'allow' => true, ], [ diff --git a/backend/models/Accounts.php b/backend/models/Accounts.php index 1cb7f64..5f7b3b1 100644 --- a/backend/models/Accounts.php +++ b/backend/models/Accounts.php @@ -48,9 +48,6 @@ use Yii; class Accounts extends \yii\db\ActiveRecord { - public $re_pass; - public $surname; - public $verifyCode; /** * @inheritdoc @@ -75,19 +72,18 @@ class Accounts extends \yii\db\ActiveRecord { return [ [['if_manager', 'margin_id', 'country', 'city', 'rating', 'is_active', 'is_firm', 'office_id', 'is_scribe', 'set_manager_id', 'car', 'mod', 'deliveries', 'scode'], 'integer'], - [['email', 'pass', 'name','surname', 'phones',], 'required'], + [['email', 'pass', 'name', 'phones'], 'required'], [['comment'], 'string'], [['balance'], 'number'], - [['email', 'name','surname', 'firm_site'], 'string', 'max' => 150], - [['pass','re_pass'], 'string', 'max' => 30], + [['email', 'name', 'firm_site'], 'string', 'max' => 150], + [['pass'], 'string', 'max' => 30], [['phones', 'phones2', 'phones3'], 'string', 'max' => 50], [['address', 'firm_inn', 'firm_bank'], 'string', 'max' => 254], [['last_loginin'], 'string', 'max' => 15], [['snumb', 'firm_ur_adr', 'firm_fiz_adr', 'firm_code_eg', 'firm_rs', 'firm_mfo', 'company'], 'string', 'max' => 255], [['email'], 'unique'], [['email'], 'email'], - ['re_pass', 'compare', 'compareAttribute' => 'pass'], - ['dt', 'date', 'format' => 'Y.m.d'] + ['dt', 'date', 'format' => 'php:Y.m.d'] ]; } -- libgit2 0.21.4