- QueryPageStores添加orgCode参数
This commit is contained in:
@@ -11,7 +11,7 @@ type PageShopWithPlaceName struct {
|
||||
DistrictName string `json:"districtName"`
|
||||
}
|
||||
|
||||
func QueryPageStores(db *DaoDB, pageSize, offset int, keyword string, vendorStoreID string, vendorID int, cityCode, districtCode int, tel string, minShopScore float32, minRecentOrderNum, minSkuCount int) (pagedInfo *model.PagedInfo, err error) {
|
||||
func QueryPageStores(db *DaoDB, pageSize, offset int, keyword string, vendorStoreID string, vendorID int, orgCode string, cityCode, districtCode int, tel string, minShopScore float32, minRecentOrderNum, minSkuCount int) (pagedInfo *model.PagedInfo, err error) {
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
t1.*,
|
||||
@@ -31,6 +31,10 @@ func QueryPageStores(db *DaoDB, pageSize, offset int, keyword string, vendorStor
|
||||
sql += " AND t1.vendor_id = ?"
|
||||
sqlParams = append(sqlParams, vendorID)
|
||||
}
|
||||
if orgCode != "" {
|
||||
sql += " AND t1.org_code = ?"
|
||||
sqlParams = append(sqlParams, orgCode)
|
||||
}
|
||||
if cityCode != 0 {
|
||||
sql += " AND t1.city_code = ?"
|
||||
sqlParams = append(sqlParams, cityCode)
|
||||
|
||||
@@ -40,6 +40,7 @@ func (c *NetSpiderController) GetAndStoreCitiesShops() {
|
||||
// @Param keyword query string false "查询关键字(可以为空,为空表示不限制)"
|
||||
// @Param vendorStoreID query string false "门店号"
|
||||
// @Param vendorID query int false "平台ID"
|
||||
// @Param orgCode query string false "连锁品牌名"
|
||||
// @Param cityCode query int false "城市代码"
|
||||
// @Param districtCode query int false "行政区代码"
|
||||
// @Param tel query string false "手机号"
|
||||
@@ -54,7 +55,7 @@ func (c *NetSpiderController) QueryPageStores() {
|
||||
if params.MapData["vendorID"] == nil {
|
||||
params.VendorID = -1
|
||||
}
|
||||
retVal, err = dao.QueryPageStores(dao.GetDB(), params.PageSize, params.Offset, params.Keyword, params.VendorStoreID, params.VendorID, params.CityCode, params.DistrictCode, params.Tel, float32(params.MinShopScore), params.MinRecentOrderNum, params.MinSkuCount)
|
||||
retVal, err = dao.QueryPageStores(dao.GetDB(), params.PageSize, params.Offset, params.Keyword, params.VendorStoreID, params.VendorID, params.OrgCode, params.CityCode, params.DistrictCode, params.Tel, float32(params.MinShopScore), params.MinRecentOrderNum, params.MinSkuCount)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user