1
This commit is contained in:
parent
bf108857d7
commit
2e4363a7d4
@ -81,3 +81,44 @@ func (r *DoctorWithdrawal) GetDoctorWithdrawal(c *gin.Context) {
|
|||||||
|
|
||||||
responses.OkWithData(res, c)
|
responses.OkWithData(res, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDoctorWithdrawalOrderPage 提现详情-关联订单列表-分页
|
||||||
|
func (r *DoctorWithdrawal) GetDoctorWithdrawalOrderPage(c *gin.Context) {
|
||||||
|
doctorWithdrawalRequest := requests.DoctorWithdrawalRequest{}
|
||||||
|
req := doctorWithdrawalRequest.GetDoctorWithdrawalPage
|
||||||
|
if err := c.ShouldBind(&req); err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 参数验证
|
||||||
|
if err := global.Validate.Struct(req); err != nil {
|
||||||
|
responses.FailWithMessage(utils.Translate(err), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.Page == 0 {
|
||||||
|
req.Page = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.PageSize == 0 {
|
||||||
|
req.PageSize = 20
|
||||||
|
}
|
||||||
|
|
||||||
|
doctorWithdrawalDao := dao.DoctorWithdrawalDao{}
|
||||||
|
doctorWithdrawal, total, err := doctorWithdrawalDao.GetDoctorWithdrawalPageSearch(req, req.Page, req.PageSize)
|
||||||
|
if err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理返回值
|
||||||
|
res := dto.GetDoctorWithdrawalListDto(doctorWithdrawal)
|
||||||
|
|
||||||
|
result := make(map[string]interface{})
|
||||||
|
result["page"] = req.Page
|
||||||
|
result["page_size"] = req.PageSize
|
||||||
|
result["total"] = total
|
||||||
|
result["data"] = res
|
||||||
|
responses.OkWithData(result, c)
|
||||||
|
}
|
||||||
|
|||||||
27
api/dao/doctorWithdrawalOrder.go
Normal file
27
api/dao/doctorWithdrawalOrder.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package dao
|
||||||
|
|
||||||
|
import (
|
||||||
|
"hospital-admin-api/api/model"
|
||||||
|
"hospital-admin-api/global"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DoctorWithdrawalOrderDao struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDoctorWithdrawalOrderById 获取医生提现关联订单数据-id
|
||||||
|
func (r *DoctorWithdrawalBankDao) GetDoctorWithdrawalOrderById(withdrawalBankId int64) (m *model.DoctorWithdrawalBank, err error) {
|
||||||
|
err = global.Db.First(&m, withdrawalBankId).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDoctorWithdrawalOrderByWithdrawalId 获取医生提现关联订单数据-提现id
|
||||||
|
func (r *DoctorWithdrawalBankDao) GetDoctorWithdrawalOrderByWithdrawalId(withdrawalId int64) (m *model.DoctorWithdrawalBank, err error) {
|
||||||
|
err = global.Db.Where("withdrawal_id = ?", withdrawalId).First(&m).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
@ -518,7 +518,7 @@ func privateRouter(r *gin.Engine, api controller.Api) {
|
|||||||
withdrawalGroup.GET("/:withdrawal_id", api.DoctorWithdrawal.GetDoctorWithdrawal)
|
withdrawalGroup.GET("/:withdrawal_id", api.DoctorWithdrawal.GetDoctorWithdrawal)
|
||||||
|
|
||||||
// 提现详情-关联订单列表-分页
|
// 提现详情-关联订单列表-分页
|
||||||
withdrawalGroup.GET("/order/:withdrawal_id", api.OrderPrescription.GetOrderPrescriptionPage)
|
withdrawalGroup.GET("/order/:withdrawal_id", api.DoctorWithdrawal.GetDoctorWithdrawalOrderPage)
|
||||||
|
|
||||||
// 修改提现个人所得税
|
// 修改提现个人所得税
|
||||||
withdrawalGroup.PUT("/income/:withdrawal_id", api.OrderPrescription.GetOrderPrescriptionPage)
|
withdrawalGroup.PUT("/income/:withdrawal_id", api.OrderPrescription.GetOrderPrescriptionPage)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user