- handle VendorIDEBAI.

This commit is contained in:
gazebo
2018-09-28 10:51:00 +08:00
parent 8ba9abc3a5
commit d81e8e1644
4 changed files with 24 additions and 14 deletions

View File

@@ -163,6 +163,7 @@ func (c *DeliveryHandler) CancelWaybill(bill *model.Waybill, cancelReasonID int,
func (c *DeliveryHandler) getDataCityCodeFromOrder(order *model.GoodsOrder, db orm.Ormer) (retVal string, err error) {
var sql string
storeID := utils.Str2Int64(order.VendorStoreID)
if order.VendorID == model.VendorIDJD {
sql = `
SELECT t2.tel_code
@@ -179,11 +180,18 @@ func (c *DeliveryHandler) getDataCityCodeFromOrder(order *model.GoodsOrder, db o
JOIN city t2 ON t1.area = t2.citycode
WHERE t0.elm_store_id = ?
`
} else {
panic(fmt.Sprintf("wrong vendorid:%d", order.VendorID))
} else { // todo 为什么不统一用jxstoreid来找
storeID = int64(jxutils.GetJxStoreIDFromOrder(order))
sql = `
SELECT t2.tel_code
FROM jxstore t1
JOIN city t2 ON t1.area = t2.citycode
WHERE t1.storeid = ?
`
}
var lists []orm.ParamsList
num, err := db.Raw(sql, utils.Str2Int64(order.VendorStoreID)).ValuesList(&lists)
num, err := db.Raw(sql, storeID).ValuesList(&lists)
if err == nil && num == 1 {
retVal = lists[0][0].(string)
} else {