作者 lyh

变更数据

... ... @@ -1590,7 +1590,7 @@ if (!function_exists('httpGetSsl')) {
}
/**
* @remark :截取自付出啊
* @remark :截取字符串
* @name :truncate_words
* @author :lyh
* @method :post
... ...
... ... @@ -30,6 +30,9 @@ class BlogCategoryLogic extends BaseLogic
public function categorySave(){
//验证名称是否存在
$this->verifyParamName($this->param['name']);
if(!isset($this->param['seo_title']) || empty($this->param['seo_title'])){
$this->param['seo_title'] = truncate_text($this->param['name'],70);
}
DB::beginTransaction();
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
... ...
... ... @@ -201,6 +201,9 @@ class BlogLogic extends BaseLogic
$this->fail('发布时间需大于当天');
}
}
if(!isset($param['seo_title']) || empty($param['seo_title'])){
$param['seo_title'] = truncate_text($param['name'],70);
}
return $this->success($param);
}
... ...
... ... @@ -234,6 +234,9 @@ class CustomModuleContentLogic extends BaseLogic
$param['video']['video_image'] = str_replace_url($param['video']['video_image']);
$param['video'] = Arr::a2s($param['video'] ?? []);
}
if(!isset($param['seo_title']) || empty($param['seo_title'])){
$param['seo_title'] = truncate_text($param['name'],70);
}
return $this->success($param);
}
... ...
... ... @@ -49,6 +49,9 @@ class NewsCategoryLogic extends BaseLogic
if(isset($param['image']) && !empty($param['image'])){
$param['image'] = str_replace_url($param['image']);
}
if(!isset($param['seo_title']) || empty($param['seo_title'])){
$param['seo_title'] = truncate_text($param['name'],70);
}
return $this->success($param);
}
/**
... ...
... ... @@ -225,6 +225,9 @@ class NewsLogic extends BaseLogic
if(isset($param['related_product_id'])){
$param['related_product_id'] = implode(',',$param['related_product_id']);
}
if(!isset($param['seo_title']) || empty($param['seo_title'])){
$param['seo_title'] = truncate_text($param['name'],70);
}
return $this->success($param);
}
... ...
... ... @@ -157,6 +157,9 @@ class CategoryLogic extends BaseLogic
}else{
$param['cate_tak'] = json_encode([]);;
}
if(!isset($param['seo_title']) || empty($param['seo_title'])){
$param['seo_title'] = truncate_text($param['title'],70);
}
return $this->success($param);
}
... ...
... ... @@ -123,6 +123,8 @@ class KeywordLogic extends BaseLogic
}
if(!empty($param['seo_title'])){
$param['seo_title'] = ucfirst($param['seo_title']);
}else{
$param['seo_title'] = truncate_text($param['title'],70);
}
$param['first_word'] = $this->model->first_word($param['title']);
return $param;
... ...
... ... @@ -392,6 +392,9 @@ class ProductLogic extends BaseLogic
$param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
$param['describe'] = Arr::a2s($param['describe'] ?? []);
$param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');
if(!isset($param['seo_mate']['seo_title']) || empty($param['seo_mate']['seo_title'])){
$param['seo_mate']['seo_title'] = truncate_text($param['title'],70);
}
$param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? []);
$param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? '');
if(isset($param['icon'])){
... ...