Fixes on adding price & errors
This commit is contained in:
@@ -10,19 +10,14 @@ use App\Models\Shop\PriceList;
|
||||
|
||||
class PriceLists
|
||||
{
|
||||
public static function getByArticle($id)
|
||||
public static function getByTariff($id)
|
||||
{
|
||||
return PriceList::byArticle($id)->get();
|
||||
}
|
||||
|
||||
public static function getByArticleWithValues($id)
|
||||
{
|
||||
return PriceList::with('values')->byArticle($id)->get();
|
||||
return PriceList::byTariff($id)->get();
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return PriceList::with('prices')->get()->toArray();
|
||||
return PriceList::pluck('name','id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
@@ -30,6 +25,14 @@ class PriceLists
|
||||
return PriceList::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function edit($id)
|
||||
{
|
||||
$price_list = self::getFull($id)->toArray();
|
||||
$n = count($price_list['price_list_values']);
|
||||
$price_list['price_list_values'] += array_fill($n, 3 - $n, '');
|
||||
return $price_list;
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return PriceList::find($id);
|
||||
|
||||
Reference in New Issue
Block a user