Fixes on attributes on prices
This commit is contained in:
@@ -13,6 +13,11 @@ use App\Models\Shop\ArticlePrice;
|
||||
class ArticlePrices
|
||||
{
|
||||
|
||||
public static function getPricesByArticle($id)
|
||||
{
|
||||
return ArticlePrice::with('ArticleAttributes.Value')->byArticle($id)->get()->toArray();
|
||||
}
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = ArticlePrice::orderBy('name');
|
||||
@@ -65,9 +70,12 @@ class ArticlePrices
|
||||
return ArticlePrice::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
return ArticlePrice::find($id)->update($data);
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
$article = ArticlePrice::find($id);
|
||||
$article->update($data);
|
||||
return $article;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
|
||||
Reference in New Issue
Block a user