|
@@ -216,10 +216,17 @@ func GetDialysisOrderCountSeven(patient_id int64, recordDate int64) (models.VmDi
|
216
|
216
|
// return
|
217
|
217
|
//}
|
218
|
218
|
|
219
|
|
-func GetDialysisOrderCountOne(orgID int64, patient_id int64, recordDate int64) (count int64, err error) {
|
220
|
|
- err = p_service.XTReadDB().Model(&models.DialysisOrder{}).Where("dialysis_date >=1640966400 and dialysis_date <= ? AND status = 1 AND stage = 2 AND user_org_id = ? AND patient_id = ?", recordDate, orgID, patient_id).Count(&count).Error
|
221
|
|
- return
|
|
219
|
+//func GetDialysisOrderCountOne(orgID int64, patient_id int64, recordDate int64) (count int64, err error) {
|
|
220
|
+// err = p_service.XTReadDB().Model(&models.DialysisOrder{}).Where("dialysis_date >=1640966400 and dialysis_date <= ? AND status = 1 AND stage = 2 AND user_org_id = ? AND patient_id = ?", recordDate, orgID, patient_id).Count(&count).Error
|
|
221
|
+// return
|
|
222
|
+//}
|
|
223
|
+
|
|
224
|
+func GetDialysisOrderCountEight(orgID int64, patient_id int64, recordDate int64) (models.VmDialysisOrder, error) {
|
|
225
|
+ order := models.VmDialysisOrder{}
|
|
226
|
+ err := p_service.XTReadDB().Raw("SELECT Count(id) as count,Max(dialysis_date) as dialysis_date from xt_dialysis_order where dialysis_date>=1640966400 and dialysis_date <= ? AND status = 1 AND stage = 2 AND patient_id = ? and user_org_id = ?", recordDate, patient_id, orgID).Scan(&order).Error
|
|
227
|
+ return order, err
|
222
|
228
|
}
|
|
229
|
+
|
223
|
230
|
func GetOutStockTotalCountTwo(startime int64, endtime int64, orgid int64) (autoMatic []*models.NewXtAutomaticReduceDetail, err error) {
|
224
|
231
|
|
225
|
232
|
err = p_service.XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.record_time,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and x.record_time >= ? and x.record_time<=? and `status` = 1) as b GROUP BY good_id", orgid, startime, endtime).Scan(&autoMatic).Error
|