查deal_sample表,加city
This commit is contained in:
+1
-1
@@ -6,5 +6,5 @@ import scala.math.Numeric;
|
||||
import java.util.List;
|
||||
|
||||
public interface DealSampleService {
|
||||
List<DealSample> querySampleByLocation(Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize);
|
||||
List<DealSample> querySampleByLocation(String city, Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize);
|
||||
}
|
||||
|
||||
+2
-1
@@ -27,7 +27,7 @@ public class DealSampleServiceImpl implements DealSampleService{
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DealSample> querySampleByLocation(Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize) {
|
||||
public List<DealSample> querySampleByLocation(String city, Double lng, Double lat, Number minPrice, Number maxPrice, String cat, int pageSize) {
|
||||
if(lng!=null && lat!=null){
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
BasicDBObject geo = new BasicDBObject();
|
||||
@@ -37,6 +37,7 @@ public class DealSampleServiceImpl implements DealSampleService{
|
||||
nearQuery.append("$maxDistance", 3000);
|
||||
geo.append("$near", nearQuery);
|
||||
|
||||
params.add(new QueryParam("city", city));
|
||||
params.add(new QueryParam("cat", cat));
|
||||
params.add(new QueryParam("location", geo));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user