2
This commit is contained in:
@@ -173,6 +173,20 @@ func (r *DoctorPharmacyDao) GetPharmacyDoctorListByPharmacyId(pharmacyId int64)
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetDefaultPharmacyDoctorListByPharmacyId 获取将该药房设为默认药房的医生列表
|
||||
func (r *DoctorPharmacyDao) GetDefaultPharmacyDoctorListByPharmacyId(pharmacyId int64) (m []*model.DoctorPharmacy, err error) {
|
||||
err = global.Db.Preload("UserDoctor").
|
||||
Preload("UserDoctor.User").
|
||||
Preload("UserDoctor.Hospital").
|
||||
Where("pharmacy_id = ? AND status = 1 AND is_default = 1", pharmacyId).
|
||||
Order("created_at desc").
|
||||
Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetDoctorPharmacyCountsByPharmacyId 获取药房绑定的医生数量(有效绑定数、设为默认药房数)
|
||||
func (r *DoctorPharmacyDao) GetDoctorPharmacyCountsByPharmacyId(pharmacyId int64) (totalCount int64, defaultCount int64, err error) {
|
||||
err = global.Db.Model(&model.DoctorPharmacy{}).
|
||||
|
||||
Reference in New Issue
Block a user