From e931278bc1d2868d243928300abdb53d4c47f34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 30 Mar 2020 10:04:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6=E6=9F=A5=E8=AF=A2=E9=97=A8=E5=BA=97=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=A8=A1=E6=9D=BF=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 4eceff2d4..a0fe97b87 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2391,15 +2391,24 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi // 为了审核用 if len(storeList2) == 0 { + sql2 := ` + SELECT t1.*, + city.name city_name + FROM store t1 + JOIN place city ON city.code = t1.city_code + WHERE t1.deleted_at = ? AND t1.status <> ? AND id = ? + ORDER BY t1.id + ` sqlParams2 := []interface{}{ - model.VendorIDJX, utils.DefaultTimeValue, model.StoreStatusDisabled, + // model.VendorIDJX, utils.DefaultTimeValue, model.StoreStatusDisabled, utils.DefaultTimeValue, model.StoreStatusDisabled, - jxutils.StandardCoordinate2Int(0), - jxutils.StandardCoordinate2Int(10000), - jxutils.StandardCoordinate2Int(0), - jxutils.StandardCoordinate2Int(10000), - model.YES, + // jxutils.StandardCoordinate2Int(0), + // jxutils.StandardCoordinate2Int(10000), + // jxutils.StandardCoordinate2Int(0), + // jxutils.StandardCoordinate2Int(10000), + // model.YES, + 102919, //商城模板店 } dao.GetRows(dao.GetDB(), &storeList2, sql, sqlParams2...) if len(storeList2) > 1 { From 58a044b60a932aaa553e54b122ae427c499600f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 30 Mar 2020 10:06:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6=E6=9F=A5=E8=AF=A2=E9=97=A8=E5=BA=97=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=A8=A1=E6=9D=BF=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index a0fe97b87..e5b2963f2 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2410,7 +2410,7 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi // model.YES, 102919, //商城模板店 } - dao.GetRows(dao.GetDB(), &storeList2, sql, sqlParams2...) + dao.GetRows(dao.GetDB(), &storeList2, sql2, sqlParams2...) if len(storeList2) > 1 { storeList2 = storeList2[:1] } From 5d13017af2fa688d764ca466ae5212abfda47517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 30 Mar 2020 10:11:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6=E6=9F=A5=E8=AF=A2=E9=97=A8=E5=BA=97=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=A8=A1=E6=9D=BF=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index e5b2963f2..343f5bb8f 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2396,8 +2396,7 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi city.name city_name FROM store t1 JOIN place city ON city.code = t1.city_code - WHERE t1.deleted_at = ? AND t1.status <> ? AND id = ? - ORDER BY t1.id + WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.id = ? ` sqlParams2 := []interface{}{ // model.VendorIDJX, utils.DefaultTimeValue, model.StoreStatusDisabled, @@ -2411,9 +2410,9 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi 102919, //商城模板店 } dao.GetRows(dao.GetDB(), &storeList2, sql2, sqlParams2...) - if len(storeList2) > 1 { - storeList2 = storeList2[:1] - } + // if len(storeList2) > 1 { + // storeList2 = storeList2[:1] + // } } // 如果要求以步行距离来算