This commit is contained in:
haomingming
2026-09-07 16:44:34 +08:00
parent 3205005b9a
commit b74a8aa898
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -152,7 +152,7 @@ func (r *DoctorPharmacy) UnbindDoctorPharmacy(c *gin.Context) {
pharmacyIdStr := c.Query("pharmacy_id")
if pharmacyIdStr != "" {
pharmacyId, err := strconv.ParseInt(pharmacyIdStr, 10, 64)
if err == nil && pharmacyId > 0 {
if err == nil && pharmacyId >= 0 {
_, err = doctorPharmacyService.UnbindDoctorPharmacy(id, pharmacyId)
if err != nil {
responses.FailWithMessage(err.Error(), c)
@@ -236,7 +236,7 @@ func (r *DoctorPharmacy) SetDefaultDoctorPharmacy(c *gin.Context) {
pharmacyIdStr := c.Query("pharmacy_id")
if pharmacyIdStr != "" {
pharmacyId, err := strconv.ParseInt(pharmacyIdStr, 10, 64)
if err == nil && pharmacyId > 0 {
if err == nil && pharmacyId >= 0 {
_, err = doctorPharmacyService.SetDefaultPharmacy(id, pharmacyId)
if err != nil {
responses.FailWithMessage(err.Error(), c)