浏览代码

修改条件

rkljw 5 月之前
父节点
当前提交
a0bf359685
共有 1 个文件被更改,包括 1 次插入12 次删除
  1. 1 12
      app/JsonRpc/NewsService.php

+ 1 - 12
app/JsonRpc/NewsService.php

@@ -160,18 +160,7 @@ class NewsService implements NewsServiceInterface
             array_push($where,['article.status','=',$data['status']]);
 
         }
-        if(isset($data['catid'])){
-            $where[] =   ['article.catid',$data['catid']];
-            $where[] =   ['article.status', '1'];
-        }elseif(isset($data['keyword'])){
-            $where[] =   ['article.title','like','%'.$data['keyword'].'%'];
-            $where[] =   ['article.status', '1'];
-        }else{
-            $where[] =   ['article.catid',$data['catid']];
-            $where[] =   ['article.title','like','%'.$data['keyword'].'%'];
-            $where[] =   ['article.status', '1'];
-        }
-        
+
         $rep = Article::where($where)
             ->whereNotIn('status',[404])
             ->leftJoin('category','article.catid','category.id')