Merge pull request '修改活动商品列表' (#143) from hot_fix into master

Reviewed-on: #143
This commit is contained in:
mkm 2024-01-27 16:56:29 +08:00
commit 98fa70294c

View File

@ -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'];