Files
xk-api-yii/common/models/oldDb/UserPatientIll.php

30 lines
730 B
PHP

<?php
namespace common\models\oldDb;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
class UserPatientIll extends \common\modelsgii\oldDb\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
]);
}
}