Add display articles & categories, raw mode
This commit is contained in:
@@ -49,7 +49,7 @@ class Articles
|
||||
|
||||
public static function getByCategory($category_id)
|
||||
{
|
||||
return Article::with(['prices.article_attribute.attribute_value'])->get();
|
||||
return Article::with(['prices.article_attribute.attribute_value','product','image'])->get();
|
||||
}
|
||||
|
||||
public static function getCategoriesByArticle($article)
|
||||
@@ -92,7 +92,7 @@ class Articles
|
||||
self::storeCategories($article, $categories);
|
||||
self::storeTags($article, $tags);
|
||||
self::storePrices($article, $prices);
|
||||
return $article_id;
|
||||
return $article->id;
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
@@ -175,6 +175,17 @@ class Articles
|
||||
}
|
||||
}
|
||||
|
||||
public static function getThumbSrc($image)
|
||||
{
|
||||
$id = $image['id'];
|
||||
$images = json_decode($image['responsive_images'], true);
|
||||
$urls = $images['medialibrary_original']['urls'];
|
||||
|
||||
$img = $urls[count($urls)-1];
|
||||
$src = "storage/$id/responsive-images/$img";
|
||||
return $src;
|
||||
}
|
||||
|
||||
|
||||
public static function deleteImage($id, $index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user