wzq 5 years ago
parent
commit
d575a78e18
1 changed files with 2 additions and 12 deletions
  1. 2 12
      app/Repositories/BannerRepository.php

+ 2 - 12
app/Repositories/BannerRepository.php

@@ -17,20 +17,10 @@ class BannerRepository
 
     public function bannerData($request)
     {
-        $where = [];
         $ids = explode(",", $request['ids']);
-        $bannerLists = $this->banner
-            ->where($where)
+        return $this->banner
+            ->whereIn('id', $ids)
             ->get();
-        $banner_data =  [];
-        foreach ($ids as $v){
-            foreach ($bannerLists as $value){
-                if($v == $value['id']){
-                    $banner_data[] = $value;
-                }
-            }
-        }
-        return $banner_data;
     }
 
 }