|
@@ -553,7 +553,7 @@ type HisOrderTen struct {
|
553
|
553
|
Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
|
554
|
554
|
PType int64 `gorm:"column:p_type" json:"p_type" form:"p_type"`
|
555
|
555
|
Decimal float64 `gorm:"column:decimal" json:"decimal" form:"decimal"`
|
556
|
|
- HisPrescriptionTen []*HisPrescriptionTen `gorm:"ForeignKey:BatchNumber;AssociationForeignKey:Number" json:"info"`
|
|
556
|
+ VmHisOrderInfo9504 []*VmHisOrderInfo9504 `gorm:"ForeignKey:OrderNumber;AssociationForeignKey:Number" json:"info"`
|
557
|
557
|
Patients Patients `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
|
558
|
558
|
}
|
559
|
559
|
|
|
@@ -593,13 +593,13 @@ func (HisPrescriptionTen) TableName() string {
|
593
|
593
|
}
|
594
|
594
|
|
595
|
595
|
func GetHisOrderDetailThree() (order []*HisOrderTen, err error) {
|
596
|
|
- err = readDb.Model(&HisOrderTen{}).Preload("Patients", "status = 1").Preload("HisPrescriptionTen", func(db *gorm.DB) *gorm.DB {
|
|
596
|
+ err = readDb.Model(&HisOrderTen{}).Preload("Patients", "status = 1").Preload("VmHisOrderInfo9504", func(db *gorm.DB) *gorm.DB {
|
597
|
597
|
return db.Where("status = 1").Preload("HisPrescriptionProjectTen", func(db *gorm.DB) *gorm.DB {
|
598
|
598
|
return db.Where("status = 1").Preload("VMHisProject", "status = 1").Preload("VMGoodInfo", "status = 1")
|
599
|
599
|
}).Preload("HisDoctorAdviceInfoTen", func(db *gorm.DB) *gorm.DB {
|
600
|
600
|
return db.Where("status = 1").Preload("Drug", "status = 1")
|
601
|
601
|
})
|
602
|
|
- }).Where("settle_accounts_date >= 1659283200 AND settle_accounts_date <= 1661788800 AND status = 1 AND order_status =2 and p_type = 1 AND user_org_id = 10215").Find(&order).Order("patient_id").Error
|
|
602
|
+ }).Where("setl_time >= '2023-03-01 00:00:00' AND setl_time <= '2023-03-31 23:59:59' AND status = 1 AND order_status =2 and p_type = 1 AND user_org_id = 10215").Find(&order).Order("patient_id").Error
|
603
|
603
|
return
|
604
|
604
|
}
|
605
|
605
|
|