作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -255,13 +255,17 @@ class HtmlCollect extends Command
$query = $arr['query'] ?? '';
$path_arr = explode('.', $path);
$path_end = end($path_arr);
if (
(empty($scheme) || $scheme == 'https' || $scheme == 'http')
&& (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
&& $path
&& (substr($path, 0, 1) == '/')
&& (strpos($path, '.') !== false)
&& (!in_array(end($path_arr), ['html', 'php', 'com', 'xml']))
&& (strpos($path_end, 'html') === false)
&& (strpos($path_end, 'php') === false)
&& (strpos($path_end, 'com') === false)
&& (strpos($path_end, 'xml') === false)
) {
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
if (!$source) {
... ...
... ... @@ -255,13 +255,17 @@ class HtmlLanguageCollect extends Command
$query = $arr['query'] ?? '';
$path_arr = explode('.', $path);
$path_end = end($path_arr);
if (
(empty($scheme) || $scheme == 'https' || $scheme == 'http')
&& (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
&& $path
&& (substr($path, 0, 1) == '/')
&& (strpos($path, '.') !== false)
&& (!in_array(end($path_arr), ['html', 'php', 'com', 'xml']))
&& (strpos($path_end, 'html') === false)
&& (strpos($path_end, 'php') === false)
&& (strpos($path_end, 'com') === false)
&& (strpos($path_end, 'xml') === false)
) {
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
if (!$source) {
... ...
... ... @@ -299,7 +299,9 @@ class CustomModuleContentLogic extends BaseLogic
DB::beginTransaction();
try {
foreach ($this->param['id'] as $id) {
//删除当前扩展字段
$this->delRoute($id);
$this->delContentExtend($id);
$this->model->del(['id' => $id]);
}
DB::commit();
... ... @@ -337,4 +339,17 @@ class CustomModuleContentLogic extends BaseLogic
$this->model->edit(['sort' => $this->param['sort']], ['id'=>$this->param['id']]);
return $this->success();
}
/**
* @remark :
* @name :delContentExtend
* @author :lyh
* @method :post
* @time :2023/12/18 11:43
*/
public function delContentExtend($id){
$contentExtendModel = new CustomModuleExtentContent();
$contentExtendModel->del(['content_id'=>$id]);
return $this->success();
}
}
... ...
... ... @@ -66,7 +66,7 @@ class KeywordLogic extends BaseLogic
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
}
//清除缓存
// //清除缓存
Common::del_user_cache('product_keyword',$this->user['project_id']);
DB::commit();
}catch (\Exception $e){
... ... @@ -102,18 +102,28 @@ class KeywordLogic extends BaseLogic
public function handleSaveParam($param){
if(isset($param['keyword_top_banner']) && !empty($param['keyword_top_banner'])){
$param['keyword_top_banner'] = str_replace_url($param['keyword_top_banner']);
}else{
unset($param['keyword_top_banner']);
}
if(isset($param['keyword_foot_banner']) && !empty($param['keyword_foot_banner'])){
$param['keyword_foot_banner'] = str_replace_url($param['keyword_foot_banner']);
}else{
unset($param['keyword_foot_banner']);
}
if(isset($param['keyword_video']) && !empty($param['keyword_video'])){
$param['keyword_video'] = Arr::a2s($param['keyword_video']);
}else{
unset($param['keyword_video']);
}
if(!empty($param['related_news_ids'])){
$param['related_news_ids'] = Arr::arrToSet($param['related_news_ids']);
}else{
unset($param['related_news_ids']);
}
if(!empty($param['related_blog_ids'])){
$param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids']);
}else{
unset($param['related_blog_ids']);
}
return $param;
}
... ...
... ... @@ -54,9 +54,7 @@ class RouteMap extends Base
* @date 2023/4/17
*/
public static function generateRoute($title, $source, $source_id, $project_id){
if(!preg_match('/^[a-zA-Z]$/', $title)){
$title = Translate::tran($title, 'en');
}
$i=1;
$sign = generateRoute($title);
$info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first();
... ...