xiaogang 3 年之前
父節點
當前提交
25e4b09c81
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      app/Http/Controllers/Api/DynamicController.php
  2. 2 1
      app/Services/DynamicService.php

+ 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();