作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -545,7 +545,7 @@ class BTemplateLogic extends BaseLogic
public function homeOrProduct($source,$source_id = 0,$is_custom = 0){
if($is_custom == 0){
if($source == BTemplate::SOURCE_HOME){
$route = RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']);
RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']);
$type = RouteMap::SOURCE_PAGE;
}elseif($source == BTemplate::SOURCE_PRODUCT){
$type = RouteMap::SOURCE_PRODUCT;
... ...
... ... @@ -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();
}
}
... ...
... ... @@ -65,8 +65,8 @@ class CountLogic extends BaseLogic
* @time :2023/5/24 13:33
*/
public function total_count($inquiry_num = ''){
$pv = (new VisitItem())->where(['domain'=>$this->user['domain']])->count();
$ip = (new Visit())->where(['domain'=>$this->user['domain']])->count();
$pv = (new VisitItem())->count();
$ip = (new Visit())->count();
$data = [
'total_pv'=>$pv,
'total_ip'=>$ip,
... ...
... ... @@ -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();
... ...