|
@@ -2,12 +2,12 @@ package service
|
2
|
2
|
|
3
|
3
|
import (
|
4
|
4
|
"XT_New/models"
|
|
5
|
+ "encoding/json"
|
5
|
6
|
"fmt"
|
6
|
7
|
"github.com/jinzhu/gorm"
|
|
8
|
+ "strconv"
|
7
|
9
|
"strings"
|
8
|
10
|
"time"
|
9
|
|
- "encoding/json"
|
10
|
|
- "strconv"
|
11
|
11
|
)
|
12
|
12
|
|
13
|
13
|
type VMSchedule struct {
|
|
@@ -721,7 +721,7 @@ func (BaseDrugLib) TableName() string {
|
721
|
721
|
}
|
722
|
722
|
|
723
|
723
|
func GetAllDrugLibList(org_id int64) (list []*BaseDrugLib, err error) {
|
724
|
|
- err = readDb.Model(&BaseDrugLib{}).Where("org_id = ? AND status = 1 AND find_in_set('停用',drug_status) = 0", org_id).Find(&list).Error
|
|
724
|
+ err = readDb.Model(&BaseDrugLib{}).Preload("OtherDrugWarehouseInfo", "status = 1").Where("org_id = ? AND status = 1 AND find_in_set('停用',drug_status) = 0", org_id).Find(&list).Error
|
725
|
725
|
return
|
726
|
726
|
}
|
727
|
727
|
|
|
@@ -1990,7 +1990,7 @@ func GetHisPrescriptionProjects(user_org_id int64, patient_id int64, record_time
|
1990
|
1990
|
defer redis.Close()
|
1991
|
1991
|
|
1992
|
1992
|
// cur_date := time.Now().Format("2006-01-02")
|
1993
|
|
- key := strconv.FormatInt(user_org_id, 10) + ":"+ strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(record_time, 10) + ":his_prescription_project"
|
|
1993
|
+ key := strconv.FormatInt(user_org_id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(record_time, 10) + ":his_prescription_project"
|
1994
|
1994
|
his_prescription_project_str, _ := redis.Get(key).Result()
|
1995
|
1995
|
|
1996
|
1996
|
if len(his_prescription_project_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
|