芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/models/Customer.php
200], [['password'], 'string', 'max' => 150], [['username'], 'string', 'max' => 25], [['username','email','mobile'],'unique'], [['email'], 'string', 'max' => 255], ]; } public function beforeSave($insert) { if(parent::beforeSave($insert)){ if($this->isNewRecord || (!$this->isNewRecord && !empty($this->password))){ $this->password=password_hash($this->password,PASSWORD_DEFAULT); } return true; } return false; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'name' => 'Nombre', 'email' => 'Correo', 'mobile' => 'Whatsapp', 'username' => 'Usuario', 'password'=>'Contraseña', 'sort_order' => 'Sort Order', 'created' => 'Created', 'updated' => 'Updated', 'trash' => 'Trash', 'active' => 'Active', ]; } /** * Gets query for [[Licenses]]. * * @return \yii\db\ActiveQuery */ public function getCustomerlicenses() { return $this->hasMany(CustomerLicense::class, ['customer_id' => 'id']); } }