Merge branch 'feature/vehicle_new_sku' into develop
This commit is contained in:
@@ -44,12 +44,16 @@ class VehicleNewAttributesController extends BaseController
|
|||||||
$result = [
|
$result = [
|
||||||
'id' => $item['id'],
|
'id' => $item['id'],
|
||||||
'status' => $item['status'],
|
'status' => $item['status'],
|
||||||
|
'category_id' => $item['category_id'],
|
||||||
|
'input_type' => $item['input_type'],
|
||||||
|
'is_img' => $item['is_img'],
|
||||||
'attribute_name' => isset($item['translation']) ? $item['translation']['attribute_name'] : '',
|
'attribute_name' => isset($item['translation']) ? $item['translation']['attribute_name'] : '',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($item['value'] as $value) {
|
foreach ($item['value'] as $value) {
|
||||||
$valueRes['id'] = $value['id'];
|
$valueRes['id'] = $value['id'];
|
||||||
$valueRes['attribute_id'] = $value['attribute_id'];
|
$valueRes['attribute_id'] = $value['attribute_id'];
|
||||||
|
$valueRes['color_code'] = $value['color_code'];
|
||||||
$valueRes['value_name'] = isset($value['translation']) ? $value['translation']['value_name']:'';
|
$valueRes['value_name'] = isset($value['translation']) ? $value['translation']['value_name']:'';
|
||||||
$result['value'][] = $valueRes;
|
$result['value'][] = $valueRes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ class VehicleNewAttributesService extends BaseService
|
|||||||
return [
|
return [
|
||||||
'filters' => [
|
'filters' => [
|
||||||
],
|
],
|
||||||
'fields' => ['id','status'],
|
'fields' => ['id','status', 'input_type', 'category_id', 'is_img'],
|
||||||
'relations' => [
|
'relations' => [
|
||||||
'translation' => ['attributes_id', 'locale', 'attribute_name'],
|
'translation' => ['attributes_id', 'locale', 'attribute_name'],
|
||||||
'value' => ['id', 'attribute_id', 'sort_order'],
|
'value' => ['id', 'attribute_id', 'color_code', 'sort_order'],
|
||||||
'value.translation' => ['id', 'values_id', 'locale', 'value_name'],
|
'value.translation' => ['id', 'values_id', 'locale', 'value_name'],
|
||||||
],
|
],
|
||||||
'sorts' => [
|
'sorts' => [
|
||||||
@@ -68,10 +68,10 @@ class VehicleNewAttributesService extends BaseService
|
|||||||
'filters' => [
|
'filters' => [
|
||||||
['field'=>'id', 'operator'=>'=', 'value'=> $params['id']],
|
['field'=>'id', 'operator'=>'=', 'value'=> $params['id']],
|
||||||
],
|
],
|
||||||
'fields' => ['id', 'status'],
|
'fields' => ['id', 'status', 'input_type', 'category_id', 'is_img'],
|
||||||
'relations' => [
|
'relations' => [
|
||||||
'translation' => ['attributes_id', 'locale', 'attribute_name'],
|
'translation' => ['attributes_id', 'locale', 'attribute_name'],
|
||||||
'value' => ['id', 'attribute_id', 'sort_order'],
|
'value' => ['id', 'attribute_id', 'color_code', 'sort_order'],
|
||||||
'value.translation' => ['id', 'values_id', 'locale', 'value_name'],
|
'value.translation' => ['id', 'values_id', 'locale', 'value_name'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user