xiaogang 3 lat temu
rodzic
commit
25e4b09c81

+ 1 - 1
app/Http/Controllers/Api/DynamicController.php

xqd
@@ -32,7 +32,7 @@ class DynamicController extends Controller
      */
     public function get_tag_list(Request $request){
         try {
-            $data = $this->dynamicService->tag_list($request->keyword);
+            $data = $this->dynamicService->tag_list($request->keyword,$request->post('type',0));
         }catch (\Exception $exception){
             return $this->response->errorForbidden($exception->getMessage());
         }

+ 2 - 1
app/Services/DynamicService.php

xqd
@@ -21,9 +21,10 @@ use function PHPUnit\Framework\isEmpty;
 class DynamicService
 {
     //话题列表
-    public function tag_list($keyword){
+    public function tag_list($keyword,$type=0){
         $data = DB::table("dynamic_tag")
             ->where("title","like","%{$keyword}%")
+            ->where("type",$type)
             ->orderBy("hot","desc")
             ->limit(20)
             ->get();