[WIP] Fix cosmetics, prices
This commit is contained in:
@@ -27,12 +27,19 @@ class ArticleAttributeValues
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return ArticleAttributeValue::get()->pluck('name','id')->toArray();
|
||||
return ArticleAttributeValue::get()->pluck('value','id')->toArray();
|
||||
}
|
||||
|
||||
public static function getOptionsByFamily($attribute_family_id)
|
||||
public static function getSelectByFamily($attribute_family_id)
|
||||
{
|
||||
return ArticleAttributeValue::byFamily($attribute_family_id)->get()->pluck('name','id')->toArray();
|
||||
// return ArticleAttributeValue::byFamily($attribute_family_id)->get()->pluck('value','id')->toArray();
|
||||
$values = ArticleAttributeValue::byFamily($attribute_family_id)->get();
|
||||
$data = [];
|
||||
foreach ($values as $value)
|
||||
{
|
||||
$data[] = ['id' => $value->id, 'text' => $value->value];
|
||||
}
|
||||
return collect($data)->sortBy('text')->values()->all();
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
|
||||
Reference in New Issue
Block a user