Fixes on new model
This commit is contained in:
@@ -13,9 +13,14 @@ use App\Models\Shop\ArticlePrice;
|
||||
class ArticlePrices
|
||||
{
|
||||
|
||||
public static function getPricesByArticle($id)
|
||||
public static function getByArticle($id)
|
||||
{
|
||||
return ArticlePrice::with('ArticleAttributes.Value')->byArticle($id)->get()->toArray();
|
||||
return ArticlePrice::byArticle($id)->get();
|
||||
}
|
||||
|
||||
public static function getByArticleWithAttribute($id)
|
||||
{
|
||||
return ArticlePrice::with('article_attribute')->byArticle($id)->get();
|
||||
}
|
||||
|
||||
public static function getDatatable()
|
||||
@@ -34,11 +39,11 @@ class ArticlePrices
|
||||
return ArticlePrice::find($id);
|
||||
}
|
||||
|
||||
public static function storePrices($article_id, $prices)
|
||||
public static function storePrices($article_attribute_id, $prices)
|
||||
{
|
||||
if ($prices) {
|
||||
foreach ($prices as $key => $price) {
|
||||
$prices[$key]['article_id'] = $article_id;
|
||||
$prices[$key]['article_attribute_id'] = $article_attribute_id;
|
||||
self::store($prices[$key]);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user