- 适应快递API接口变更

This commit is contained in:
gazebo
2019-07-23 09:24:17 +08:00
parent 06c0929122
commit 3d4d539ab1
5 changed files with 120 additions and 35 deletions

View File

@@ -8,6 +8,7 @@ import (
"git.rosy.net.cn/jx-callback/business/model"
)
// 带购物平台信息的
type StoreDetail struct {
model.Store
@@ -29,12 +30,15 @@ type StoreDetail struct {
CityName string `json:"cityName"`
}
// 带快递门店信息的
type StoreDetail2 struct {
model.Store
VendorStoreID string `orm:"column(vendor_store_id)"` // 这个在GetMissingDadaStores返回中指的是到家的vendorStoreID
DadaStoreID string `orm:"column(dada_store_id)"`
DistrictName string
CityName string
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
CourierStoreName string
VendorStoreID string `orm:"column(vendor_store_id)"`
DistrictName string
CityName string
}
func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) {
@@ -86,7 +90,7 @@ func GetStoreDetailByVendorStoreID(db *DaoDB, vendorStoreID string, vendorID int
return getStoreDetail(db, 0, vendorID, vendorStoreID)
}
func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (storeList []*StoreDetail2, err error) {
func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (storeList []*StoreDetail, err error) {
sqlList := []string{
`
SELECT t1.*, t5.vendor_store_id
@@ -148,9 +152,8 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
func GetMissingDadaStores(db *DaoDB, storeID int, isMustHaveJdStore bool) (storeList []*StoreDetail2, err error) {
sql := `
SELECT t1.*,
t2.vendor_store_id vendor_store_id,
city.name city_name, district.name district_name,
t3.vendor_store_id dada_store_id
t3.vendor_store_id, t3.vendor_id
FROM store t1
LEFT JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND t2.deleted_at = ?
LEFT JOIN place city ON city.code = t1.city_code