瀏覽代碼

耗材参数

XMLWAN 4 年之前
父節點
當前提交
c8cf6ceda2
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 3 0
      controllers/data_api_controller.go
  2. 0 2
      models/doctor_advice_models.go

+ 3 - 0
controllers/data_api_controller.go 查看文件

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

+ 0 - 2
models/doctor_advice_models.go 查看文件

75
 	DrugId                  int64                   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
75
 	DrugId                  int64                   `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
76
 	Way                     int64                   `gorm:"column:way" json:"way" form:"way"`
76
 	Way                     int64                   `gorm:"column:way" json:"way" form:"way"`
77
 	SubDoctorAdviceTemplate []*DoctorAdviceTemplate `gorm:"ForeignKey:ParentId;AssociationForeignKey:ID" json:"child"`
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
 func (DoctorAdviceTemplate) TableName() string {
80
 func (DoctorAdviceTemplate) TableName() string {