|
@@ -4,6 +4,7 @@ namespace App\Services\Content;
|
|
|
use App\Repositories\ArticleRepository;
|
|
|
use App\Repositories\ArticlePropertyReoository;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
class ArticleService
|
|
|
{
|
|
@@ -37,13 +38,14 @@ class ArticleService
|
|
|
}
|
|
|
|
|
|
if ($id) {
|
|
|
- $where[] = array('type_id','=',$id);
|
|
|
- $where[] = array('parent_id','=',$id);
|
|
|
+ $where[] = [function($query)use($id){
|
|
|
+ $query->where('type_id',$id)->orWhere('parent_id',$id);
|
|
|
+ }];
|
|
|
$list=$this->articleRepository->getArticles($where, $page);
|
|
|
} else {
|
|
|
$or_map = $map;
|
|
|
$or_map[] = array('type_id','=','1');
|
|
|
-// $map[] = array('parent_id','=','1');
|
|
|
+ $map[] = array('parent_id','=','1');
|
|
|
$list=$this->articleRepository->getAllArticles($map, $or_map, $page);
|
|
|
}
|
|
|
if ($list->toArray()) {
|