This commit is contained in:
邹宗楠
2023-03-02 15:13:41 +08:00
parent 1b6a94f541
commit 23d5cf212a

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"regexp"
"strconv"
"strings"
"time"
"git.rosy.net.cn/baseapi/utils"
@@ -1846,12 +1847,10 @@ func GetAddressRiderInfo(db *DaoDB, address string, randNumber int64) (*CourierI
param := []interface{}{time.Now().AddDate(-1, 0, 0), model.OrderStatusFinished, model.OrderDeliveryTypePlatform, "%" + fmt.Sprintf("%s", address) + "%", randNumber, 1}
courier := &CourierInfo{}
if err := GetRow(db, courier, sql, param); err != nil {
return nil, err
}
err := GetRow(db, courier, sql, param)
if courier.CourierName == "" || courier.CourierMobile == "" || len(courier.CourierMobile) != 11 {
info, err := GetAddressRiderInfo(db, address, randNumber+1)
if (err != nil && strings.Contains(err.Error(), "no row found")) || courier.CourierName == "" || courier.CourierMobile == "" || len(courier.CourierMobile) != 11 {
info, err := GetAddressRiderInfo(db, address, randNumber-1)
if err != nil {
return nil, err
}