初始化仓库
This commit is contained in:
30
common/models/UserPatientIll.php
Normal file
30
common/models/UserPatientIll.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class UserPatientIll extends \common\modelsgii\UserPatientIll
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// 关联就诊人
|
||||
public function getUserPatient()
|
||||
{
|
||||
return $this->hasOne(UserPatient::class,['id'=>'up_id'])->andWhere([
|
||||
'is_delete' => 0
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user