This commit is contained in:
suyl
2021-05-12 11:23:42 +08:00
parent 9e550a16aa
commit 3d97d7d13d

View File

@@ -4226,14 +4226,16 @@ func QueryPageStores2(db *dao.DaoDB, pageSize, offset int, keyword string, vendo
db.Db = orm.NewOrmUsingDB("c4beta")
sqlJD := `
SELECT name, 0 vendor_id, wmpoiid vendor_store_id, orgcode org_code, 1 vendor_status, address, phone tel1, pj shop_score, month_sales_tip recent_order_num,
bak_info city_name
bak_info city_name, goods_number sku_count
FROM jingdong_showd
`
sqlEbai := `
`
sqlMT := `
SELECT name, 1 vendor_id, wmpoiid vendor_store_id, orgcode org_code, 1 vendor_status, address, phone tel1, pj shop_score, REPLACE(REPLACE(month_sales_tip,'月售',''),'+','') recent_order_num,
bak_info city_name, goods_number sku_count
FROM meituan_showd
`
sql := `
SELECT SQL_CALC_FOUND_ROWS
@@ -4241,10 +4243,9 @@ func QueryPageStores2(db *dao.DaoDB, pageSize, offset int, keyword string, vendo
FROM (
`
if vendorID == -1 {
sql += sqlJD
//+ ` UNION`
sql += sqlJD + ` UNION`
sql += sqlMT
//sql += sqlEbai + ` UNION`
//sql += sqlMT
} else {
switch vendorID {
case model.VendorIDJD:
@@ -4285,10 +4286,10 @@ func QueryPageStores2(db *dao.DaoDB, pageSize, offset int, keyword string, vendo
sql += " AND t1.recent_order_num >= ?"
sqlParams = append(sqlParams, minRecentOrderNum)
}
//if minSkuCount > 0 {
// sql += " AND t1.sku_count >= ?"
// sqlParams = append(sqlParams, minSkuCount)
//}
if minSkuCount > 0 {
sql += " AND t1.sku_count >= ?"
sqlParams = append(sqlParams, minSkuCount)
}
if keyword != "" {
keywordLike := "%" + keyword + "%"
sql += " AND (t1.name LIKE ? OR t1.tel1 LIKE ? OR t1.org_code LIKE ? OR t1.address LIKE ? OR t2.name LIKE ? "