作者 zhl

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

<?php
/**
* @remark :
* @name :GeoWritingTaskController.php
* @author :lyh
* @method :post
* @time :2025/10/25 10:40
*/
namespace App\Http\Controllers\Aside\Geo;
use App\Http\Controllers\Aside\BaseController;
/**
* @remark :文章任务(收集数据)
* @name :GeoWritingTaskController
* @author :lyh
* @method :post
* @time :2025/10/25 10:40
*/
class GeoWritingTaskController extends BaseController
{
/**
* @remark :文章任务列表
* @name :lists
* @author :lyh
* @method :post
* @time :2025/10/25 10:41
*/
public function lists(){
}
}
... ...
<?php
/**
* @remark :
* @name :GeoWritingsController.php
* @author :lyh
* @method :post
* @time :2025/10/25 10:41
*/
namespace App\Http\Controllers\Aside\Geo;
use App\Http\Controllers\Aside\BaseController;
/**
* @remark :geo文章
* @name :GeoWritingsController
* @author :lyh
* @method :post
* @time :2025/10/25 10:41
*/
class GeoWritingsController extends BaseController
{
}
... ...
... ... @@ -20,6 +20,7 @@ use App\Models\Com\UpdateLog;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\ServersIp;
use App\Models\Domain\DomainCreateTask;
use App\Models\Domain\DomainInfo;
use App\Models\Domain\DomainInfo as DomainInfoModel;
use App\Models\Geo\GeoArticle;
use App\Models\Geo\GeoConf;
... ... @@ -225,7 +226,7 @@ class ProjectController extends BaseController
if($this->map['domain_type'] == 'domain'){
$parsedUrl = parse_url($this->map['domain_search']);
$this->map['domain_search'] = $parsedUrl['host'] ?? $this->map['domain_search'];
$ids = DomainInfo::where('domain', 'like', '%'.$this->map['domain_search'].'%')->pluck('id')->toArray();
$ids = DomainInfoModel::where('domain', 'like', '%'.$this->map['domain_search'].'%')->pluck('id')->toArray();
$query->whereIn('gl_project_deploy_optimize.domain', $ids);
}else{
$query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['domain_search'].'%');
... ... @@ -447,23 +448,6 @@ class ProjectController extends BaseController
if(!empty($item['extend_type'])){
$item['type'] = $item['extend_type'];
}
$domainModel = new DomainInfoModel();
$item['domain'] = !empty($item['domain']) ? $domainModel->getDomain($item['domain']) : '';
$item['uuid'] = TicketProject::where('table_id', $item['id'])->where('project_cate', 2)->value('uuid') ?? null;
$item['friend_id'] = ProjectAssociation::where('project_id', $item['id'])->where('status', ProjectAssociation::STATUS_NORMAL)->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT)->value('friend_id') ?? null;
$planMap = Project::planMap();
$seoPlanMap = Project::seoMap();
$item['plan'] = $planMap[$item['plan']] ?? '';
$item['seo_plan'] = $seoPlanMap[$item['seo_plan']] ?? '';
$item['autologin_code'] = getAutoLoginCode($item['id']);
$item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date']));
$item['product_num'] = $data['product'] ?? 0;
$item['keyword_num'] = $data['key'] ?? 0;
$item['article_num'] = ($data['blog'] ?? 0) + ($data['news'] ?? 0);
$item['task_finish_num'] = Task::getNumByProjectId($item['id'], Task::STATUS_DOWN);
$item['task_pending_num'] = Task::getNumByProjectId($item['id'], [Task::STATUS_DONGING, Task::STATUS_WAIT]);
$item['collect_time'] = $item['is_upgrade'] ? UpdateLog::getProjectUpdate($item['id']) : '';
$item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0);
$manageModel = new ManageHr();
//geo项目
if(($item['plan'] == 0) && ($item['seo_plan'] != 0)){
... ... @@ -487,6 +471,23 @@ class ProjectController extends BaseController
$item['optimize_assist'] = $manageModel->getName($item['optimize_assist_mid']);
$item['optimize_tech'] = $manageModel->getName($item['optimize_tech_mid']);
$item['quality_mid_name'] = $manageModel->getName($item['quality_mid']);
$planMap = Project::planMap();
$seoPlanMap = Project::seoMap();
$item['plan'] = $planMap[$item['plan']] ?? '';
$item['seo_plan'] = $seoPlanMap[$item['seo_plan']] ?? '';
$domainModel = new DomainInfoModel();
$item['domain'] = !empty($item['domain']) ? $domainModel->getDomain($item['domain']) : '';
$item['uuid'] = TicketProject::where('table_id', $item['id'])->where('project_cate', 2)->value('uuid') ?? null;
$item['friend_id'] = ProjectAssociation::where('project_id', $item['id'])->where('status', ProjectAssociation::STATUS_NORMAL)->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT)->value('friend_id') ?? null;
$item['autologin_code'] = getAutoLoginCode($item['id']);
$item['created_at'] = date('Y年m月d日', strtotime($item['cooperate_date']));
$item['product_num'] = $data['product'] ?? 0;
$item['keyword_num'] = $data['key'] ?? 0;
$item['article_num'] = ($data['blog'] ?? 0) + ($data['news'] ?? 0);
$item['task_finish_num'] = Task::getNumByProjectId($item['id'], Task::STATUS_DOWN);
$item['task_pending_num'] = Task::getNumByProjectId($item['id'], [Task::STATUS_DONGING, Task::STATUS_WAIT]);
$item['collect_time'] = $item['is_upgrade'] ? UpdateLog::getProjectUpdate($item['id']) : '';
$item['channel'] = Channel::getChannelText($item['channel']['user_id'] ?? 0);
return $item;
}
... ...
<?php
/**
* @remark :
* @name :GeoWritingsLogic.php
* @author :lyh
* @method :post
* @time :2025/10/25 10:43
*/
namespace App\Http\Logic\Aside\Geo;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoWritings;
/**
* @remark :文章任务
* @name :GeoWritingsLogic
* @author :lyh
* @method :post
* @time :2025/10/25 10:44
*/
class GeoWritingsLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new GeoWritings();
}
}
... ...
<?php
/**
* @remark :
* @name :GeoWritingsTaskLogic.php
* @author :lyh
* @method :post
* @time :2025/10/25 10:45
*/
namespace App\Http\Logic\Aside\Geo;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoWritings;
use App\Models\Geo\GeoWritingsTask;
class GeoWritingsTaskLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new GeoWritingsTask();
}
}
... ...
<?php
/**
* @remark :
* @name :GeoWritingsTask.php
* @author :lyh
* @method :post
* @time :2025/10/25 10:47
*/
namespace App\Models\Geo;
use App\Models\Base;
/**
* @remark :文章生成任务
* @name :GeoWritingsTask
* @author :lyh
* @method :post
* @time :2025/10/25 10:48
*/
class GeoWritingsTask extends Base
{
protected $table = 'gl_project_geo_writings_task';
}
... ...
... ... @@ -5,7 +5,6 @@ namespace App\Models\Inquiry;
use App\Helper\Arr;
use App\Helper\FormGlobalsoApi;
use App\Models\Base;
use App\Utils\LogUtils;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
... ... @@ -42,7 +41,7 @@ class InquiryFormData extends Base
* @author zbj
* @date 2023/12/4
*/
public static function saveData($form_id, $domain, $ip, $country, $referer, $user_agent, $submit_at, $data, $traffic = 0){
public static function saveData($form_id, $domain, $ip, $country, $referer, $user_agent, $submit_at, $data, $project_id, $traffic = 0){
if(!empty($data['email'])){
$data['email'] = str_replace(' ', '', $data['email']);
}
... ... @@ -96,6 +95,14 @@ class InquiryFormData extends Base
}
}
$res = (new FormGlobalsoApi())->submitInquiry($ip, $referer, $submit_at, $data, $traffic);
//自定义推送
if($project_id == 3870) { //走这里发送的,关杰那边也要取消发送邮件
list($mobile, $email) = self::SpecialMailPhone($referer);
Log::channel('inquiry')->info('自定义推送', [$mobile, $email]);
$body = self::specialInquiryTemplate($data['name'], $data['email'], $data['phone'] ?? "", $data['message'], $domain, $ip, $country);
(new FormGlobalsoApi())->customizeInquiryEmail($email, '询盘客户<' . $data['name'] . '>', $body, $ip, $referer, $submit_at);
(new FormGlobalsoApi())->customizeInquirySms($mobile, $country, $domain);
}
Log::channel('inquiry')->info('询盘发送邮件', [$data, $res]);
if(!$res){
throw new \Exception('询盘发送邮件失败');
... ... @@ -118,6 +125,119 @@ class InquiryFormData extends Base
}
/**
* 获取推送邮箱和手机号
* 邮件地址和手机号 根据链接匹配,没匹配到随机取一个邮件和手机号
* @param $referer
* @author zbj
* @date 2025/10/25
*/
public static function SpecialMailPhone($referer)
{
$mail_mobile_map = [
'luchfitness' => [15262817624, 'Sales02@luchfitness.com'],
'modernsporting' => [13073258707,'sales@modernsporting.com'],
'liveupsports' => [18355892630,'sales@liveupsports.com'],
'topflor' => [13912296731,'alan@topflor.cn'],
];
$url_map = [
'luchfitness' => [
'https://www.ntsportgoods.com/supplier/nantong-luch-fitness-co-ltd',
'https://www.ntsportgoods.com/benches-machines-luch-fitness/',
'https://www.ntsportgoods.com/free-weight-luch-fitness/',
'https://www.ntsportgoods.com/functional-training-luch-fitness/s/',
'https://www.ntsportgoods.com/studio-exercise-luch-fitness/',
'https://www.ntsportgoods.com/commercial-gym-half-power-rack-for-strength-training-product',
'https://www.ntsportgoods.com/heavy-duty-fitness-flat-bench-for-home-commercial-gym-product',
'https://www.ntsportgoods.com/durable-gym-dumbbell-flat-bench-for-weight-training-product',
'https://www.ntsportgoods.com/rubber-colored-bumper-plate-for-olympic-weightlifting-product',
'https://www.ntsportgoods.com/urethane-competition-bumper-plate-for-strength-training-product',
'https://www.ntsportgoods.com/10-pair-dumbbell-storage-rack-for-commercial-gyms-product',
'https://www.ntsportgoods.com/tpu-coated-dumbbells-for-home-and-commercial-fitness-product',
'https://www.ntsportgoods.com/urethane-weight-plate-for-powerlifting-strength-gym-product',
'https://www.ntsportgoods.com/iphifun-cpu-weight-plate-for-professional-training-product',
'https://www.ntsportgoods.com/men-s-weightlifting-barbell-bar-for-strength-training-product',
'https://www.ntsportgoods.com/women-s-weightlifting-barbell-bar-for-olympic-lifts-product',
'https://www.ntsportgoods.com/steel-competition-kettlebell-for-functional-training-product',
'https://www.ntsportgoods.com/adjustable-strength-jump-plyo-boxes-for-gym-training-product',
'https://www.ntsportgoods.com/commercial-soft-plyo-box-for-functional-gym-training-product',
'https://www.ntsportgoods.com/power-training-weight-bull-bag-for-strength-workout-product',
'https://www.ntsportgoods.com/pu-leather-power-bag-for-functional-strength-training-product',
'https://www.ntsportgoods.com/abdominal-muscle-mat-for-core-and-sit-up-training-product',
'https://www.ntsportgoods.com/gymnastics-training-mat-for-fitness-and-yoga-workout-product',
'https://www.ntsportgoods.com/adjustable-bench-stepper-for-aerobic-and-strength-gym-product',
'https://www.ntsportgoods.com/rubber-body-pump-set-for-cardio-and-strength-training-product',
'https://www.ntsportgoods.com/balance-training-yoga-ball-for-core-stability-workout-product',
'https://www.ntsportgoods.com/pull-up-resistance-band-for-strength-and-stretching-product',
],
'modernsporting' => [
'https://www.ntsportgoods.com/supplier/nantong-modern-sporting-industrial-co-ltdhttps://www.ntsportgoods.com/barbell-bars-modern-sporting/',
'https://www.ntsportgoods.com/storage-racks-modern-sporting/',
'https://www.ntsportgoods.com/dumbbells-modern-sporting/',
'https://www.ntsportgoods.com/rubber-plates-modern-sporting/',
'https://www.ntsportgoods.com/training-handles-modern-sporting/https://www.ntsportgoods.com/md4137-201cm-weightlifting-beginner-bar-product',
'https://www.ntsportgoods.com/md4143-220cm-hybrid-training-bar-product',
'https://www.ntsportgoods.com/md4149-powder-coated-pentagon-bar-product',
'https://www.ntsportgoods.com/gym-home-10-pairs-dumbbell-rack-stand-md6242-product',
'https://www.ntsportgoods.com/10-pairs-dumbbell-rack-for-home-gym-workouts-md6247-product',
'https://www.ntsportgoods.com/10-pairs-dumbbell-storage-rack-for-gym-home-md6250-product',
'https://www.ntsportgoods.com/urethane-dumbbells-set-for-strength-training-md2117-product',
'https://www.ntsportgoods.com/md2123-rubber-coated-studio-dumbbells-product',
'https://www.ntsportgoods.com/md2135-12-side-tpu-coated-dumbbells-product',
'https://www.ntsportgoods.com/rubber-bumper-plates-for-weightlifting-gym-use-md1056-product',
'https://www.ntsportgoods.com/high-quality-rubber-bumper-plates-for-gym-lifting-md1057-product',
'https://www.ntsportgoods.com/md1058-competition-weight-plates-product',
'https://www.ntsportgoods.com/tricep-press-down-bar-for-cable-machines-strength-md5128-product',
'https://www.ntsportgoods.com/md5132-tricep-press-down-bar-product',
'https://www.ntsportgoods.com/md5132-tricep-press-down-bar-product',
],
'liveupsports' => [
'https://www.ntsportgoods.com/supplier/nantong-liveup-sports-co-ltd/',
'https://www.ntsportgoods.com/yoga-pilates-liveup-sports/',
'https://www.ntsportgoods.com/training-equipment-liveup-sports/',
'https://www.ntsportgoods.com/gym-racks-and-equipment-liveup-sports/',
'https://www.ntsportgoods.com/20-25-30cm-pvc-customised-pilates-stability-exercise-ball-inflatable-soft-mini-pilates-small-yoga-bal-product/',
'https://www.ntsportgoods.com/55-65-75cm-bloom-workout-fitness-exercise-balance-gym-abs-anti-burst-yoga-ball-anti-slip-swiss-pilates-ball-product/',
'https://www.ntsportgoods.com/bodybuilding-fitness-exercise-custom-logo-gym-yoga-latex-hip-resistance-bands-loop-bands-set-product/',
'https://www.ntsportgoods.com/bloom-2080x4-5cm-natural-latex-loop-yoga-elastic-stretch-long-resistance-bands-exercise-band-product/',
'https://www.ntsportgoods.com/custom-logo-manufacturer-high-quality-eco-friendly-fitness-pilates-anti-slip-3-10mm-pu-rubber-tpe-cork-nbr-pvc-printed-yoga-mat-product/',
'https://www.ntsportgoods.com/custom-professional-manufacture-cheap-solid-cast-iron-dumbbell-weights-rubber-hex-dumbbell-sets-5-100lb-product/',
'https://www.ntsportgoods.com/professional-wholesale-custom-logo-free-weight-colored-rubber-bumper-gym-weight-barbell-plates-with-kg-mark-product/',
'https://www.ntsportgoods.com/gym-equipment-free-weights-fitness-12-sided-weightlifting-exercise-barbell-weight-lifting-polyurethane-fixed-barbell-product/',
'https://www.ntsportgoods.com/livepro-high-quality-steel-fitness-equipment-training-competition-gym-power-weightlifting-20kg-barbell-bar-product/',
'https://www.ntsportgoods.com/livepro-gym-commercial-equipment-fitness-storage-system-professional-multifunctional-training-frame-gym-storage-rack-product/',
'https://www.ntsportgoods.com/livepro-commercial-floor-mount-free-standing-cross-training-gym-rigs-multi-functional-training-rack-fitness-gym-rig-product/',
'https://www.ntsportgoods.com/livepro-oem-odm-fitness-equipment-multi-functional-trainer-smith-machine-station-home-using-gym-full-frame-cage-squat-power-rack-product/',
],
'topflor' => [
'https://www.ntsportgoods.com/supplier/nantong-topflor-co-ltd/',
'https://www.ntsportgoods.com/sports-flooring-topflor/',
'https://www.ntsportgoods.com/healthcare-flooring-topflor/',
'https://www.ntsportgoods.com/gym-flooring-topflor/',
'https://www.ntsportgoods.com/sprint-track-turf-for-high-performance-indoor-and-outdoor-training-product/',
'https://www.ntsportgoods.com/durable-gym-rubber-flooring-with-shock-absorption-and-slip-resistance-product/',
'https://www.ntsportgoods.com/interlocking-gym-flooring-tilesinterlocking-gym-flooring-tiles-product/',
'https://www.ntsportgoods.com/premium-hospital-vinyl-flooring-with-anti-bacterial-and-easy-clean-surface-product/',
'https://www.ntsportgoods.com/high-performance-healthcare-flooring-for-safe-and-hygienic-environments-product/',
'https://www.ntsportgoods.com/homogeneous-vinyl-flooring-with-high-durability-and-low-maintenance-product/',
'https://www.ntsportgoods.com/clinic-vinyl-flooring-with-anti-bacterial-and-wear-resistant-properties-product/',
'https://www.ntsportgoods.com/medical-pvc-flooring-with-anti-slip-hygienic-and-durable-features-product/',
'https://www.ntsportgoods.com/professional-badminton-court-pvc-sports-flooring-with-high-grip-and-shock-absorption-product/',
'https://www.ntsportgoods.com/indoor-basketball-sports-flooring-with-superior-ball-bounce-and-player-comfort-product/',
'https://www.ntsportgoods.com/multi-sport-indoor-pvc-flooring-for-volleyball-handball-badminton-and-fitness-product/',
'https://www.ntsportgoods.com/durable-multi-purpose-sports-flooring-for-schools-gyms-and-community-centers-product/',
'https://www.ntsportgoods.com/high-performance-multi-use-indoor-sports-flooring-with-easy-maintenance-product/',
],
];
foreach ($url_map as $k=>$urls) {
if(in_array($referer, $urls)) {
return $mail_mobile_map[$k];
}
}
return $mail_mobile_map[array_rand($mail_mobile_map)];
}
/**
* 特殊项目 邮件模版
* FIXME 后期有多个特殊项目,需要按照项目ID设置模板
* @param $name
... ... @@ -128,7 +248,7 @@ class InquiryFormData extends Base
* @param $country
* @return string
*/
public static function specialInquiryTemplate($name, $email, $phone, $message, $domain, $country)
public static function specialInquiryTemplate($name, $email, $phone, $message, $domain, $ip, $country)
{
$template = "
客户姓名:$name
... ... @@ -139,7 +259,7 @@ class InquiryFormData extends Base
$message
--------------------------------------------------------------------
发送询盘网址: $domain
客户IP地址: [ip]
客户IP地址: $ip
IP所在国家/地区: $country
--------------------------------------------------------------------";
return $template;
... ...
... ... @@ -283,7 +283,7 @@ class SyncSubmitTaskService
$data['referer'] = $this->handle_referer($data['referer']);
$id = InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data'], $traffic);
$id = InquiryFormData::saveData($form_id, $data['domain'], $data['ip'], $data['country'], $data['referer'], $data['user_agent'], $data['submit_at'], $data['data'], $data['project_id'], $traffic);
//转化询盘
... ...