初始化仓库
This commit is contained in:
50
common/models/PhysicalReserve.php
Normal file
50
common/models/PhysicalReserve.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveQuery;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class PhysicalReserve extends \common\modelsgii\PhysicalReserve
|
||||
{
|
||||
public function behaviors(): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 分院关联
|
||||
* @return ActiveQuery
|
||||
*/
|
||||
public function getYard(): ActiveQuery
|
||||
{
|
||||
return $this->hasOne(HospitalYard::className(),['id'=>'yard_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户关联
|
||||
* @return ActiveQuery
|
||||
*/
|
||||
public function getUser(): ActiveQuery
|
||||
{
|
||||
return $this->hasOne(User::className(),['id'=>'user_id'])->select('id,mobile,nickname,idcard');
|
||||
}
|
||||
|
||||
/**
|
||||
* 体检套餐关联
|
||||
* @return ActiveQuery
|
||||
*/
|
||||
public function getPackage(): ActiveQuery
|
||||
{
|
||||
return $this->hasOne(PhysicalPackage::className(),['id'=>'physical_id']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user