wesmiler hace 2 meses
padre
commit
f05c98e929
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      app/Services/Common/ArticleService.php

+ 5 - 0
app/Services/Common/ArticleService.php

@@ -57,11 +57,16 @@ class ArticleService extends BaseService
         $where = ['a.mark' => 1];
         $status = isset($params['status']) ? $params['status'] : 0;
         $type = isset($params['type']) ? $params['type'] : 0;
+        $cateId = isset($params['cate_id']) ? $params['cate_id'] : 0;
 
         if ($status > 0) {
             $where['a.status'] = $status;
         }
 
+        if ($cateId > 0) {
+            $where['a.cate_id'] = $cateId;
+        }
+
         $list = $this->model->with(['category'])->from('article as a')
             ->where($where)
             ->where(function ($query) use ($type) {