From 313fb9a2fc346d5ef4e3987967976f05c6feb503 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 19 Nov 2015 13:02:58 +0200 Subject: [PATCH] access in admin --- backend/views/accounts/_form.php | 2 +- common/models/Accounts.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/views/accounts/_form.php b/backend/views/accounts/_form.php index ec2e680..d9b5c8f 100755 --- a/backend/views/accounts/_form.php +++ b/backend/views/accounts/_form.php @@ -36,7 +36,7 @@ use yii\helpers\ArrayHelper; field($model, 'comment')->textarea(['rows' => 6]) ?> - field($model, 'dt')->textInput(['maxlength' => true]) ?> + field($model, 'dt')->textInput(['maxlength' => true,'value'=>date('Y.m.d')]) ?> field($model, 'is_active')->checkbox() ?> diff --git a/common/models/Accounts.php b/common/models/Accounts.php index f49ad77..9f4fb7a 100755 --- a/common/models/Accounts.php +++ b/common/models/Accounts.php @@ -75,7 +75,7 @@ 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'], - [['company','email', 'pass', 'name','surname', 'phones', 'comment', 'dt', 'set_manager_id'], 'required'], + [['email', 'pass', 'name','surname', 'phones',], 'required'], [['comment'], 'string'], [['balance'], 'number'], [['email', 'name','surname', 'firm_site'], 'string', 'max' => 150], @@ -88,6 +88,7 @@ class Accounts extends \yii\db\ActiveRecord [['email'], 'email'], ['re_pass', 'compare', 'compareAttribute' => 'pass'], ['verifyCode', 'captcha'], + ['dt', 'date', 'format' => 'Y.m.d'] ]; } -- libgit2 0.21.4