修改活动商品列表
This commit is contained in:
parent
4b4449fbe5
commit
98697a31eb
@ -55,8 +55,9 @@ class StoreActivityDao extends BaseDao
|
|||||||
*/
|
*/
|
||||||
public function product($userId, $location, $streetCode, $activityId)
|
public function product($userId, $location, $streetCode, $activityId)
|
||||||
{
|
{
|
||||||
|
$limit = 5;
|
||||||
[$lat, $lng] = (new CityAreaDao())->getLngAndLat($location, $streetCode);
|
[$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 = [];
|
$cloud_product = [];
|
||||||
foreach ($cloud_product_arr as $key => $value) {
|
foreach ($cloud_product_arr as $key => $value) {
|
||||||
$cloud_product[] = $value['product_id'];
|
$cloud_product[] = $value['product_id'];
|
||||||
@ -74,7 +75,7 @@ class StoreActivityDao extends BaseDao
|
|||||||
}
|
}
|
||||||
/** @var SpuRepository $spuRep */
|
/** @var SpuRepository $spuRep */
|
||||||
$spuRep = app()->make(SpuRepository::class);
|
$spuRep = app()->make(SpuRepository::class);
|
||||||
$products = $spuRep->getApiSearch($where, 1, 4, false, true);
|
$products = $spuRep->getApiSearch($where, 1, $limit, false, true);
|
||||||
$canBuy = 1;
|
$canBuy = 1;
|
||||||
if ($products['list']) {
|
if ($products['list']) {
|
||||||
$list = $products['list'];
|
$list = $products['list'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user