Example #1
0
 /**
  * 入库前自动处理
  */
 public function beforeSave($insert)
 {
     parent::beforeSave();
     $this->password = md5($this->password);
     $this->create_time = time();
     $this->last_login_time = time();
     return true;
 }
Example #2
0
 public function beforeSave()
 {
     //$this->date=date("Y-m-d H:i:s",CDateTimeParser::parse($this->date,Yii::$app->locale->getDateFormat('yiishort')));
     //return true;
     return parent::beforeSave();
 }
Example #3
0
 public function beforeSave($insert)
 {
     $this->userId = Yii::$app->user->id;
     $this->updateDate = date('Y-m-d H:i:s');
     return parent::beforeSave($insert);
 }