作者 lyh
... ... @@ -169,7 +169,7 @@ class UpdateSeoTdk extends Command
foreach ($this->maps as $table => $map) {
$update[$table] = ['total_page'=>0, 'title'=>0, 'keyword'=>0, 'des'=>0];
echo date('Y-m-d H:i:s') . '更新--' . $table . ': 项目id' . $project_id . PHP_EOL;
$list = DB::connection('custom_mysql')->table($table)->get();
$list = DB::connection('custom_mysql')->table($table)->select('id')->get();
if (!empty($list)) {
$list = $list->toArray();
foreach ($list as $v) {
... ...
... ... @@ -41,8 +41,12 @@ class InquiryFormData extends Base
*/
public static function saveData($form_id, $domain, $ip, $country, $referer, $user_agent, $submit_at, $data){
//数据标识
ksort($data);
$sign = md5(json_encode($data));
$sign_data = $data;
ksort($sign_data);
if(!empty($sign_data['globalso-date'])){
unset($sign_data['globalso-date']);
}
$sign = md5(json_encode($sign_data));
//5分钟内是否有重复数据
$is_exist = self::where('sign', $sign)->where('created_at', '>', date('Y-m-d H:i:s', strtotime('-5 minute')))->first();
if($is_exist){
... ...
... ... @@ -311,10 +311,10 @@ class Project extends Base
*/
public static function getProjectByDomain($domain)
{
$domain = parse_url($domain);
$domain = $domain['host'] ?? $domain;
$domain_parse = parse_url($domain);
$domain = $domain_parse['host'] ?? $domain;
//是否测试域名
$project_id = DeployBuild::where('test_domain', $domain)->value('project_id');
$project_id = DeployBuild::where('test_domain', 'https://' . $domain . '/')->value('project_id');
//是否正式域名
if (!$project_id) {
$project_id = \App\Models\Domain\DomainInfo::where('domain', $domain)->value('project_id');
... ...
... ... @@ -167,6 +167,10 @@ class SyncSubmitTaskService
* @date 2024/1/20
*/
public static function inquiryFilter($project_id, $data){
if(empty($data['referer']) || empty($data['user_agent']) || empty($data['data'])){
throw new InquiryFilterException( '数据异常:' . $data['country']);
}
$config = InquiryFilterConfig::getCacheInfoByProjectId($project_id);
//是否开启过滤
if($config && $config['status']){
... ...