This commit is contained in:
邹宗楠
2023-05-15 09:32:02 +08:00
parent 816b200db7
commit 1c9760b540
13 changed files with 74 additions and 24 deletions

View File

@@ -57,9 +57,10 @@ const (
VendorIDDDH5MicroApp = 311 // 钉钉H5微应用
VendorIDDDMobileQRCode = 312 // 钉钉移动接入应用(登录)
VendorIDAutonavi = 321 // 高德导航
VendorIDQiNiuCloud = 323 // 七牛云
VendorIDShowAPI = 325 // 万维易源
VendorIDAutonavi = 321 // 高德导航
VendorIDQiNiuCloud = 323 // 七牛云
VendorIDShowAPI = 325 // 万维易源
WayBillDeliveryMarkUp = 20 // 运单加价两毛钱
// 美团配送门店配送方式
MTWMStorePSWay1 = "1003" //美团跑腿(众包)

View File

@@ -41,6 +41,20 @@ func GetPlacesByCond(db *DaoDB, enableCond int) (placeList []*model.Place, err e
return placeList, err
}
// GetParentCodeByCode 根据城市code获取省份code
func GetParentCodeByCode(db *DaoDB, code int) (*model.Place, error) {
sql := `
SELECT p1.* FROM place p1
INNER JOIN place p2 On p1.code = p2.parent_code
WHERE p2.code = ? `
place := &model.Place{}
if err := GetRow(db, place, sql, []interface{}{code}...); err != nil {
return nil, err
}
return place, nil
}
func GetPlaceByName(db *DaoDB, name string, level int, parentCode int) (place *model.Place, err error) {
if db == nil {
db = GetDB()