修改活动商品列表

This commit is contained in:
mkm 2024-01-27 16:55:55 +08:00
parent 4b4449fbe5
commit 98697a31eb

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