增加导出-提现记录
This commit is contained in:
+13
-12
@@ -163,9 +163,7 @@ func (r *DoctorWithdrawalDao) GetDoctorWithdrawalPageSearch(req requests.GetDoct
|
||||
}
|
||||
|
||||
// GetDoctorWithdrawalExportListSearch 获取医生提现列表-导出
|
||||
func (r *DoctorWithdrawalDao) GetDoctorWithdrawalExportListSearch(req requests.DoctorWithdrawalExportList, page, pageSize int) (m []*model.DoctorWithdrawal, total int64, err error) {
|
||||
var totalRecords int64
|
||||
|
||||
func (r *DoctorWithdrawalDao) GetDoctorWithdrawalExportListSearch(req requests.DoctorWithdrawalExportList) (m []*model.DoctorWithdrawal, err error) {
|
||||
// 构建查询条件
|
||||
query := global.Db.Model(&model.DoctorWithdrawal{})
|
||||
|
||||
@@ -174,6 +172,14 @@ func (r *DoctorWithdrawalDao) GetDoctorWithdrawalExportListSearch(req requests.D
|
||||
return db.Omit("open_id", "union_id", "wx_session_key")
|
||||
})
|
||||
|
||||
// 用户-医生
|
||||
query = query.Preload("UserDoctor.User", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Omit("user_password", "salt")
|
||||
})
|
||||
|
||||
// 医生详情
|
||||
query = query.Preload("UserDoctor.UserDoctorInfo")
|
||||
|
||||
// 提现关联银行卡
|
||||
query = query.Preload("DoctorWithdrawalBank")
|
||||
|
||||
@@ -249,7 +255,7 @@ func (r *DoctorWithdrawalDao) GetDoctorWithdrawalExportListSearch(req requests.D
|
||||
// 当前选择数据
|
||||
if req.Type == 2 {
|
||||
if req.Id == "" {
|
||||
return nil, 0, errors.New("未提供需导出数据编号")
|
||||
return nil, errors.New("未提供需导出数据编号")
|
||||
}
|
||||
|
||||
id := strings.Split(req.Id, ",")
|
||||
@@ -259,14 +265,9 @@ func (r *DoctorWithdrawalDao) GetDoctorWithdrawalExportListSearch(req requests.D
|
||||
// 排序
|
||||
query = query.Order("created_at desc")
|
||||
|
||||
// 查询总数量
|
||||
if err := query.Count(&totalRecords).Error; err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
err = query.Scopes(model.Paginate(page, pageSize)).Find(&m).Error
|
||||
err = query.Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
return nil, err
|
||||
}
|
||||
return m, totalRecords, nil
|
||||
return m, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user