|
@@ -3048,10 +3048,10 @@ func GetBatchHisProjectByIDs(ids []int64) (list []*models.HisPrescriptionProject
|
3048
|
3048
|
return
|
3049
|
3049
|
}
|
3050
|
3050
|
|
3051
|
|
-func UpdatePrescriptionAdvice(drug_id int64, user_org_id int64, price float64) (models.HisPrescriptionAdviceTemplate, error) {
|
|
3051
|
+func UpdatePrescriptionAdvice(drug_id int64, user_org_id int64, price float64, patient_id int64) (models.HisPrescriptionAdviceTemplate, error) {
|
3052
|
3052
|
|
3053
|
3053
|
adviceTemplate := models.HisPrescriptionAdviceTemplate{}
|
3054
|
|
- err := XTWriteDB().Model(&adviceTemplate).Where("drug_id = ? and user_org_id =? and status =1", drug_id, user_org_id).Updates(map[string]interface{}{"price": price}).Error
|
|
3054
|
+ err := XTWriteDB().Model(&adviceTemplate).Where("drug_id = ? and user_org_id =? and status =1 and patient_id =?", drug_id, user_org_id, patient_id).Updates(map[string]interface{}{"price": price}).Error
|
3055
|
3055
|
return adviceTemplate, err
|
3056
|
3056
|
}
|
3057
|
3057
|
|
|
@@ -3063,11 +3063,11 @@ func UpdateBaseMinPrice(drug_id int64, user_org_id int64, retial_price float64)
|
3063
|
3063
|
return lib, err
|
3064
|
3064
|
}
|
3065
|
3065
|
|
3066
|
|
-func UpdatePrescriptionProject(good_id int64, user_org_id int64, packing_price float64) (models.HisPrescriptionProjectTemplate, error) {
|
|
3066
|
+func UpdatePrescriptionProject(good_id int64, user_org_id int64, packing_price float64, patient_id int64) (models.HisPrescriptionProjectTemplate, error) {
|
3067
|
3067
|
|
3068
|
3068
|
projectTemplate := models.HisPrescriptionProjectTemplate{}
|
3069
|
3069
|
|
3070
|
|
- err := XTWriteDB().Model(&projectTemplate).Where("project_id = ? and status=1 and user_org_id =?", good_id, user_org_id).Updates(map[string]interface{}{"price": packing_price}).Error
|
|
3070
|
+ err := XTWriteDB().Model(&projectTemplate).Where("project_id = ? and status=1 and user_org_id =? and patient_id =?", good_id, user_org_id, patient_id).Updates(map[string]interface{}{"price": packing_price}).Error
|
3071
|
3071
|
|
3072
|
3072
|
return projectTemplate, err
|
3073
|
3073
|
}
|
|
@@ -3076,7 +3076,7 @@ func UpdateGood(good_id int64, user_org_id int64, packing_price float64) (models
|
3076
|
3076
|
|
3077
|
3077
|
goodInfo := models.GoodInfo{}
|
3078
|
3078
|
|
3079
|
|
- err := XTWriteDB().Where("id = ? and user_org_id = ? and status=1", good_id, user_org_id).Updates(map[string]interface{}{"packing_price": packing_price}).Error
|
|
3079
|
+ err := XTWriteDB().Model(&goodInfo).Where("id = ? and org_id = ? and status=1", good_id, user_org_id).Updates(map[string]interface{}{"packing_price": packing_price}).Error
|
3080
|
3080
|
|
3081
|
3081
|
return goodInfo, err
|
3082
|
3082
|
}
|