- QueryPageStores添加orgCode参数

This commit is contained in:
gazebo
2019-06-25 14:45:15 +08:00
parent 113f376ee3
commit 8f7c6f13ea
2 changed files with 7 additions and 2 deletions

View File

@@ -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)