作者 刘锟

update

... ... @@ -306,7 +306,7 @@ class BlogCategoryLogic extends BaseLogic
*/
public function importBlogCategory($project_id,$user_id,$category){
$return = [];
$cate_arr = explode('/',$category);
$cate_arr = explode('^v6sp$',$category);
$pid = 0;
foreach ($cate_arr as $v){
if($v){
... ...
... ... @@ -273,6 +273,21 @@ class BlogLogic extends BaseLogic
$img = check_remote_url_down($data[5]) ? CosService::uploadRemote($project_id, 'image_news', $data[5]) : $data[5];
}
$seo_title = '';
if($data[6]??''){
$seo_title = substr(strip_tags($data[6]),0,70);
}
$seo_keywords = '';
if($data[6]??''){
$seo_keywords = substr(strip_tags($data[7]),0,255);
}
$seo_description = '';
if($data[6]??''){
$seo_description = substr(strip_tags($data[8]),0,200);
}
$id = $this->model->addReturnId(
[
'name' => $data[0],
... ... @@ -280,9 +295,9 @@ class BlogLogic extends BaseLogic
'text' => $text,
'remark' => $data[3] ?? '',
'image' => $img,
'seo_title' => $data[6] ?? '',
'seo_keywords' => $data[7] ?? '',
'seo_description' => $data[8] ?? '',
'seo_title' => $seo_title,
'seo_keywords' => $seo_keywords,
'seo_description' => $seo_description,
'project_id' => $project_id,
'operator_id' => $user_id,
'create_id' => $user_id,
... ...
... ... @@ -287,7 +287,7 @@ class NewsCategoryLogic extends BaseLogic
*/
public function importNewsCategory($project_id,$user_id,$category){
$return = [];
$cate_arr = explode('/',$category);
$cate_arr = explode('^v6sp$',$category);
$pid = 0;
foreach ($cate_arr as $v){
if($v){
... ...
... ... @@ -306,6 +306,21 @@ class NewsLogic extends BaseLogic
$img = check_remote_url_down($data[5]) ? CosService::uploadRemote($project_id, 'image_news', $data[5]) : $data[5];
}
$seo_title = '';
if($data[6]??''){
$seo_title = substr(strip_tags($data[6]),0,70);
}
$seo_keywords = '';
if($data[6]??''){
$seo_keywords = substr(strip_tags($data[7]),0,255);
}
$seo_description = '';
if($data[6]??''){
$seo_description = substr(strip_tags($data[8]),0,200);
}
$id = $this->model->addReturnId(
[
'name' => $data[0],
... ... @@ -313,9 +328,9 @@ class NewsLogic extends BaseLogic
'text' => $text,
'remark' => $data[3] ?? '',
'image' => $img,
'seo_title' => $data[6] ?? '',
'seo_keywords' => $data[7] ?? '',
'seo_description' => $data[8] ?? '',
'seo_title' => $seo_title,
'seo_keywords' => $seo_keywords,
'seo_description' => $seo_description,
'project_id' => $project_id,
'operator_id' => $user_id,
'create_id' => $user_id,
... ...
... ... @@ -277,7 +277,7 @@ class CategoryLogic extends BaseLogic
*/
public function importProductCategory($project_id,$category){
$return = [];
$cate_arr = explode('/',$category);
$cate_arr = explode('^v6sp$',$category);
$pid = 0;
foreach ($cate_arr as $v){
if($v){
... ...
... ... @@ -197,7 +197,7 @@ class KeywordLogic extends BaseLogic
*/
public function importProductKeyword($project_id,$keyword){
$return = [];
$keyword_arr = explode(',',$keyword);
$keyword_arr = explode('^v6sp$',$keyword);
foreach ($keyword_arr as $v){
$keyword_info = $this->model->read(['title'=>$v]);
if(!$keyword_info){
... ...
... ... @@ -682,10 +682,25 @@ class ProductLogic extends BaseLogic
}
//处理seo
$seo_title = '';
if($data[8]??''){
$seo_title = substr(strip_tags($data[8]),0,70);
}
$seo_keywords = '';
if($data[9]??''){
$seo_keywords = substr(strip_tags($data[9]),0,255);
}
$seo_description = '';
if($data[10]??''){
$seo_description = substr(strip_tags($data[10]),0,200);
}
$seo_mate = [
'title' => $data[8]??'',
'keyword' => $data[9]??'',
'description' => $data[10]??''
'title' => $seo_title,
'keyword' => $seo_keywords,
'description' => $seo_description
];
//处理描述切换栏
... ...