weigang 5 years ago
parent
commit
3ad4869af0
  1. 1
      app/Controller/v3/HomeController.php
  2. 2
      app/Service/v3/Implementations/BannerService.php

1
app/Controller/v3/HomeController.php

@ -120,7 +120,6 @@ class HomeController extends BaseController
*/ */
public function appletIndex() public function appletIndex()
{ {
var_dump($this->request);
$marketId = $this->request->input('market_id', -1); $marketId = $this->request->input('market_id', -1);
$banners = $this->bannerService->all(Banner::TYPE_APPLET_INDEX, $marketId); $banners = $this->bannerService->all(Banner::TYPE_APPLET_INDEX, $marketId);
$categories = $this->categoryService->allForAppletIndex(); $categories = $this->categoryService->allForAppletIndex();

2
app/Service/v3/Implementations/BannerService.php

@ -11,7 +11,7 @@ class BannerService implements BannerServiceInterface
{ {
$builder = Banner::query() $builder = Banner::query()
->where(['type' => $type]) ->where(['type' => $type])
>where(function ($query) use ($marketId) {
->where(function ($query) use ($marketId) {
$query->whereJsonContains('market_ids', [(string)$marketId]) $query->whereJsonContains('market_ids', [(string)$marketId])
->orWhereJsonLength('market_ids', '=', 0); ->orWhereJsonLength('market_ids', '=', 0);
}); });

Loading…
Cancel
Save