根据微盟更新京西价

This commit is contained in:
苏尹岚
2019-11-26 17:07:52 +08:00
parent fd8b6c957f
commit 80c5560faf
2 changed files with 150 additions and 22 deletions

View File

@@ -640,3 +640,24 @@ func UpdateStoreSkuBindSyncStatus(db *DaoDB, vendorIDs []int, storeID int) (num
}
return ExecuteSQL(db, sql, sqlParams...)
}
func GetStoreSkusByNameIDs(db *DaoDB, storeIDs []int, nameID int) (skuList []*StoreSkuSyncInfo, err error) {
sql := `
SELECT a.*,c.unit,c.name
FROM store_sku_bind a
JOIN sku b ON a.sku_id = b.id
JOIN sku_name c ON b.name_id = c.id
WHERE b.name_id = ?
`
sqlParams := []interface{}{
nameID,
}
if len(storeIDs) > 0 {
sql += " AND a.store_id in (" + GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
}
sql += " AND a.status != ?"
sqlParams = append(sqlParams, model.SkuStatusDeleted)
err = GetRows(db, &skuList, sql, sqlParams...)
return skuList, err
}