新增创建时间搜索条件

This commit is contained in:
wucongxing 2023-09-14 16:50:47 +08:00
parent 3113f2471b
commit 8405facf96
6 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,3 @@
package controller
type UserPatient struct{}

View File

@ -196,6 +196,16 @@ func (r *OrderInquiryDao) GetOrderInquiryPageSearch(req requests.GetOrderInquiry
}
}
// 创建时间
if req.CreatedAt != "" {
createdAt := strings.Split(req.CreatedAt, "&")
if len(createdAt) == 2 {
startTime, _ := time.Parse("2006-01-02", createdAt[0])
endTime, _ := time.Parse("2006-01-02", createdAt[1])
query = query.Where("created_at BETWEEN ? AND ?", startTime, endTime)
}
}
// 患者姓名-就诊人
if req.PatientName != "" {
query = query.Where("patient_name LIKE ?", "%"+req.PatientName+"%")

View File

@ -215,6 +215,16 @@ func (r *OrderProductDao) GetOrderProductPageSearch(req requests.GetOrderProduct
}
}
// 创建时间
if req.CreatedAt != "" {
createdAt := strings.Split(req.CreatedAt, "&")
if len(createdAt) == 2 {
startTime, _ := time.Parse("2006-01-02", createdAt[0])
endTime, _ := time.Parse("2006-01-02", createdAt[1])
query = query.Where("created_at BETWEEN ? AND ?", startTime, endTime)
}
}
// 收货人姓名
if req.ConsigneeName != "" {
query = query.Where("consignee_name LIKE ?", "%"+req.ConsigneeName+"%")

View File

@ -24,6 +24,7 @@ type GetOrderInquiryPage struct {
FinishTime string `json:"finish_time" form:"finish_time" label:"订单结束时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
IsWithdrawal *int `json:"is_withdrawal" form:"is_withdrawal" label:"是否提现"` // 0:否 1:是 2:提现中
CancelTime string `json:"cancel_time" form:"cancel_time" label:"订单取消时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
CreatedAt string `json:"created_at" form:"created_at" label:"订单创建时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
PatientName string `json:"patient_name" form:"patient_name" label:"患者姓名-就诊人"`
Mobile string `json:"mobile" form:"mobile" label:"手机号-医生/患者"`
}

View File

@ -25,6 +25,7 @@ type GetOrderProductPage struct {
CancelTime string `json:"cancel_time" form:"cancel_time" label:"订单取消时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
PayTime string `json:"pay_time" form:"pay_time" label:"支付时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
ReportPreTime string `json:"report_pre_time" form:"report_pre_time" label:"上报处方平台时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
CreatedAt string `json:"created_at" form:"created_at" label:"订单创建时间"` // 时间区间数组形式下标0为开始时间下标1为结束时间
ConsigneeName string `json:"consignee_name" form:"consignee_name" label:"收货人姓名"`
ConsigneeTel string `json:"consignee_tel" form:"cancel_reason" label:"收货人电话"`
PatientName string `json:"patient_name" form:"patient_name" label:"患者姓名-就诊人"`

View File

@ -374,7 +374,7 @@ func privateRouter(r *gin.Engine, api controller.Api) {
inquiryGroup.PUT("/cancel/:order_inquiry_id", api.OrderInquiry.CancelOrderInquiry)
}
// 问诊订单
// 药品订单
productGroup := orderGroup.Group("/product")
{
// 获取药品订单列表-分页
@ -396,4 +396,33 @@ func privateRouter(r *gin.Engine, api controller.Api) {
// 上报监管平台
}
}
// 患者管理
patientGroup := adminGroup.Group("/patient")
{
// 获取患者列表-分页
patientGroup.GET("", api.UserDoctor.GetUserDoctorPage)
// 患者详情
patientGroup.GET("/:patient_id", api.UserDoctor.GetUserDoctor)
// 修改患者状态
patientGroup.PUT("/status/:patient_id", api.UserDoctor.GetUserDoctor)
// 就诊人管理
patientFamilyGroup := doctorGroup.Group("/family")
{
// 获取就诊人列表-分页
patientFamilyGroup.GET("", api.UserDoctor.GetUserDoctorPendingPage)
// 就诊人详情
patientFamilyGroup.GET("/:family_id", api.UserDoctor.GetUserDoctorPending)
// 删除就诊人
patientFamilyGroup.DELETE("/:family_id", api.UserDoctor.PutUserDoctorPending)
// 修改就诊人状态
patientFamilyGroup.DELETE("/status/:family_id", api.UserDoctor.PutUserDoctorPending)
}
}
}