This commit is contained in:
gazebo
2019-05-25 10:30:49 +08:00
parent 9aa074a595
commit 21e8ccc4e8

View File

@@ -132,7 +132,10 @@ func GetSkusCategories(db *DaoDB, vendorID, storeID int, skuIDs []int, level int
func GetStoreCategories(db *DaoDB, vendorID, storeID int, level int) (cats []*StoreCatSyncInfo, err error) {
fieldPrefix := ConvertDBFieldPrefix(model.VendorNames[vendorID])
sql := fmt.Sprintf(`
SELECT t5.*, t4.name cat_name, t4.seq, t4p.name parent_cat_name, t5p.category_id parent_cat_id, t5p.%s_id parent_vendor_cat_id, t5p.%s_sync_status parent_cat_sync_status
SELECT t5.*,
t4.name cat_name, t4.seq,
t4p.name parent_cat_name,
t5p.category_id parent_cat_id, t5p.%s_id parent_vendor_cat_id, t5p.%s_sync_status parent_cat_sync_status
FROM store_sku_category_map t5
JOIN sku_category t4 ON t5.category_id = t4.id AND t4.deleted_at = ?
LEFT JOIN sku_category t4p ON t4.parent_id = t4p.id