|
...
|
...
|
@@ -600,14 +600,14 @@ class ProductLogic extends BaseLogic |
|
|
|
if (!$product) {
|
|
|
|
|
|
|
|
$category_id = '';
|
|
|
|
if ($data[2]) {
|
|
|
|
if ($data[2]??'') {
|
|
|
|
//处理分类
|
|
|
|
$categoryLogic = new CategoryLogic();
|
|
|
|
$category_id = $categoryLogic->importProductCategory($project_id, $data[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
$keyword_id = '';
|
|
|
|
if($data[3]){
|
|
|
|
if($data[3]??''){
|
|
|
|
//处理关键词
|
|
|
|
$keywordLogic = new KeywordLogic();
|
|
|
|
$keyword_id = $keywordLogic->importProductKeyword($project_id, $data[3]);
|
|
...
|
...
|
@@ -615,7 +615,7 @@ class ProductLogic extends BaseLogic |
|
|
|
|
|
|
|
$gallery = [];
|
|
|
|
$thumb = '';
|
|
|
|
if($data[7]){
|
|
|
|
if($data[7]??''){
|
|
|
|
//处理图片
|
|
|
|
$img_arr = explode(',',$data[7]);
|
|
|
|
foreach ($img_arr as $v_img){
|
|
...
|
...
|
@@ -638,7 +638,7 @@ class ProductLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
$intro = '';
|
|
|
|
if($data[5]){
|
|
|
|
if($data[5]??''){
|
|
|
|
//处理短描述中的图片
|
|
|
|
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[5], $result_intro);
|
|
|
|
if($result_intro[2]??[]){
|
|
...
|
...
|
@@ -659,7 +659,7 @@ class ProductLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
$content = '';
|
|
|
|
if($data[6]){
|
|
|
|
if($data[6]??''){
|
|
|
|
//处理内容中的图片
|
|
|
|
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[6], $result_content);
|
|
|
|
if($result_content[2]??[]){
|
|
...
|
...
|
@@ -688,7 +688,7 @@ class ProductLogic extends BaseLogic |
|
|
|
|
|
|
|
//处理描述切换栏
|
|
|
|
$describe = [];
|
|
|
|
if($data[11]){
|
|
|
|
if($data[11]??''){
|
|
|
|
//处理描述切换栏中的图片
|
|
|
|
$describe = json_decode($data[11],true);
|
|
|
|
|
|
...
|
...
|
@@ -730,7 +730,7 @@ class ProductLogic extends BaseLogic |
|
|
|
]
|
|
|
|
);
|
|
|
|
//更新路由
|
|
|
|
$route = RouteMap::setRoute($data[1] ?: $data[0], RouteMap::SOURCE_PRODUCT, $id, $project_id);
|
|
|
|
$route = RouteMap::setRoute((isset($data[1]) && $data[1]) ? $data[1] : $data[0], RouteMap::SOURCE_PRODUCT, $id, $project_id);
|
|
|
|
$this->edit(['route' => $route], ['id' => $id]);
|
|
|
|
|
|
|
|
return true;
|
...
|
...
|
|