|
@@ -304,7 +304,7 @@ func GetHisPatientHistory(keyword string, startime int64, endtime int64, registt
|
304
|
304
|
if orgid > 0 {
|
305
|
305
|
db = db.Where("x.user_org_id = ?", orgid)
|
306
|
306
|
}
|
307
|
|
- err = db.Select("x.id,x.balance_accounts_type,x.medical_insurance_number,x.name,x.gender,x.id_type,x.medical_treatment_type,x.birthday,x.record_date,x.age,x.phone_number,x.id_card_no,x.register_type,x.admin_user_id,x.departments,x.is_need_cost_of_production,x.register_cost,x.treatment_cost,x.cost_of_production,x.total,x.user_org_id,x.patient_id,x.number,x.is_return,x.doctor").Count(&total).Offset(offset).Limit(limit).Find(&hisPatient).Error
|
|
307
|
+ err = db.Select("x.id,x.balance_accounts_type,x.medical_insurance_number,x.name,x.gender,x.id_type,x.medical_treatment_type,x.birthday,x.record_date,x.age,x.phone_number,x.id_card_no,x.register_type,x.admin_user_id,x.departments,x.is_need_cost_of_production,x.register_cost,x.treatment_cost,x.cost_of_production,x.total,x.user_org_id,x.patient_id,x.number,x.is_return,x.doctor,x.ctime").Count(&total).Offset(offset).Limit(limit).Order("x.id desc").Find(&hisPatient).Error
|
308
|
308
|
return hisPatient, total, err
|
309
|
309
|
}
|
310
|
310
|
|
|
@@ -556,7 +556,6 @@ func UpdateHisPatient(id int64, patient models.HisPatient) error {
|
556
|
556
|
|
557
|
557
|
func GetTodaySchedulePatient(orgid int64, scheduledata int64) (schedule []*models.Schedules, err error) {
|
558
|
558
|
|
559
|
|
- schedules := models.Schedules{}
|
560
|
559
|
db := XTReadDB().Table("xt_schedule as x").Where("x.status = 1")
|
561
|
560
|
if orgid > 0 {
|
562
|
561
|
db = db.Where("x.user_org_id = ?", orgid)
|
|
@@ -565,6 +564,6 @@ func GetTodaySchedulePatient(orgid int64, scheduledata int64) (schedule []*model
|
565
|
564
|
db = db.Where("x.schedule_date = ?", scheduledata)
|
566
|
565
|
}
|
567
|
566
|
|
568
|
|
- err = db.Select("x.id,x.patient_id,x.schedule_date,t.name").Joins("left join xt_patients as t on t.id = x.patient_id").Scan(&schedules).Error
|
|
567
|
+ err = db.Select("x.id,x.patient_id,x.schedule_date,t.name").Joins("left join xt_patients as t on t.id = x.patient_id").Scan(&schedule).Error
|
569
|
568
|
return schedule, err
|
570
|
569
|
}
|