Browse Source

wesmiler 报恩寺项目提交

wesmiler 4 years ago
parent
commit
8c80e4eb70

+ 2 - 2
app/Services/ArticleService.php

@@ -147,11 +147,11 @@ class ArticleService extends BaseService
             ->leftJoin('article_cates as c', 'a.cate_id', '=', 'c.id')
             ->where(function ($query) use ($params) {
                 $query->where(['a.mark'=>1,'a.status'=> 1]);
-
+                $keyword = isset($params['keyword']) ? trim($params['keyword']) : '';
                 $cateId = isset($params['cate_id']) ? intval($params['cate_id']) : 0;
                 if ($cateId > 0) {
                     $query->where('a.cate_id', $cateId);
-                } else if ($cateId == -1) {
+                } else if ($keyword=='') {
                     $query->where('a.is_recommand', 1);
                 }
 

+ 2 - 2
app/Services/EnshrineService.php

@@ -683,13 +683,13 @@ class EnshrineService extends BaseService
      * @param $userId
      * @return array
      */
-    public function orderList($userId)
+    public function orderList($uid)
     {
         $params = request()->all();
         $page = isset($params['pageSize']) ? intval($params['pageSize']) : PAGE;
         $pageSize = isset($params['pageSize']) ? intval($params['pageSize']) : PERPAGE;
         $type = isset($params['type']) ? intval($params['type']) : 0;
-        $where = ['a.mark' => 1,'a.status'=> 2, 'a.user_id' => $userId];
+        $where = ['a.mark' => 1,'a.status'=> 2];
         if($type){
             $where['a.type'] = $type;
         }

+ 2 - 1
app/Services/GoodsService.php

@@ -117,9 +117,10 @@ class GoodsService extends BaseService
             ->where(function ($query) use ($params) {
                 $query->where(['g.mark'=>1,'g.status'=> 1]);
                 $cateId = isset($params['cate_id']) ? intval($params['cate_id']) : 0;
+                $keyword = isset($params['keyword']) ? trim($params['keyword']) : '';
                 if ($cateId > 0) {
                     $query->where('g.cate_id', $cateId);
-                } else {
+                } else if($keyword==''){
                     $query->where('g.is_recommand', 1);
                 }