Browse Source

耗材参数

XMLWAN 4 years ago
parent
commit
c8cf6ceda2
2 changed files with 3 additions and 2 deletions
  1. 3 0
      controllers/data_api_controller.go
  2. 0 2
      models/doctor_advice_models.go

+ 3 - 0
controllers/data_api_controller.go View File

@@ -1014,6 +1014,8 @@ func (c *DataApiController) UpdateAdviceTemplate() {
1014 1014
 
1015 1015
 	adminUserInfo := c.GetAdminUserInfo()
1016 1016
 	id, _ := c.GetInt64("id", 0)
1017
+	drug_id, _ := c.GetInt64("drug_id", 0)
1018
+	fmt.Println("drug_id-------", drug_id)
1017 1019
 	if id <= 0 {
1018 1020
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1019 1021
 		return
@@ -1067,6 +1069,7 @@ func (c *DataApiController) UpdateAdviceTemplate() {
1067 1069
 	template.FrequencyType = templatedata.FrequencyType
1068 1070
 	template.DayCount = templatedata.DayCount
1069 1071
 	template.WeekDays = templatedata.WeekDays
1072
+	template.DrugId = drug_id
1070 1073
 
1071 1074
 	err = service.UpdateAdviceTemplate(template)
1072 1075
 	if err != nil {

+ 0 - 2
models/doctor_advice_models.go View File

@@ -75,8 +75,6 @@ type DoctorAdviceTemplate struct {
75 75
 	DrugId                  int64                   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
76 76
 	Way                     int64                   `gorm:"column:way" json:"way" form:"way"`
77 77
 	SubDoctorAdviceTemplate []*DoctorAdviceTemplate `gorm:"ForeignKey:ParentId;AssociationForeignKey:ID" json:"child"`
78
-	Way                     int64                   `gorm:"column:way" json:"way"`
79
-	DrugId                  int64                   `gorm:"column:drug_id" json:"drug_id"`
80 78
 }
81 79
 
82 80
 func (DoctorAdviceTemplate) TableName() string {