613 lines
16 KiB
Go
613 lines
16 KiB
Go
package dao
|
|
|
|
import (
|
|
"errors"
|
|
"gorm.io/gorm"
|
|
"gorm.io/gorm/clause"
|
|
"hospital-admin-api/api/model"
|
|
"hospital-admin-api/api/requests"
|
|
"hospital-admin-api/global"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
type UserDoctorDao struct {
|
|
}
|
|
|
|
// GetUserDoctorById 获取医生数据-医生id
|
|
func (r *UserDoctorDao) GetUserDoctorById(doctorId int64) (m *model.UserDoctor, err error) {
|
|
err = global.Db.First(&m, doctorId).Error
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// GetUserDoctorByUserId 获取医生数据-用户id
|
|
func (r *UserDoctorDao) GetUserDoctorByUserId(userId int64) (m *model.UserDoctor, err error) {
|
|
err = global.Db.Where("user_id = ?", userId).First(&m).Error
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// GetUserDoctorPreloadById 获取医生数据-加载全部关联-医生id
|
|
func (r *UserDoctorDao) GetUserDoctorPreloadById(doctorId int64) (m *model.UserDoctor, err error) {
|
|
err = global.Db.Preload(clause.Associations).First(&m, doctorId).Error
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// DeleteUserDoctor 删除医生
|
|
func (r *UserDoctorDao) DeleteUserDoctor(tx *gorm.DB, maps interface{}) error {
|
|
err := tx.Where(maps).Delete(&model.UserDoctor{}).Error
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// DeleteUserDoctorById 删除医生-医生id
|
|
func (r *UserDoctorDao) DeleteUserDoctorById(tx *gorm.DB, userId int64) error {
|
|
if err := tx.Delete(&model.UserDoctor{}, userId).Error; err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// EditUserDoctor 修改医生
|
|
func (r *UserDoctorDao) EditUserDoctor(tx *gorm.DB, maps interface{}, data interface{}) error {
|
|
err := tx.Model(&model.UserDoctor{}).Where(maps).Updates(data).Error
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// EditUserDoctorById 修改医生-医生id
|
|
func (r *UserDoctorDao) EditUserDoctorById(tx *gorm.DB, doctorId int64, data interface{}) error {
|
|
err := tx.Model(&model.UserDoctor{}).Where("doctor_id = ?", doctorId).Updates(data).Error
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// GetUserDoctorList 获取医生列表
|
|
func (r *UserDoctorDao) GetUserDoctorList(maps interface{}) (m []*model.UserDoctor, err error) {
|
|
err = global.Db.Where(maps).Find(&m).Error
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// GetUserDoctorPageSearch 获取医生列表-分页
|
|
func (r *UserDoctorDao) GetUserDoctorPageSearch(req requests.GetUserDoctorPage, page, pageSize int) (m []*model.UserDoctor, total int64, err error) {
|
|
var totalRecords int64
|
|
|
|
// 构建查询条件
|
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
|
|
|
// 用户
|
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
|
return db.Omit("user_password", "salt")
|
|
})
|
|
|
|
// 医院
|
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
|
return db.Select("hospital_id,hospital_name,hospital_level_name")
|
|
})
|
|
|
|
// 医生问诊配置
|
|
query = query.Preload("DoctorInquiryConfig")
|
|
|
|
// 医生问诊配置
|
|
if req.InquiryService != "" {
|
|
result := strings.Split(req.InquiryService, ",")
|
|
if len(result) > 0 {
|
|
subQuery := global.Db.Model(&model.DoctorInquiryConfig{}).
|
|
Where("gdxz_doctor_inquiry_config.doctor_id = gdxz_user_doctor.doctor_id").
|
|
Where("gdxz_doctor_inquiry_config.inquiry_type IN (?)", req.InquiryService).
|
|
Where("gdxz_doctor_inquiry_config.inquiry_mode = ?", 1).
|
|
Where("gdxz_doctor_inquiry_config.is_enable = ?", 1).Select("1")
|
|
|
|
query = query.Where("EXISTS (?)", subQuery)
|
|
}
|
|
}
|
|
|
|
// 手机号
|
|
if req.Mobile != "" {
|
|
subQuery := global.Db.Model(&model.User{}).
|
|
Select("user_id").
|
|
Where("mobile LIKE ?", "%"+req.Mobile+"%")
|
|
|
|
query = query.Where(gorm.Expr("user_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 用户名称
|
|
if req.UserName != "" {
|
|
query = query.Where("user_name LIKE ?", "%"+req.UserName+"%")
|
|
}
|
|
|
|
// 状态
|
|
if req.UserStatus != nil {
|
|
query = query.Where("status = ?", req.UserStatus)
|
|
}
|
|
|
|
// 医院名称
|
|
if req.HospitalName != "" {
|
|
subQuery := global.Db.Model(&model.Hospital{}).
|
|
Select("hospital_id").
|
|
Where("hospital_name LIKE ?", "%"+req.HospitalName+"%")
|
|
|
|
query = query.Where(gorm.Expr("hospital_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 科室名称
|
|
if req.DepartmentCustomName != "" {
|
|
query = query.Where("department_custom_name = ?", req.DepartmentCustomName)
|
|
}
|
|
|
|
// 实名认证状态
|
|
if req.IDCardStatus != nil {
|
|
query = query.Where("idcard_status = ?", req.IDCardStatus)
|
|
}
|
|
|
|
// 身份认证状态
|
|
if req.IdenAuthStatus != nil {
|
|
query = query.Where("iden_auth_status = ?", req.IdenAuthStatus)
|
|
}
|
|
|
|
// 医生多点执业认证状态
|
|
if req.MultiPointStatus != nil {
|
|
query = query.Where("multi_point_status = ?", req.MultiPointStatus)
|
|
}
|
|
|
|
// 是否首页推荐
|
|
if req.IsRecommend != nil {
|
|
query = query.Where("is_recommend = ?", req.IsRecommend)
|
|
}
|
|
|
|
if req.DoctorTitle != nil {
|
|
query = query.Where("doctor_title = ?", req.DoctorTitle)
|
|
}
|
|
|
|
// 注册时间
|
|
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])
|
|
|
|
if startTime == endTime {
|
|
endTime = endTime.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
|
|
}
|
|
|
|
query = query.Where("created_at BETWEEN ? AND ?", startTime, endTime)
|
|
}
|
|
}
|
|
|
|
// 排序
|
|
query = query.Order("created_at desc")
|
|
|
|
if req.IsEnterpriseDeepCooperation != nil {
|
|
query = query.Where("is_enterprise_deep_cooperation = ?", req.IsEnterpriseDeepCooperation)
|
|
}
|
|
|
|
if req.IsPlatformDeepCooperation != nil {
|
|
query = query.Where("is_platform_deep_cooperation = ?", req.IsPlatformDeepCooperation)
|
|
}
|
|
|
|
if req.IsSysDiagnoCooperation != nil {
|
|
query = query.Where("is_sys_diagno_cooperation = ?", req.IsSysDiagnoCooperation)
|
|
}
|
|
|
|
// 查询总数量
|
|
if err := query.Count(&totalRecords).Error; err != nil {
|
|
return nil, 0, err
|
|
}
|
|
|
|
err = query.Scopes(model.Paginate(page, pageSize)).Find(&m).Error
|
|
if err != nil {
|
|
return nil, 0, err
|
|
}
|
|
return m, totalRecords, nil
|
|
}
|
|
|
|
// AddUserDoctor 新增医生
|
|
func (r *UserDoctorDao) AddUserDoctor(tx *gorm.DB, model *model.UserDoctor) (*model.UserDoctor, error) {
|
|
if err := tx.Create(model).Error; err != nil {
|
|
return nil, err
|
|
}
|
|
return model, nil
|
|
}
|
|
|
|
// GetUserDoctorPendingPageSearch 身份审核-获取医生列表-分页
|
|
func (r *UserDoctorDao) GetUserDoctorPendingPageSearch(p requests.GetUserDoctorPendingPage, page, pageSize int) (m []*model.UserDoctor, total int64, err error) {
|
|
var totalRecords int64
|
|
|
|
// 构建查询条件
|
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
|
|
|
// 用户
|
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
|
return db.Omit("user_password", "salt")
|
|
})
|
|
|
|
// 医院
|
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
|
return db.Select("hospital_id,hospital_name,hospital_level_name")
|
|
})
|
|
|
|
// 手机号
|
|
if p.Mobile != "" {
|
|
subQuery := global.Db.Model(&model.User{}).
|
|
Select("user_id").
|
|
Where("mobile LIKE ?", "%"+p.Mobile+"%")
|
|
|
|
query = query.Where(gorm.Expr("user_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 用户名称
|
|
if p.UserName != "" {
|
|
query = query.Where("user_name LIKE ?", "%"+p.UserName+"%")
|
|
}
|
|
|
|
// 身份认证状态
|
|
if p.IdenAuthStatus != nil {
|
|
query = query.Where("iden_auth_status = ?", p.IdenAuthStatus)
|
|
} else {
|
|
query = query.Where("iden_auth_status IN ?", []string{"2"})
|
|
}
|
|
|
|
// 医院名称
|
|
if p.HospitalName != "" {
|
|
subQuery := global.Db.Model(&model.Hospital{}).
|
|
Select("hospital_id").
|
|
Where("hospital_name LIKE ?", "%"+p.HospitalName+"%")
|
|
|
|
query = query.Where(gorm.Expr("hospital_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 排序
|
|
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
|
|
if err != nil {
|
|
return nil, 0, err
|
|
}
|
|
return m, totalRecords, nil
|
|
}
|
|
|
|
// GetUserDoctorMultiPageSearch 多点-获取医生列表-分页
|
|
func (r *UserDoctorDao) GetUserDoctorMultiPageSearch(p requests.GetMultiPage, page, pageSize int) (m []*model.UserDoctor, total int64, err error) {
|
|
var totalRecords int64
|
|
|
|
// 构建查询条件
|
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
|
|
|
// 用户
|
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
|
return db.Omit("user_password", "salt")
|
|
})
|
|
|
|
// 医院
|
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
|
return db.Select("hospital_id,hospital_name,hospital_level_name")
|
|
})
|
|
|
|
// 手机号
|
|
if p.Mobile != "" {
|
|
subQuery := global.Db.Model(&model.User{}).
|
|
Select("user_id").
|
|
Where("mobile LIKE ?", "%"+p.Mobile+"%")
|
|
|
|
query = query.Where(gorm.Expr("user_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 用户名称
|
|
if p.UserName != "" {
|
|
query = query.Where("user_name LIKE ?", "%"+p.UserName+"%")
|
|
}
|
|
|
|
// 身份认证状态
|
|
if p.MultiPointStatus != nil {
|
|
query = query.Where("multi_point_status = ?", p.MultiPointStatus)
|
|
} else {
|
|
query = query.Where("multi_point_status IN ?", []string{"2"})
|
|
}
|
|
|
|
// 医院名称
|
|
if p.HospitalName != "" {
|
|
subQuery := global.Db.Model(&model.Hospital{}).
|
|
Select("hospital_id").
|
|
Where("hospital_name LIKE ?", "%"+p.HospitalName+"%")
|
|
|
|
query = query.Where(gorm.Expr("hospital_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 排序
|
|
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
|
|
if err != nil {
|
|
return nil, 0, err
|
|
}
|
|
return m, totalRecords, nil
|
|
}
|
|
|
|
// GetUserDoctorListSearch 获取医生列表
|
|
func (r *UserDoctorDao) GetUserDoctorListSearch(req requests.GetUserDoctorList) (m []*model.UserDoctor, err error) {
|
|
|
|
// 构建查询条件
|
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
|
|
|
// 用户
|
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
|
return db.Omit("user_password", "salt")
|
|
})
|
|
|
|
// 医院
|
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
|
return db.Select("hospital_id,hospital_name,hospital_level_name")
|
|
})
|
|
|
|
// 医生id
|
|
if req.DoctorId != "" {
|
|
query = query.Where("doctor_id = ?", req.DoctorId)
|
|
}
|
|
|
|
// 用户名称
|
|
if req.UserName != "" {
|
|
query = query.Where("user_name LIKE ?", "%"+req.UserName+"%")
|
|
}
|
|
|
|
// 实名认证状态
|
|
if req.IDCardStatus != nil {
|
|
query = query.Where("idcard_status = ?", req.IDCardStatus)
|
|
}
|
|
|
|
// 身份认证状态
|
|
if req.IdenAuthStatus != nil {
|
|
query = query.Where("iden_auth_status = ?", req.IdenAuthStatus)
|
|
}
|
|
|
|
// 医生多点执业认证状态
|
|
if req.MultiPointStatus != nil {
|
|
query = query.Where("multi_point_status = ?", req.MultiPointStatus)
|
|
}
|
|
|
|
// 是否已绑定结算银行卡
|
|
if req.IsBindBank != nil {
|
|
query = query.Where("is_bind_bank = ?", req.IsBindBank)
|
|
}
|
|
|
|
// 医生问诊配置
|
|
if req.UnInquiryType != "" {
|
|
result := strings.Split(req.UnInquiryType, ",")
|
|
if len(result) > 0 {
|
|
subQuery := global.Db.Model(&model.DoctorInquiryConfig{}).
|
|
Where("gdxz_doctor_inquiry_config.doctor_id = gdxz_user_doctor.doctor_id").
|
|
Where("gdxz_doctor_inquiry_config.inquiry_type NOT IN (?)", req.UnInquiryType).
|
|
Where("gdxz_doctor_inquiry_config.inquiry_mode = ?", req.InquiryMode)
|
|
|
|
query = query.Where("EXISTS (?)", subQuery)
|
|
}
|
|
}
|
|
|
|
// 排序
|
|
query = query.Order("created_at desc")
|
|
|
|
err = query.Scopes(model.Paginate(1, 10)).Find(&m).Error
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// GetUserDoctorExportListSearch 医生列表-导出
|
|
func (r *UserDoctorDao) GetUserDoctorExportListSearch(req requests.UserDoctorExportList) (m []*model.UserDoctor, err error) {
|
|
// 构建查询条件
|
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
|
|
|
// 用户
|
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
|
return db.Omit("user_password", "salt")
|
|
})
|
|
|
|
// 医生详情
|
|
query = query.Preload("UserDoctorInfo")
|
|
|
|
// 医院
|
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
|
return db.Select("hospital_id,hospital_name,hospital_level_name")
|
|
})
|
|
|
|
// 医生问诊配置
|
|
query = query.Preload("DoctorInquiryConfig")
|
|
|
|
// 当前搜索数据
|
|
if req.Type == 1 {
|
|
// 医生问诊配置
|
|
if req.InquiryService != "" {
|
|
result := strings.Split(req.InquiryService, ",")
|
|
if len(result) > 0 {
|
|
subQuery := global.Db.Model(&model.DoctorInquiryConfig{}).
|
|
Where("gdxz_doctor_inquiry_config.doctor_id = gdxz_user_doctor.doctor_id").
|
|
Where("gdxz_doctor_inquiry_config.inquiry_type IN (?)", req.InquiryService).
|
|
Where("gdxz_doctor_inquiry_config.inquiry_mode = ?", 1).
|
|
Where("gdxz_doctor_inquiry_config.is_enable = ?", 1).Select("1")
|
|
|
|
query = query.Where("EXISTS (?)", subQuery)
|
|
}
|
|
}
|
|
|
|
// 手机号
|
|
if req.Mobile != "" {
|
|
subQuery := global.Db.Model(&model.User{}).
|
|
Select("user_id").
|
|
Where("mobile LIKE ?", "%"+req.Mobile+"%")
|
|
|
|
query = query.Where(gorm.Expr("user_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 用户名称
|
|
if req.UserName != "" {
|
|
query = query.Where("user_name LIKE ?", "%"+req.UserName+"%")
|
|
}
|
|
|
|
// 状态
|
|
if req.UserStatus != nil {
|
|
query = query.Where("status = ?", req.UserStatus)
|
|
}
|
|
|
|
// 医院名称
|
|
if req.HospitalName != "" {
|
|
subQuery := global.Db.Model(&model.Hospital{}).
|
|
Select("hospital_id").
|
|
Where("hospital_name LIKE ?", "%"+req.HospitalName+"%")
|
|
|
|
query = query.Where(gorm.Expr("hospital_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 科室名称
|
|
if req.DepartmentCustomName != "" {
|
|
query = query.Where("department_custom_name = ?", req.DepartmentCustomName)
|
|
}
|
|
|
|
// 实名认证状态
|
|
if req.IDCardStatus != nil {
|
|
query = query.Where("idcard_status = ?", req.IDCardStatus)
|
|
}
|
|
|
|
// 身份认证状态
|
|
if req.IdenAuthStatus != nil {
|
|
query = query.Where("iden_auth_status = ?", req.IdenAuthStatus)
|
|
}
|
|
|
|
// 医生多点执业认证状态
|
|
if req.MultiPointStatus != nil {
|
|
query = query.Where("multi_point_status = ?", req.MultiPointStatus)
|
|
}
|
|
|
|
// 是否首页推荐
|
|
if req.IsRecommend != nil {
|
|
query = query.Where("is_recommend = ?", req.IsRecommend)
|
|
}
|
|
|
|
if req.DoctorTitle != nil {
|
|
query = query.Where("doctor_title = ?", req.DoctorTitle)
|
|
}
|
|
|
|
// 注册时间
|
|
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])
|
|
|
|
if startTime == endTime {
|
|
endTime = endTime.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
|
|
}
|
|
|
|
query = query.Where("created_at BETWEEN ? AND ?", startTime, endTime)
|
|
}
|
|
}
|
|
}
|
|
|
|
// 当前选择数据
|
|
if req.Type == 2 {
|
|
if req.Id == "" {
|
|
return nil, errors.New("未提供需导出数据编号")
|
|
}
|
|
|
|
id := strings.Split(req.Id, ",")
|
|
query = query.Where("doctor_id IN (?)", id)
|
|
}
|
|
|
|
// 排序
|
|
query = query.Order("created_at desc")
|
|
|
|
if req.IsEnterpriseDeepCooperation != nil {
|
|
query = query.Where("is_enterprise_deep_cooperation = ?", req.IsEnterpriseDeepCooperation)
|
|
}
|
|
|
|
if req.IsPlatformDeepCooperation != nil {
|
|
query = query.Where("is_platform_deep_cooperation = ?", req.IsPlatformDeepCooperation)
|
|
}
|
|
|
|
if req.IsSysDiagnoCooperation != nil {
|
|
query = query.Where("is_sys_diagno_cooperation = ?", req.IsSysDiagnoCooperation)
|
|
}
|
|
|
|
err = query.Find(&m).Error
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// GetDoctorIntroductionPageSearch 简介审核-获取医生列表-分页
|
|
func (r *UserDoctorDao) GetDoctorIntroductionPageSearch(req requests.GetDoctorIntroductionPage, page, pageSize int) (m []*model.UserDoctor, total int64, err error) {
|
|
var totalRecords int64
|
|
|
|
// 构建查询条件
|
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
|
|
|
// 用户
|
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
|
return db.Omit("user_password", "salt")
|
|
})
|
|
|
|
// 医院
|
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
|
return db.Select("hospital_id,hospital_name,hospital_level_name")
|
|
})
|
|
|
|
// 手机号
|
|
if req.Mobile != "" {
|
|
subQuery := global.Db.Model(&model.User{}).
|
|
Select("user_id").
|
|
Where("mobile LIKE ?", "%"+req.Mobile+"%")
|
|
|
|
query = query.Where(gorm.Expr("user_id IN (?)", subQuery))
|
|
}
|
|
|
|
// 用户名称
|
|
if req.UserName != "" {
|
|
query = query.Where("user_name LIKE ?", "%"+req.UserName+"%")
|
|
}
|
|
|
|
// 个人简介审核状态
|
|
if req.IntroductionStatus == nil {
|
|
query = query.Where("introduction_status in (?)", []string{"2"})
|
|
} else {
|
|
query = query.Where("introduction_status = ?", req.IntroductionStatus)
|
|
}
|
|
|
|
// 查询总数量
|
|
if err := query.Count(&totalRecords).Error; err != nil {
|
|
return nil, 0, err
|
|
}
|
|
|
|
err = query.Scopes(model.Paginate(page, pageSize)).Find(&m).Error
|
|
if err != nil {
|
|
return nil, 0, err
|
|
}
|
|
return m, totalRecords, nil
|
|
}
|