更新项目部分结构,新增加DB

This commit is contained in:
2024-12-19 19:20:27 +08:00
parent 0fe2624e6b
commit 992c94250d
539 changed files with 1667 additions and 1906 deletions

View File

@@ -0,0 +1,27 @@
<?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']);
}
}