wzq 5 年之前
父節點
當前提交
d575a78e18
共有 1 個文件被更改,包括 2 次插入12 次删除
  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;
     }
 
 }