转接方分账

This commit is contained in:
李琦
2026-02-06 08:44:31 +08:00
parent 9680542b9e
commit e4eecfe9e1
5 changed files with 318 additions and 54 deletions

View File

@@ -70,6 +70,12 @@ class Prescription extends \common\modelsgii\oldDb\Prescription
return $this->hasOne(Register::class, ['id' => 'register_id']);
}
//转诊记录
public function getTransferPrescription()
{
return $this->hasOne(TransferPrescription::class, ['id' => 'transfer_prescription_id']);
}
//导出处方
public static function inventory($params,$store_id)
{

View File

@@ -57,6 +57,11 @@ class Register extends \common\modelsgii\oldDb\Register
public function getPrescription(){
return $this->hasMany(Prescription::class, ['register_id' => 'id']);
}
//转诊记录
public function getTransferPrescription()
{
return $this->hasOne(TransferPrescription::class, ['id' => 'transfer_prescription_id']);
}
//健康信息
public function getHealthInquery()
{

View File

@@ -0,0 +1,34 @@
<?php
namespace common\models\oldDb;
/**
* 转诊记录模型
* 存储西医诊所开具的中药处方转诊信息
*/
class TransferPrescription extends \common\modelsgii\oldDb\TransferPrescription
{
/**
* 关联原处方
*/
public function getOriginalPrescription()
{
return $this->hasOne(Prescription::class, ['id' => 'original_prescription_id']);
}
/**
* 关联转诊诊所(西医诊所)
*/
public function getTransferStore()
{
return $this->hasOne(Store::class, ['id' => 'transfer_store_id']);
}
/**
* 关联委托诊所(中医诊所)
*/
public function getDelegateStore()
{
return $this->hasOne(Store::class, ['id' => 'delegate_store_id']);
}
}