28 lines
696 B
PHP
28 lines
696 B
PHP
<?php
|
|
|
|
namespace common\models\oldDb;
|
|
|
|
class Admin extends \common\modelsgii\oldDb\Admin
|
|
{
|
|
|
|
public function beforeSave($insert)
|
|
{
|
|
if (!parent::beforeSave($insert)) {
|
|
return false;
|
|
}
|
|
if($this->isNewRecord){
|
|
$this->reg_time = time();
|
|
$this->reg_ip = ip2long(\Yii::$app->request->getUserIP());
|
|
}
|
|
$this->last_login_time = time();
|
|
$this->last_login_ip = ip2long(\Yii::$app->request->getUserIP());
|
|
$this->update_time = time();
|
|
return true; // TODO: Change the autogenerated stub
|
|
}
|
|
|
|
public function getStore()
|
|
{
|
|
return $this->hasOne(Store::class,['id'=>'store_id']);
|
|
}
|
|
}
|