34 lines
763 B
PHP
34 lines
763 B
PHP
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use yii\behaviors\TimestampBehavior;
|
|
use yii\db\ActiveRecord;
|
|
|
|
class StoreDoctor extends \common\modelsgii\StoreDoctor
|
|
{
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
[
|
|
'class'=>TimestampBehavior::class,
|
|
'attributes'=>[
|
|
ActiveRecord::EVENT_BEFORE_INSERT=>['created_at','updated_at'],
|
|
ActiveRecord::EVENT_BEFORE_UPDATE=>['updated_at'],
|
|
]
|
|
]
|
|
];
|
|
}
|
|
|
|
|
|
//关联服务端用户
|
|
public function getServiceUser()
|
|
{
|
|
return $this->hasOne(ServiceUser::class,['id'=>'su_id']);
|
|
}
|
|
|
|
public function getStore()
|
|
{
|
|
return $this->hasOne(Store::class,['id'=>'store_id']);
|
|
}
|
|
} |