From 98697a31eb09a3b00a3883d1c85fb8c57500cb8b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 27 Jan 2024 16:55:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/StoreActivityDao.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/common/dao/store/StoreActivityDao.php b/app/common/dao/store/StoreActivityDao.php index 3b6361fc..0c6b973e 100755 --- a/app/common/dao/store/StoreActivityDao.php +++ b/app/common/dao/store/StoreActivityDao.php @@ -55,8 +55,9 @@ class StoreActivityDao extends BaseDao */ public function product($userId, $location, $streetCode, $activityId) { + $limit = 5; [$lat, $lng] = (new CityAreaDao())->getLngAndLat($location, $streetCode); - $cloud_product_arr = (new CloudProductDao())->getByDistance($lat, $lng, ['activity_id' => $activityId], 5); + $cloud_product_arr = (new CloudProductDao())->getByDistance($lat, $lng, ['activity_id' => $activityId], $limit); $cloud_product = []; foreach ($cloud_product_arr as $key => $value) { $cloud_product[] = $value['product_id']; @@ -74,7 +75,7 @@ class StoreActivityDao extends BaseDao } /** @var SpuRepository $spuRep */ $spuRep = app()->make(SpuRepository::class); - $products = $spuRep->getApiSearch($where, 1, 4, false, true); + $products = $spuRep->getApiSearch($where, 1, $limit, false, true); $canBuy = 1; if ($products['list']) { $list = $products['list'];