- refactor order deliveryType
This commit is contained in:
@@ -157,7 +157,29 @@ func GetStoreMapByStoreID(db *DaoDB, storeID, vendorID int) (storeMap *model.Sto
|
||||
return storeMap, nil
|
||||
}
|
||||
|
||||
func GetStoreCouriersByStoreID(db *DaoDB, storeID, vendorID int) (storeMaps []*model.StoreMap, err error) {
|
||||
func FakeGetStoreMapByStoreID(db *DaoDB, storeID, vendorID int) (storeMap *model.StoreMap, err error) {
|
||||
vendorID2 := vendorID
|
||||
if vendorID == model.VendorIDWSC {
|
||||
vendorID2 = model.VendorIDJD // 微商城的属性以京东属性为准(以免再绑定)
|
||||
}
|
||||
if storeMap, err = GetStoreMapByStoreID(db, storeID, vendorID2); vendorID == model.VendorIDWSC && IsNoRowsError(err) {
|
||||
err = nil
|
||||
storeMap = &model.StoreMap{
|
||||
StoreID: storeID,
|
||||
VendorID: vendorID2,
|
||||
Status: model.StoreStatusOpened,
|
||||
PricePercentage: 100,
|
||||
AutoPickup: 1,
|
||||
DeliveryType: model.StoreDeliveryTypeByStore,
|
||||
// DeliveryFee
|
||||
DeliveryCompetition: 1,
|
||||
IsSync: 1,
|
||||
}
|
||||
}
|
||||
return storeMap, err
|
||||
}
|
||||
|
||||
func GetOpenedStoreCouriersByStoreID(db *DaoDB, storeID, vendorID int) (storeMaps []*model.StoreCourierMap, err error) {
|
||||
if db == nil {
|
||||
db = GetDB()
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
||||
FROM store t1
|
||||
JOIN place t2 ON t2.code = t1.city_code AND t2.name = ?
|
||||
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
||||
WHERE t1.status = ?
|
||||
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = '1970-01-01 00:00:00' AND t10.status <> ?) > 0
|
||||
`,
|
||||
`
|
||||
SELECT t1.*, t5.vendor_store_id
|
||||
@@ -62,13 +62,13 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
||||
JOIN place t2 ON t2.code = t1.city_code
|
||||
JOIN place t3 ON t3.code = t2.parent_code AND t3.name = ?
|
||||
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
||||
WHERE t1.status = ?
|
||||
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = '1970-01-01 00:00:00' AND t10.status <> ?) > 0
|
||||
`,
|
||||
`
|
||||
SELECT t1.*, t5.vendor_store_id
|
||||
FROM store t1
|
||||
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
||||
WHERE t1.status = ?
|
||||
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = '1970-01-01 00:00:00' AND t10.status <> ?) > 0
|
||||
`,
|
||||
}
|
||||
sqlParamsList := [][]interface{}{
|
||||
@@ -77,17 +77,20 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
||||
model.VendorIDWSC,
|
||||
utils.DefaultTimeValue,
|
||||
model.StoreStatusOpened,
|
||||
model.StoreStatusDisabled,
|
||||
},
|
||||
[]interface{}{
|
||||
provinceName,
|
||||
model.VendorIDWSC,
|
||||
utils.DefaultTimeValue,
|
||||
model.StoreStatusOpened,
|
||||
model.StoreStatusDisabled,
|
||||
},
|
||||
[]interface{}{
|
||||
model.VendorIDWSC,
|
||||
utils.DefaultTimeValue,
|
||||
model.StoreStatusOpened,
|
||||
model.StoreStatusDisabled,
|
||||
},
|
||||
}
|
||||
for k := range sqlList {
|
||||
|
||||
Reference in New Issue
Block a user