|
|
@ -74,7 +74,9 @@ class ActivityService implements ActivityServiceInterface |
|
|
$redis = ApplicationContext::getContainer()->get(Redis::class); |
|
|
$redis = ApplicationContext::getContainer()->get(Redis::class); |
|
|
$activitySettings = $redis->hGetAll('activity_type_setting'); |
|
|
$activitySettings = $redis->hGetAll('activity_type_setting'); |
|
|
$activity['type'] = $type = $activitySettings['index_activity_type']; |
|
|
$activity['type'] = $type = $activitySettings['index_activity_type']; |
|
|
$activity['settings'] = json_decode($activitySettings[$activitySettings['index_activity_type']], true); |
|
|
|
|
|
|
|
|
$settingsStr = $activitySettings[$activity['type']] ?? ''; |
|
|
|
|
|
$activity['settings'] = json_decode($settingsStr, true); |
|
|
|
|
|
$activity['settings'] = !empty($activity['settings']) ? $activity['settings'] : (object)[]; |
|
|
|
|
|
|
|
|
$storeTable = ApplicationContext::getContainer()->get(Store::class)->getTable(); |
|
|
$storeTable = ApplicationContext::getContainer()->get(Store::class)->getTable(); |
|
|
$goodsTable = ApplicationContext::getContainer()->get(GoodsActivity::class)->getTable(); |
|
|
$goodsTable = ApplicationContext::getContainer()->get(GoodsActivity::class)->getTable(); |
|
|
@ -107,7 +109,7 @@ class ActivityService implements ActivityServiceInterface |
|
|
->orderBy(''.$goodsTable.'.expire_time', 'ASC') |
|
|
->orderBy(''.$goodsTable.'.expire_time', 'ASC') |
|
|
->orderBy(''.$goodsTable.'.created_at', 'DESC'); |
|
|
->orderBy(''.$goodsTable.'.created_at', 'DESC'); |
|
|
|
|
|
|
|
|
if (isset($activity['settings']['index_num_limit'])&&!empty($activity['settings']['index_num_limit'])) { |
|
|
|
|
|
|
|
|
if (is_array($activity['settings'])&&isset($activity['settings']['index_num_limit'])&&!empty($activity['settings']['index_num_limit'])) { |
|
|
$builder = $builder->limit($activity['settings']['index_num_limit']); |
|
|
$builder = $builder->limit($activity['settings']['index_num_limit']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|