Merge remote-tracking branch 'origin/mark' into don

This commit is contained in:
Rosy-zhudan
2019-09-29 18:33:38 +08:00
6 changed files with 151 additions and 118 deletions

View File

@@ -59,7 +59,7 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (sto
district.name district_name,
city.name city_name
FROM store t1
JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND t2.deleted_at = ?
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
LEFT JOIN place district ON district.code = t1.district_code
LEFT JOIN new_config t3 ON t3.key = t2.price_percentage_pack AND t3.type = ? AND t3.deleted_at = ?
@@ -72,6 +72,9 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (sto
utils.DefaultTimeValue,
utils.DefaultTimeValue,
}
if vendorID != model.VendorIDJX {
sql += " AND t2.id IS NOT NULL"
}
if storeID > 0 {
sql += " AND t1.id = ?"
sqlParams = append(sqlParams, storeID)