Ver código fonte

订单可使用优惠券

whitefang 1 ano atrás
pai
commit
f900ab2f67
1 arquivos alterados com 13 adições e 1 exclusões
  1. 13 1
      app/api/lists/HomeSpecialLists.php

+ 13 - 1
app/api/lists/HomeSpecialLists.php

@@ -29,6 +29,16 @@ class HomeSpecialLists  extends BaseApiDataLists implements ListsSearchInterface
         ];
     }
 
+    public function queryWhere()
+    {
+        $where = [];
+        if (!empty($this->params['id'])) {
+            $where[] = ['id','>',$this->params['id']];
+            $where[] = ['cover_type','=',1];
+        }
+        return $where;
+    }
+
 
     /**
      * @notes 获取列表
@@ -41,7 +51,9 @@ class HomeSpecialLists  extends BaseApiDataLists implements ListsSearchInterface
      */
     public function lists(): array
     {
+
         return HomeSpecial::where($this->searchWhere)
+            ->where($this->queryWhere())
             ->where('status',1)
             ->field(['id', 'special_type','special_way', 'title', 'cover_type', 'cover', 'user_head', 'user_nickname', 'vue_web', 'vue_param', 'view_num', 'tags', 'status', 'original_price' ,'present_price','goods_id'])
             ->limit($this->limitOffset, $this->limitLength)
@@ -64,7 +76,7 @@ class HomeSpecialLists  extends BaseApiDataLists implements ListsSearchInterface
      */
     public function count(): int
     {
-        return HomeSpecial::where($this->searchWhere)->count();
+        return HomeSpecial::where($this->searchWhere)->where($this->queryWhere())->count();
     }
 
 }