作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !119
... ... @@ -256,11 +256,25 @@ class ProjectUpdate extends Command
$product_type = '';
if ($item['category'] ?? []) {
$category_arr = [];
$type_arr = [];
$new_category = [];
foreach ($item['category'] as $cate) {
if ($cate['parent'] == 0 && $cate['name'] == 'Featured Products') {
$type_arr[] = 2;
} elseif ($cate['parent'] == 0 && $cate['name'] == 'Hot Products') {
$type_arr[] = 3;
}else{
$new_category[] = $cate;
}
}
if ($type_arr) {
$product_type = ',' . implode(',', $type_arr);
}
$category_arr = [];
$pid = 0;
for ($i = 0; $i < count($item['category']); $i++) {
$return = $this->get_category_name_arr($item['category'], $pid);
for ($i = 0; $i < count($new_category); $i++) {
$return = $this->get_category_name_arr($new_category, $pid);
if ($return) {
$category_arr[] = $this->special2str($return['name'] ?? '');
$pid = $return['id'];
... ... @@ -271,18 +285,6 @@ class ProjectUpdate extends Command
$categoryLogic = new CategoryLogic();
$category_id = $categoryLogic->importProductCategory($project_id, implode('/', $category_arr));
}
$type_arr = [];
foreach ($item['category'] as $cate) {
if ($cate['parent'] == 0 && $cate['name'] == 'Featured Products') {
$type_arr[] = 2;
} elseif ($cate['parent'] == 0 && $cate['name'] == 'Hot Products') {
$type_arr[] = 3;
}
}
if ($type_arr) {
$product_type = ',' . implode(',', $type_arr);
}
}
try {
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
... ...