新增患者手机号
This commit is contained in:
parent
a05fd1d50d
commit
09b062aa5d
@ -38,7 +38,6 @@ func (r *OrderInquiry) GetOrderInquiryPage(c *gin.Context) {
|
||||
|
||||
orderInquiryDao := dao.OrderInquiryDao{}
|
||||
orderInquiry, total, err := orderInquiryDao.GetOrderInquiryPageSearch(req.GetOrderInquiryPage, req.GetOrderInquiryPage.Page, req.GetOrderInquiryPage.PageSize)
|
||||
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
|
||||
@ -96,6 +96,11 @@ func (r *OrderInquiryDao) GetOrderInquiryPageSearch(req requests.GetOrderInquiry
|
||||
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 {
|
||||
query = query.Where("inquiry_type = ?", req.InquiryType)
|
||||
|
||||
@ -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"`
|
||||
PatientAge int `gorm:"column:patient_age;type:int(1);comment:患者年龄-就诊人" json:"patient_age"`
|
||||
UserDoctor *UserDoctor `gorm:"foreignKey:DoctorId;references:doctor_id" json:"user_doctor"` // 医生
|
||||
User *User `gorm:"foreignKey:UserId;references:user_id" json:"user"` // 患者
|
||||
Model
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ type getOrderInquiryPage struct {
|
||||
PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码)
|
||||
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(0:未知 1:男 2:女)
|
||||
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
|
||||
PatientMobile string `json:"patient_mobile"` // 患者电话
|
||||
DoctorName string `json:"doctor_name"` // 医生姓名
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
@ -133,6 +134,7 @@ func GetOrderInquiryPageResponse(orderInquiry []*model.OrderInquiry) []getOrderI
|
||||
PatientNameMask: v.PatientNameMask,
|
||||
PatientSex: v.PatientSex,
|
||||
PatientAge: v.PatientAge,
|
||||
PatientMobile: v.User.Mobile,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user