Merge branch 'feature/vehicle_new_sku' into develop
This commit is contained in:
@@ -106,6 +106,11 @@ class VehicleNewController extends BaseController
|
||||
$contentRes['content'] = isset($content['translation']) ? $content['translation']['content']:'';
|
||||
$result['content'][] = $contentRes;
|
||||
}
|
||||
|
||||
if(empty($item['sku'])){
|
||||
$result['sku'] = [];
|
||||
return $result;
|
||||
}
|
||||
foreach ($item['sku'] as &$sku) {
|
||||
foreach ($sku['skuAttributes'] as &$skuAttribute){
|
||||
$attribute = VehicleNewAttributesTranslationModel::where(['attributes_id' => $skuAttribute['attribute']['id'],'locale'=>locale()])->first();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\console\controller;
|
||||
|
||||
use app\console\model\VehicleNewAttributeCategoriesTranslationModel;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use app\console\model\VehicleNewAttributesModel;
|
||||
@@ -50,6 +51,11 @@ class VehicleNewAttributesController extends BaseController
|
||||
'attribute_name' => isset($item['translation']) ? $item['translation']['attribute_name'] : '',
|
||||
];
|
||||
|
||||
if(!empty($item['category_id'])){
|
||||
$category = VehicleNewAttributeCategoriesTranslationModel::find($item['category_id']);
|
||||
$result['category_name'] = $category['category_name'];
|
||||
}
|
||||
|
||||
foreach ($item['value'] as $value) {
|
||||
$valueRes['id'] = $value['id'];
|
||||
$valueRes['attribute_id'] = $value['attribute_id'];
|
||||
|
||||
@@ -36,7 +36,7 @@ class VehicleNewSkusService extends BaseService
|
||||
'fields' => ['id','vehicle_id','status'],
|
||||
'relations' => [
|
||||
'translation' => ['sku_id', 'name', 'locale'],
|
||||
'skuAttributes' => [],
|
||||
'skuAttributes' => ['id','sku_id','attribute_id','value_id','img',],
|
||||
'skuAttributes.attribute' => ['id', 'input_type', 'is_img', 'status'],
|
||||
'skuAttributes.value' => ['id','color_code'],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user