新增患者手机号

This commit is contained in:
wucongxing 2023-09-12 09:32:29 +08:00
parent a05fd1d50d
commit 09b062aa5d
4 changed files with 8 additions and 1 deletions

View File

@ -38,7 +38,6 @@ func (r *OrderInquiry) GetOrderInquiryPage(c *gin.Context) {
orderInquiryDao := dao.OrderInquiryDao{} orderInquiryDao := dao.OrderInquiryDao{}
orderInquiry, total, err := orderInquiryDao.GetOrderInquiryPageSearch(req.GetOrderInquiryPage, req.GetOrderInquiryPage.Page, req.GetOrderInquiryPage.PageSize) orderInquiry, total, err := orderInquiryDao.GetOrderInquiryPageSearch(req.GetOrderInquiryPage, req.GetOrderInquiryPage.Page, req.GetOrderInquiryPage.PageSize)
if err != nil { if err != nil {
responses.FailWithMessage(err.Error(), c) responses.FailWithMessage(err.Error(), c)
return return

View File

@ -96,6 +96,11 @@ func (r *OrderInquiryDao) GetOrderInquiryPageSearch(req requests.GetOrderInquiry
query = query.Where(gorm.Expr("doctor_id IN (?)", subQuery)) query = query.Where(gorm.Expr("doctor_id IN (?)", subQuery))
} }
// 用户
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
return db.Select("user_id", "user_name", "mobile")
})
// 订单类型 // 订单类型
if req.InquiryType != nil { if req.InquiryType != nil {
query = query.Where("inquiry_type = ?", req.InquiryType) query = query.Where("inquiry_type = ?", req.InquiryType)

View File

@ -41,6 +41,7 @@ type OrderInquiry struct {
PatientSex int `gorm:"column:patient_sex;type:tinyint(1);default:0;comment:患者性别-就诊人0:未知 1:男 2:女)" json:"patient_sex"` PatientSex int `gorm:"column:patient_sex;type:tinyint(1);default:0;comment:患者性别-就诊人0:未知 1:男 2:女)" json:"patient_sex"`
PatientAge int `gorm:"column:patient_age;type:int(1);comment:患者年龄-就诊人" json:"patient_age"` PatientAge int `gorm:"column:patient_age;type:int(1);comment:患者年龄-就诊人" json:"patient_age"`
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生 UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
User *User `gorm:"foreignKey:UserId;references:user_id" json:"user"` // 患者
Model Model
} }

View File

@ -44,6 +44,7 @@ type getOrderInquiryPage struct {
PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码) PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码)
PatientSex int `json:"patient_sex"` // 患者性别-就诊人0:未知 1:男 2:女) PatientSex int `json:"patient_sex"` // 患者性别-就诊人0:未知 1:男 2:女)
PatientAge int `json:"patient_age"` // 患者年龄-就诊人 PatientAge int `json:"patient_age"` // 患者年龄-就诊人
PatientMobile string `json:"patient_mobile"` // 患者电话
DoctorName string `json:"doctor_name"` // 医生姓名 DoctorName string `json:"doctor_name"` // 医生姓名
CreatedAt model.LocalTime `json:"created_at"` // 创建时间 CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间 UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
@ -133,6 +134,7 @@ func GetOrderInquiryPageResponse(orderInquiry []*model.OrderInquiry) []getOrderI
PatientNameMask: v.PatientNameMask, PatientNameMask: v.PatientNameMask,
PatientSex: v.PatientSex, PatientSex: v.PatientSex,
PatientAge: v.PatientAge, PatientAge: v.PatientAge,
PatientMobile: v.User.Mobile,
CreatedAt: v.CreatedAt, CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt, UpdatedAt: v.UpdatedAt,
} }