Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
6 个修改的文件
包含
33 行增加
和
13 行删除
| @@ -115,11 +115,11 @@ class UpdateRoute extends Command | @@ -115,11 +115,11 @@ class UpdateRoute extends Command | ||
| 115 | foreach ($lists as $v){ | 115 | foreach ($lists as $v){ |
| 116 | if(!empty($v['route'])){ | 116 | if(!empty($v['route'])){ |
| 117 | $tag = "-tag"; | 117 | $tag = "-tag"; |
| 118 | - if ((substr($v['route'], -strlen($tag)) === $tag)) { | 118 | + if (!(substr($v['route'], -strlen($tag)) === $tag)) { |
| 119 | + echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL; | ||
| 119 | // $route = Translate::tran($v['route'], 'en').$tag; | 120 | // $route = Translate::tran($v['route'], 'en').$tag; |
| 120 | // 如果不是以 '-tag' 结尾,则拼接上 '-tag' | 121 | // 如果不是以 '-tag' 结尾,则拼接上 '-tag' |
| 121 | -// $route = $v['route'].$tag; | ||
| 122 | - $route = rtrim($v['route'],$tag); | 122 | + $route = $v['route'].$tag; |
| 123 | $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 123 | $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); |
| 124 | $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 124 | $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); |
| 125 | // }else{ | 125 | // }else{ |
| @@ -127,10 +127,10 @@ class UpdateRoute extends Command | @@ -127,10 +127,10 @@ class UpdateRoute extends Command | ||
| 127 | // $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 127 | // $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); |
| 128 | // $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 128 | // $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); |
| 129 | } | 129 | } |
| 130 | -// }else{ | ||
| 131 | -// echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 132 | -// $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 133 | -// $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 130 | + }else{ |
| 131 | + echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 132 | + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 133 | + $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 134 | } | 134 | } |
| 135 | echo date('Y-m-d H:i:s') . 'end :' . PHP_EOL; | 135 | echo date('Y-m-d H:i:s') . 'end :' . PHP_EOL; |
| 136 | } | 136 | } |
| @@ -70,4 +70,21 @@ class ExtendController extends BaseController | @@ -70,4 +70,21 @@ class ExtendController extends BaseController | ||
| 70 | $extendLogic->extendDel(); | 70 | $extendLogic->extendDel(); |
| 71 | $this->response('success'); | 71 | $this->response('success'); |
| 72 | } | 72 | } |
| 73 | + | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 可搜索的字段列表 | ||
| 77 | + * @author zbj | ||
| 78 | + * @date 2024/1/22 | ||
| 79 | + */ | ||
| 80 | + public function search_filed(){ | ||
| 81 | + $map = [ | ||
| 82 | + 'title' => '产品标题', | ||
| 83 | + 'intro' => '短描述', | ||
| 84 | + ]; | ||
| 85 | + //文本框类型扩展字段 | ||
| 86 | + $extends = Extend::where('type', 1)->pluck('title', 'key')->toArray(); | ||
| 87 | + $data = array_merge($map, $extends); | ||
| 88 | + $this->response('success',Code::SUCCESS,$data); | ||
| 89 | + } | ||
| 73 | } | 90 | } |
| @@ -246,7 +246,7 @@ class ProductController extends BaseController | @@ -246,7 +246,7 @@ class ProductController extends BaseController | ||
| 246 | //获取当前用户选择的模版 | 246 | //获取当前用户选择的模版 |
| 247 | $v['video'] = json_decode($v['video'] ?? ''); | 247 | $v['video'] = json_decode($v['video'] ?? ''); |
| 248 | $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL); | 248 | $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL); |
| 249 | - $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); | 249 | + $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id'] ?? 0); |
| 250 | $v['url'] = $this->user['domain'].$v['route']; | 250 | $v['url'] = $this->user['domain'].$v['route']; |
| 251 | //获取当前数据扩展字段及值 | 251 | //获取当前数据扩展字段及值 |
| 252 | $v['extend'] = $this->getExtendInfo($v['id']); | 252 | $v['extend'] = $this->getExtendInfo($v['id']); |
| @@ -329,7 +329,8 @@ class ProjectLogic extends BaseLogic | @@ -329,7 +329,8 @@ class ProjectLogic extends BaseLogic | ||
| 329 | $config['filter_emails'] = Arr::a2s(!empty($config['filter_emails']) ? $config['filter_emails'] : []); | 329 | $config['filter_emails'] = Arr::a2s(!empty($config['filter_emails']) ? $config['filter_emails'] : []); |
| 330 | $config['filter_mobiles'] = Arr::a2s(!empty($config['filter_mobiles']) ? $config['filter_mobiles'] : []); | 330 | $config['filter_mobiles'] = Arr::a2s(!empty($config['filter_mobiles']) ? $config['filter_mobiles'] : []); |
| 331 | $config['filter_names'] = Arr::a2s(!empty($config['filter_names']) ? $config['filter_names'] : []); | 331 | $config['filter_names'] = Arr::a2s(!empty($config['filter_names']) ? $config['filter_names'] : []); |
| 332 | - | 332 | + $config['black_ips'] = $config['black_ips'] ?? ''; |
| 333 | + | ||
| 333 | $model = InquiryFilterConfig::where('project_id', $config['project_id'])->first(); | 334 | $model = InquiryFilterConfig::where('project_id', $config['project_id'])->first(); |
| 334 | if(!$model){ | 335 | if(!$model){ |
| 335 | $model = new InquiryFilterConfig(); | 336 | $model = new InquiryFilterConfig(); |
| @@ -47,7 +47,9 @@ class SyncSubmitTaskService | @@ -47,7 +47,9 @@ class SyncSubmitTaskService | ||
| 47 | return false; | 47 | return false; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | - ProjectServer::useProject($project['id']); | 50 | + if(!ProjectServer::useProject($project['id'])){ |
| 51 | + return false; | ||
| 52 | + } | ||
| 51 | 53 | ||
| 52 | $action = $task['type']; | 54 | $action = $task['type']; |
| 53 | $handler = new self(); | 55 | $handler = new self(); |
| @@ -133,7 +135,6 @@ class SyncSubmitTaskService | @@ -133,7 +135,6 @@ class SyncSubmitTaskService | ||
| 133 | * @date 2023/11/30 | 135 | * @date 2023/11/30 |
| 134 | */ | 136 | */ |
| 135 | public static function checkIpCountry($domain, $ip, $type){ | 137 | public static function checkIpCountry($domain, $ip, $type){ |
| 136 | - $domain = 'https://demo.globalso.site/'; | ||
| 137 | $project = Project::getProjectByDomain($domain); | 138 | $project = Project::getProjectByDomain($domain); |
| 138 | if(empty($project)){ | 139 | if(empty($project)){ |
| 139 | throw new InquiryFilterException('项目不存在'); | 140 | throw new InquiryFilterException('项目不存在'); |
| @@ -210,11 +211,11 @@ class SyncSubmitTaskService | @@ -210,11 +211,11 @@ class SyncSubmitTaskService | ||
| 210 | if($config['filter_referers']){ | 211 | if($config['filter_referers']){ |
| 211 | //只比较path路径 | 212 | //只比较path路径 |
| 212 | $paths = array_map(function ($v){ | 213 | $paths = array_map(function ($v){ |
| 213 | - return parse_url(Url::to($v), PHP_URL_PATH); | 214 | + return trim(parse_url(Url::to($v), PHP_URL_PATH), '/'); |
| 214 | },$config['filter_referers']); | 215 | },$config['filter_referers']); |
| 215 | 216 | ||
| 216 | //后端获取的referer | 217 | //后端获取的referer |
| 217 | - if(in_array(parse_url($data['referer'], PHP_URL_PATH), $paths)){ | 218 | + if(in_array(trim(parse_url($data['referer'], PHP_URL_PATH), '/'), $paths)){ |
| 218 | throw new InquiryFilterException( '过滤来源链接:' . $data['referer']); | 219 | throw new InquiryFilterException( '过滤来源链接:' . $data['referer']); |
| 219 | } | 220 | } |
| 220 | //前端获取的referer | 221 | //前端获取的referer |
| @@ -251,6 +251,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -251,6 +251,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 251 | Route::any('extend', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'lists'])->name('product_extend'); | 251 | Route::any('extend', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'lists'])->name('product_extend'); |
| 252 | Route::any('extend/save', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'save'])->name('product_extend_save'); | 252 | Route::any('extend/save', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'save'])->name('product_extend_save'); |
| 253 | Route::any('extend/del', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'del'])->name('product_extend_del'); | 253 | Route::any('extend/del', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'del'])->name('product_extend_del'); |
| 254 | + Route::any('extend/search_filed', [\App\Http\Controllers\Bside\Product\ExtendController::class, 'search_filed'])->name('product_extend_search_filed'); | ||
| 254 | }); | 255 | }); |
| 255 | 256 | ||
| 256 | 257 |
-
请 注册 或 登录 后发表评论