invert query from offers->articles to articles->offers
This commit is contained in:
@@ -59,6 +59,11 @@ class Articles
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getArticlesWithOffers()
|
||||
{
|
||||
return Article::withCurrentOffers()->with('offers')->get();
|
||||
}
|
||||
|
||||
public static function getFull($id)
|
||||
{
|
||||
$data['article'] = self::getArticleEdit($id);
|
||||
|
||||
@@ -38,6 +38,11 @@ class Categories
|
||||
return $category->tags->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getTreeVisibles()
|
||||
{
|
||||
$tree = Category::get()->toTree();
|
||||
}
|
||||
|
||||
public static function getTree()
|
||||
{
|
||||
return CategoryTrees::getTree();
|
||||
|
||||
@@ -19,7 +19,7 @@ class Offers
|
||||
|
||||
public static function getLast()
|
||||
{
|
||||
return Offer::with(['article.image'])->orderByDesc('updated_at')->get();
|
||||
return Offer::with(['article.image'])->active()->orderByDesc('updated_at')->get();
|
||||
}
|
||||
|
||||
public static function getByCategoryWithTags($category_id)
|
||||
|
||||
Reference in New Issue
Block a user