根据微盟更新京西价
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user