Merge branch 'mark' of e.coding.net:rosydev/jx-callback into mark
This commit is contained in:
@@ -422,7 +422,7 @@ func GetOpenedStoreCouriersByStoreID(db *DaoDB, storeID, vendorID int) (storeMap
|
||||
return storeMaps, nil
|
||||
}
|
||||
|
||||
func GetStoreList(db *DaoDB, idList []int, mobileList []string, shortRoleName string) (storeList []*model.Store, err error) {
|
||||
func GetStoreList(db *DaoDB, idList, cityCodes, statuss []int, mobileList []string, shortRoleName string) (storeList []*model.Store, err error) {
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM store t1
|
||||
@@ -434,6 +434,14 @@ func GetStoreList(db *DaoDB, idList []int, mobileList []string, shortRoleName st
|
||||
sql += " AND t1.id IN (" + GenQuestionMarks(len(idList)) + ")"
|
||||
sqlParams = append(sqlParams, idList)
|
||||
}
|
||||
if len(cityCodes) > 0 {
|
||||
sql += " AND t1.city_code IN (" + GenQuestionMarks(len(cityCodes)) + ")"
|
||||
sqlParams = append(sqlParams, cityCodes)
|
||||
}
|
||||
if len(statuss) > 0 {
|
||||
sql += " AND t1.status IN (" + GenQuestionMarks(len(statuss)) + ")"
|
||||
sqlParams = append(sqlParams, statuss)
|
||||
}
|
||||
if len(mobileList) > 0 {
|
||||
sql += " AND (t1.tel1 IN (" + GenQuestionMarks(len(mobileList)) + ") OR t1.tel2 IN (" + GenQuestionMarks(len(mobileList)) + "))"
|
||||
sqlParams = append(sqlParams, mobileList, mobileList)
|
||||
@@ -566,7 +574,7 @@ func GetStorePriceScore(db *DaoDB, storeIDs, vendorIDs []int, fromScore, toScore
|
||||
|
||||
func GetStorePriceScoreSnapshot(db *DaoDB, snapDate time.Time) (storePriceScoreSnapshot []*model.StorePriceScoreSnapshot, err error) {
|
||||
sql := `
|
||||
SELECT c.store_id,ROUND(count(c.unit_price/IF(d.pay_percentage < 50 , 70, d.pay_percentage)*100 <= a.mid_unit_price or NULL)/count(*)*100,2) score
|
||||
SELECT c.store_id,ROUND(count(c.unit_price * IF(d.pay_percentage < 50 , 70, d.pay_percentage) / 100 <= a.mid_unit_price or NULL)/count(*)*100,2) score
|
||||
FROM price_refer_snapshot a
|
||||
JOIN store_sku_bind c ON c.sku_id = a.sku_id AND c.status = ? AND c.deleted_at = ?
|
||||
JOIN store d ON c.store_id = d.id AND d.city_code = a.city_code AND d.deleted_at = ? AND d.status != ?
|
||||
|
||||
@@ -1486,7 +1486,7 @@ func GetPriceReferPrice(db *DaoDB, cityCode int, skuID int, snapDate time.Time)
|
||||
|
||||
func GetStoreSkusAndSkuName(db *DaoDB, storeIDs, skuIDs, nameIDs []int) (storeSkuSyncInfo []*StoreSkuSyncInfo, err error) {
|
||||
sql := `
|
||||
SELECT a.id bind_id, a.store_id, a.jd_sync_status, a.mtwm_sync_status, a.ebai_sync_status, a.unit_price,
|
||||
SELECT a.id bind_id, a.store_id, a.jd_sync_status, a.mtwm_sync_status, a.ebai_sync_status, a.unit_price, a.price,
|
||||
c.id name_id, c.unit, b.*
|
||||
FROM store_sku_bind a
|
||||
JOIN sku b ON b.id = a.sku_id AND b.deleted_at = ?
|
||||
|
||||
Reference in New Issue
Block a user