作者 赵彬吉
... ... @@ -4,6 +4,7 @@ namespace App\Console\Commands\Ai;
use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Models\Ai\AiBlog;
use App\Models\Ai\AiBlogKeyword;
use App\Models\Ai\AiBlogOpenLog;
use App\Models\Project\AiBlogTask as AiBlogTaskModel;
use App\Models\Project\Project;
... ... @@ -77,6 +78,9 @@ class AiBlogAutoPublish extends Command
$this->output("项目{$project->id}未到执行时间" . $next_auto_date);
continue;
}
$aiKeywordModel = new AiBlogKeyword();
$keywords = $aiKeywordModel->getValue(['project_id'=>$this->user['project_id']],'keywords');
if(!empty($keywords)){
//核心关键词+网站关键词+白帽关键词
$main_keywords = ProjectKeyword::where('project_id', $project->id)->value('main_keyword');
$main_keywords = explode("\r\n", $main_keywords);
... ... @@ -88,6 +92,11 @@ class AiBlogAutoPublish extends Command
$site_keywords = explode(",", $site_keywords);
$keywords = array_filter(array_merge($main_keywords, $site_keywords, $seo_keywords));
$keywords = array_map('trim', $keywords);
}else{
$keywords = explode("\r\n", $keywords);
$keywords = array_map('trim', $keywords); // 清理空格
$keywords = array_filter($keywords); // 移除空值
}
if (empty($keywords)) {
$this->output("项目{$project->id}未获取到关键词");
continue;
... ...
... ... @@ -82,9 +82,10 @@ class RemainDay extends Command
$list = $projectModel->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','level','uptime','remain_day','version','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day','geo_qualify_num']);
foreach ($list as $item){
$deploy_build = $deployBuildModel->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']);
echo 'start->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL;
$this->output('start->项目id:' . $item['id']);
//todo::暂停的项目停止计时
if(in_array($item['id'],$this->ceaseProjectId)){//暂停的项目
$this->output('暂停的项目id:' . $item['id']);
if(($item['type'] == Project::TYPE_TWO) && ($item['is_remain_today'] == 1)){
$pause_days = $item['pause_days'] + 1;
}
... ... @@ -96,6 +97,8 @@ class RemainDay extends Command
}
//todo::优化项目中途达标计时切换为按天计时
if(in_array($item['id'],$this->projectSwitchId)){
$this->output('中途切换计时的项目id:' . $item['id'].',旧达标天数:'.$item['finish_remain_day'].',新达标天数:'.($item['finish_remain_day'] + 1));
$this->output('中途切换计时的项目id:' . $item['id'].',当前剩余服务时常:'.$item['remain_day'].',剩余时常:'.($item['remain_day'] - 1));
$this->project->edit(['remain_day'=>($item['remain_day'] - 1),'finish_remain_day'=>($item['finish_remain_day'] + 1)],['id'=>$item['id']]);
continue;
}
... ... @@ -103,7 +106,7 @@ class RemainDay extends Command
$this->seoRemainDay($deploy_build,$item);
//默认版本统计
$this->remainDay($item,$deploy_build);
echo 'end->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL;
$this->output('end->项目id:' . $item['id']);
}
return true;
}
... ... @@ -121,14 +124,17 @@ class RemainDay extends Command
//白帽版本的系统
if($deploy_build['seo_plan'] != 0){
if($deploy_build['seo_service_duration'] != 0){
$this->output('白帽计算剩余服务时常:'.$item['id']);
if(in_array($item['id'],$this->bm_projectId) || (in_array( 19,$item['level']))){
$compliance_day = (int)$item['bm_finish_remain_day'];
$seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day'];
$this->output('按白帽达标天数统计:'.$item['id'].',bm达标天数:'.$item['bm_finish_remain_day'].',bm剩余白帽天数:'.$seo_remain_day);
}else{
//按自然日统计
$diff = time() - strtotime($item['uptime']);
$compliance_day = floor($diff / (60 * 60 * 24));
$seo_remain_day = $deploy_build['seo_service_duration'] - $compliance_day;
$this->output('按白帽自然日天数统计:'.$item['id'].',bm达标天数:'.$compliance_day.',bm剩余白帽天数:'.$seo_remain_day);
}
$this->project->edit(['seo_remain_day'=>$seo_remain_day,'bm_finish_remain_day'=>$compliance_day ?? 0],['id'=>$item['id']]);
}
... ... @@ -144,8 +150,10 @@ class RemainDay extends Command
* @time :2025/4/25 14:31
*/
public function remainDay($item,$deploy_build){
$this->output('普通项目计算剩余服务时常:'.$item['id']);
//默认版本统计
if($deploy_build['service_duration'] == 0 || $deploy_build['plan'] == 0){
$this->output('当前项目跳过:'.$item['id']);
return false;
}
//默认版本计算剩余服务时常
... ... @@ -159,17 +167,21 @@ class RemainDay extends Command
$diff = time() - strtotime($opInfo['start_date'] ?? $item['uptime']);
$compliance_day = floor($diff / (60 * 60 * 24));
$remain_day = $deploy_build['service_duration'] - $compliance_day;
$this->output('已开始优化的时间结算:'.$item['id'].',剩余服务时常:'.$remain_day);
}else{
$compliance_day = ($item['finish_remain_day'] ?? 0);
//todo::7.5版本单独计算
if($item['version'] == 7.5 && $deploy_build['seo_plan'] != 0 && $deploy_build['plan'] != 0){
$geoCountModel = new GeoCount();
$is_qualify = $geoCountModel->where('project_id', $item['id'])->orderBy('id', 'desc')->value('is_qualify');
if($compliance_day > 0 && $is_qualify > 0){
$compliance_day = 1;
}
if($item['is_remain_today'] > 0 && $is_qualify > 0){
$remain_day = $item['remain_day'] - 1;
}
$this->output('7.5版本单独计算:'.$item['id'].',剩余服务时常:'.$remain_day);
}else{
$remain_day = $deploy_build['service_duration'] - $compliance_day;
$this->output('优化项目:'.$item['id'].',剩余服务时常:'.$remain_day.',已达标天数:'.$compliance_day);
}
}
}else{
//普通建站项目
... ... @@ -182,11 +194,20 @@ class RemainDay extends Command
}
}
$extend_type = 0;
// if($remain_day < 0 && $deploy_build['service_duration'] != 0){
// $remain_day = 0;
// $extend_type = Project::TYPE_FIVE;
// }
$this->project->edit(['remain_day'=>$remain_day,'extend_type'=>$extend_type,'finish_remain_day'=>$compliance_day ?? 0],['id'=>$item['id']]);
return true;
}
/**
* 输入日志
* @param $message
* @return bool
*/
public function output($message)
{
$message = date('Y-m-d H:i:s') . ' ' . $message . PHP_EOL;
echo $message;
file_put_contents(storage_path('logs/remain_day/') . date('Ymd') . '.log', $message, FILE_APPEND);
return true;
}
}
... ...
... ... @@ -23,6 +23,7 @@ use App\Models\Project\Project;
use App\Models\Project\ProjectAiSetting;
use App\Models\Project\ProjectWhiteHatAffix;
use App\Models\RouteMap\RouteMap;
use App\Models\SeoSetting\LinkData;
use App\Models\Template\BTemplateMain;
use App\Models\Template\TemplateTypeMain;
use App\Models\WebSetting\Translate;
... ... @@ -115,11 +116,23 @@ class lyhDemo extends Command
public function _actionRoute(){
$projectModel = new Project();
$lists = $projectModel->list(['type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
$data = [];
$geoLinkModel = new GeoLink();
foreach ($lists as $item){
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
$data['post_id'] = mt_rand(100000, 999999).$item['id'];
$projectModel->edit(['post_id'=>$data['post_id']],['id'=>$item['id']]);
ProjectServer::useProject($item['id']);
$linkDataModel = new LinkData();
$linkList = $linkDataModel->list();
foreach ($linkList as $link){
$geoLinkModel->add([
'project_id'=>$item['id'],
'url'=>$link['url'],
'type'=>2,
'da'=>$link['da_values'],
'send_time'=>$link['send_time'],
'time'=>$link['time'],
]);
}
DB::disconnect('custom_mysql');
}
return true;
}
... ...
... ... @@ -36,7 +36,7 @@ class SyncTimeFiles extends Command
// $start = '2025-10-14 00:00:00';
$start = '2025-10-25 00:00:00';
$end = '2025-10-31 23:59:59';
$lists = $imagesModel->list(['created_at'=>['between',[$start,$end]]],'id',['path'],'asc');
$lists = $imagesModel->list(['created_at'=>['between',[$start,$end]]],'id',['path'],'desc');
foreach ($lists as $v){
$path = $v['path'];
echo date('Y-m-d H:i:s') . ' | 图片链接:' . $path . PHP_EOL;
... ...
... ... @@ -151,7 +151,7 @@ class InquiryController extends BaseController
}
$result = ReInquiryCount::where('domain', 'like', '%'.$domain.'%')->first();
if($result){
$result->tasks = $result->tasks; //调用访问器
$return = 0; //所有都关闭或删除就不返回
foreach ($result->tasks as $task){
$return += (!$task['is_del'] && $task['status']);
... ...
... ... @@ -6,6 +6,7 @@ use App\Enums\Common\Code;
use App\Enums\Common\Common;
use App\Exceptions\AsideGlobalException;
use App\Http\Controllers\Controller;
use App\Models\Project\Project;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Exceptions\HttpResponseException;
... ... @@ -32,6 +33,7 @@ class BaseController extends Controller
{
$this->request = $request;
$this->param = $this->request->all();
$this->handleIdAndProjectId();
$this->token = $this->request->header('token');
$this->getParam();
$info = Cache::get(Common::MANAGE_TOKEN . $this->token);
... ... @@ -42,6 +44,42 @@ class BaseController extends Controller
}
}
/**
* @remark :project_id+id处理
* @name :handleIdAndProjectId
* @author :lyh
* @method :post
* @time :2025/11/6 09:16
*/
public function handleIdAndProjectId()
{
if(isset($this->param['id']) && !empty($this->param['id']) && !is_array($this->param['id'])){
if (preg_match('/^[A-Za-z]/', $this->param['id'])) {
$id = Cache::get('project_'.$this->param['id']);
if(empty($id)){
$projectModel = new Project();
$id = $projectModel->getValue(['post_id' => $this->param['id']],'id');
if(!empty($id)){
Cache::add('project_'.$this->param['id'], $id, 3600 * 12);
}
}
$this->param['id'] = $id;
}
}
if(isset($this->param['project_id']) && !empty($this->param['project_id']) && !is_array($this->param['project_id'])){
if (preg_match('/^[A-Za-z]/', $this->param['project_id'])) {
$id = Cache::get('project_'.$this->param['project_id']);
if(empty($id)){
$projectModel = new Project();
$id = $projectModel->getValue(['post_id' => $this->param['project_id']],'id');
if(!empty($id)){
Cache::add('project_'.$this->param['project_id'], $id, 3600 * 12);
}
}
$this->param['project_id'] = $id;
}
}
}
/**
* @remark :请求参数处理
... ...
... ... @@ -82,13 +82,15 @@ class GeoConfirmController extends BaseController
public function saveInfo()
{
$this->request->validate([
'id' => 'required',
'project_id'=>'required',
'confirm' => 'required',
'confirm_num' => 'required',
'type' => 'required',
], [
'id.required' => '主键id不能为空',
'project_id.required' => '主键id不能为空',
'confirm.required' => '客户确认内容不能为空',
'confirm_num.max' => '客户确认数量不能为空',
'type.max' => '类型不能为空',
]);
$data = $this->logic->saveConfirmInfo();
$this->response('success', Code::SUCCESS, $data);
... ...
... ... @@ -63,6 +63,7 @@ class OnlineController extends BaseController
'gl_project.title AS title',
'gl_project.channel AS channel',
'gl_project.type AS type',
'gl_project.post_id AS post_id',
'gl_project.created_at AS created_at',
'gl_project.is_upgrade AS is_upgrade',
'gl_project_online_check.id AS online_check_id',
... ...
... ... @@ -197,6 +197,7 @@ class OptimizeController extends BaseController
'gl_project.level AS level',
'gl_project.channel AS channel',
'gl_project.company AS company',
'gl_project.post_id AS post_id',
'gl_project.type AS type',
'gl_project.created_at AS created_at',
'gl_project.is_language AS is_language',
... ... @@ -267,8 +268,10 @@ class OptimizeController extends BaseController
$query = $query->where('gl_project.site_status',$this->map['site_status']);
}
if(isset($this->map['seo_plan'])){
if(is_array($this->map['seo_plan'])){
$query = $query->whereIn('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
if($this->map['seo_plan'] == 0){
$query = $query->where('gl_project_deploy_build.plan','!=',0);
}elseif(is_array($this->map['seo_plan'])){
$query = $query->whereIn('gl_project_deploy_build.seo_plan',$this->map['seo_plan'])->where('gl_project_deploy_build.plan',0);
}else{
$query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
}
... ... @@ -289,7 +292,7 @@ class OptimizeController extends BaseController
$query = $query->whereRaw("FIND_IN_SET(?, gl_project.level) > 0", [$this->map['level']]);
}
if(isset($this->map['online_updated_at']) && !empty($this->map['online_updated_at']) && is_array($this->map['online_updated_at'])){
$query = $query->where('gl_project_deploy_optimize.start_date','>=' ,$this->map['online_updated_at'][0])->where('gl_project_deploy_optimize.start_date','<' ,$this->map['online_updated_at'][1]);
$query = $query->where('gl_project_deploy_optimize.start_date','>=' ,$this->map['online_updated_at'][0])->where('gl_project_deploy_optimize.start_date','<=' ,$this->map['online_updated_at'][1]);
}
if(isset($this->map['special'])){
$query = $query->whereRaw("FIND_IN_SET(?, gl_project_deploy_optimize.special) > 0", [$this->map['special']]);
... ...
... ... @@ -96,6 +96,7 @@ class ProjectController extends BaseController
'gl_project.title AS title',
'gl_project.channel AS channel',
'gl_project.company AS company',
'gl_project.post_id AS post_id',
'gl_project.type AS type',
'gl_project.project_type AS project_type',
'gl_project.extend_type AS extend_type',
... ... @@ -512,7 +513,7 @@ class ProjectController extends BaseController
*/
public function info(ProjectLogic $logic)
{
$data = $logic->getProjectInfo($this->param);
$data = $logic->getProjectInfo();
$this->response('success', Code::SUCCESS, $data);
}
... ...
... ... @@ -32,7 +32,7 @@ class RenewProjectController extends BaseController
*/
public function lists(Project $project){
$map = $this->searchParam($this->map);
$filed = ['id', 'title', 'type' ,'mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at','delete_status'];
$filed = ['id', 'title', 'type' , 'post_id','mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at','delete_status'];
$lists = $project->formatQuery($map)->select($filed)->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('online_check')->paginate($this->row, ['*'], 'page', $this->page);
if(!empty($lists)){
... ...
... ... @@ -5,6 +5,8 @@ namespace App\Http\Controllers\Bside\HomeCount;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\HomeCount\CountLogic;
use App\Models\Project\Project;
class CountController extends BaseController
{
const STATUS_ERROR = 400;
... ... @@ -38,4 +40,16 @@ class CountController extends BaseController
$data['enterprise_service'] = $countLogic->enterprise_service();
return $this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :
* @name :info5172count
* @author :lyh
* @method :post
* @time :2025/11/6 15:10
*/
public function info5172count()
{
}
}
... ...
... ... @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\SeoSetting;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\SeoSetting\LinkDataLogic;
use App\Models\Geo\GeoLink;
use App\Models\SeoSetting\LinkData;
class LinkDataController extends BaseController
... ... @@ -23,7 +24,11 @@ class LinkDataController extends BaseController
* @method :post
* @time :2025/3/14 16:33
*/
public function lists(LinkData $linkData){
public function lists(GeoLink $linkData){
if(!isset($this->map['type']) || empty($this->map['type'])){
$this->map['type'] = $linkData::TYPE_LINK;
}
$this->map['project_id'] = $this->user['project_id'];
$lists = $linkData->lists($this->map,$this->page,$this->row);
$this->response('success',Code::SUCCESS,$lists);
}
... ... @@ -35,7 +40,7 @@ class LinkDataController extends BaseController
* @method :post
* @time :2025/3/14 17:41
*/
public function info(LinkData $linkData){
public function info(GeoLink $linkData){
$this->request->validate([
'id'=>['required'],
],[
... ... @@ -69,7 +74,7 @@ class LinkDataController extends BaseController
* @method :post
* @time :2025/3/14 16:45
*/
public function del(LinkData $linkData){
public function del(GeoLink $linkData){
$this->request->validate([
'id'=>'required|array',
],[
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Logic\Aside;
use App\Enums\Common\Common;
use App\Http\Logic\Logic;
use App\Models\Project\Project;
use Illuminate\Support\Facades\Cache;
/**
... ... @@ -37,6 +38,45 @@ class BaseLogic extends Logic
*/
public function getParam(){
$requestAll = $this->request->all();
$requestAll = $this->handleIdAndProjectId($requestAll);
return $this->success($requestAll);
}
/**
* @remark :处理project参数
* @name :handleIdAndProjectId
* @author :lyh
* @method :post
* @time :2025/11/6 10:41
*/
public function handleIdAndProjectId($param)
{
if(isset($param['id']) && !empty($param['id']) && !is_array($param['id'])){
if (preg_match('/^[A-Za-z]/', $param['id'])) {
$id = Cache::get('project_'.$param['id']);
if(empty($id)){
$projectModel = new Project();
$id = $projectModel->getValue(['post_id' => $param['id']],'id');
if(!empty($id)){
Cache::add('project_'.$param['id'], $id, 3600 * 12);
}
}
$param['id'] = $id;
}
}
if(isset($param['project_id']) && !empty($param['project_id']) && !is_array($param['project_id'])){
if (preg_match('/^[A-Za-z]/', $param['project_id'])) {
$id = Cache::get('project_'.$param['project_id']);
if(empty($id)){
$projectModel = new Project();
$id = $projectModel->getValue(['post_id' => $param['project_id']],'id');
if(!empty($id)){
Cache::add('project_'.$param['project_id'], $id, 3600 * 12);
}
}
$param['project_id'] = $id;
}
}
return $param;
}
}
... ...
... ... @@ -84,7 +84,13 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmInfo()
{
$this->param['status'] = GeoConfirm::STATUS_FINISH;
$this->model->edit($this->param,['id'=>$this->param['id']]);
return $this->success(['id'=>$this->param['id']]);
$info = $this->model->read(['project_id' => $this->param['project_id'],'type'=>$this->param['type']]);
if($info === false){
$id = $this->model->addReturnId($this->param);
}else{
$id = $info['id'];
$this->model->edit($this->param,['id'=>$info['id']]);
}
return $this->success(['id'=>$id]);
}
}
... ...
... ... @@ -39,11 +39,13 @@ class GeoLinkLogic extends BaseLogic
* @time :2025/7/14 16:47
*/
public function getLinkList($map = [],$page = 1,$row = 20,$order = 'id'){
$filed = ['*'];
if(isset($map['url']) && !empty($map['url'])){
$map['url'] = ['like','%'.$map['url'].'%'];
}
$lists = $this->model->lists($map,$page,$row,$order,$filed);
if(!isset($map['type']) || empty($map['type'])){
$map['type'] = GeoLink::TYPE_NEWS;
}
$lists = $this->model->lists($map,$page,$row,$order,['*']);
return $this->success($lists);
}
... ...
... ... @@ -121,10 +121,11 @@ class GeoLogic extends BaseLogic
if(empty($geo_question_count)){
$geo_question_count = 0;
}
$geo_pr_count = GeoLink::where('project_id',$this->param['project_id'])->count();
$geo_pr_count = GeoLink::where('project_id',$this->param['project_id'])->where('type',GeoLink::TYPE_NEWS)->count();
$geo_link_count = GeoLink::where('project_id',$this->param['project_id'])->where('type',GeoLink::TYPE_LINK)->count();
$geo_writings_count = GeoWritings::where('project_id',$this->param['project_id'])->count();
$geo_writings_count += GeoArticle::where('project_id',$this->param['project_id'])->count();
return $this->success(['geo_writings_count'=>$geo_writings_count,'geo_pr_count'=>$geo_pr_count,'geo_question_count'=>$geo_question_count]);
return $this->success(['geo_writings_count'=>$geo_writings_count,'geo_pr_count'=>$geo_pr_count,'geo_question_count'=>$geo_question_count,'geo_link_count'=>$geo_link_count]);
}
}
... ...
... ... @@ -10,6 +10,7 @@
namespace App\Http\Logic\Aside\Project;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoLink;
use App\Models\Project\EnterpriseProduct;
use App\Models\SeoSetting\LinkData;
use App\Services\ProjectServer;
... ... @@ -56,8 +57,7 @@ class EnterpriseProductLogic extends BaseLogic
* @time :2025/4/2 9:08
*/
public function saveLinkData(){
ProjectServer::useProject($this->param['project_id']);
$linkModel = new LinkData();
$linkModel = new GeoLink();
$data = [];
$count = count($this->param['data']);
$error_num = 0;
... ... @@ -68,14 +68,15 @@ class EnterpriseProductLogic extends BaseLogic
}
$data[] = [
'url'=>$v['url'],
'type'=>$linkModel::TYPE_LINK,
'da_values'=>$v['da_values'],
'project_id'=>$this->param['project_id'],
'send_time'=>$v['send_time'] ?? date('Y-m-d H:i:s')
];
}
if(!empty($data)){
$linkModel->insertAll($data);
}
DB::disconnect('custom_mysql');
return $this->success(['success'=>$count,'error'=>$error_num]);
}
}
... ...
... ... @@ -11,6 +11,10 @@ namespace App\Http\Logic\Bside\Ai;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Ai\AiBlogKeyword;
use App\Models\Project\ProjectKeyword;
use App\Models\WebSetting\WebSetting;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
class AiBlogKeywordLogic extends BaseLogic
{
... ... @@ -32,6 +36,22 @@ class AiBlogKeywordLogic extends BaseLogic
public function getKeywordInfo()
{
$data = $this->model->read(['project_id'=>$this->user['project_id']]);
if($data === false){
//核心关键词+网站关键词+白帽关键词
$main_keywords = ProjectKeyword::where('project_id', $this->user['project_id'])->value('main_keyword');
$main_keywords = explode("\r\n", $main_keywords);
$seo_keywords = ProjectKeyword::where('project_id', $this->user['project_id'])->value('seo_keywords');
$seo_keywords = explode("\r\n", $seo_keywords);
$site_keywords = WebSetting::where('project_id', $this->user['project_id'])->value('keyword');
$site_keywords = explode(",", $site_keywords);
$keywords = array_filter(array_merge($main_keywords, $site_keywords, $seo_keywords));
$keywords = array_map('trim', $keywords);
$keywords_string = implode("\n", $keywords);
$data = [
'project_id'=>$this->user['project_id'],
'keywords'=>$keywords_string
];
}
return $this->success($data);
}
... ...
... ... @@ -24,6 +24,9 @@ class GeoQuestionResLogic extends BaseLogic
parent::__construct();
$this->model = new GeoQuestionResult();
$this->param = $this->requestAll;
if($this->user['project_id'] == 5172){
$this->user['project_id'] = 3298;
}
}
/**
... ...
... ... @@ -16,6 +16,7 @@ use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RankData\RankData as RankDataModel;
use App\Models\Service\Service;
use App\Services\ProjectServer;
use Carbon\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
... ... @@ -26,16 +27,20 @@ class CountLogic extends BaseLogic
{
parent::__construct();
$this->model = new Count();
if($this->user['project_id'] == 5172){
$this->user['project_id'] = 3298;
}
}
/**
* @name :(昨日统计数据)yesterday_count
* @name :昨日统计数据 yesterday_count
* @author :lyh
* @method :post
* @time :2023/5/23 17:30
*/
public function yesterday_count(){
$yesterday = Carbon::yesterday()->toDateString();
$param = [
'date' => $yesterday,
'project_id' => $this->user['project_id']
... ... @@ -86,6 +91,7 @@ class CountLogic extends BaseLogic
* @time :2023/5/24 13:33
*/
public function total_count($inquiry_num = ''){
ProjectServer::useProject($this->user['project_id']);
$pv = (new VisitItem())->count();
$ip = (new Visit())->count();
$data = [
... ... @@ -199,6 +205,7 @@ class CountLogic extends BaseLogic
* @time :2023/5/24 15:56
*/
public function access_country_count(){
$customerVisitModel = new Visit();
$data = $customerVisitModel->select('country',DB::raw('COUNT(*) as ip'),DB::raw('SUM(depth) as pv'))
->groupBy('country')
... ...
... ... @@ -40,6 +40,15 @@ use Illuminate\Support\Str;
class RankDataLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
if($this->user['project_id'] == 5172){
$this->user['project_id'] = 3298;
}
}
/**
* 统计数据
* @author zbj
... ...
... ... @@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\SeoSetting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Geo\DomainDa;
use App\Models\Geo\GeoLink;
use App\Models\SeoSetting\LinkData;
use App\Services\Geo\GeoService;
use Illuminate\Support\Carbon;
... ... @@ -29,7 +30,7 @@ class LinkDataLogic extends BaseLogic
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new LinkData();
$this->model = new GeoLink();
}
/**
... ... @@ -46,6 +47,8 @@ class LinkDataLogic extends BaseLogic
$data[] = [
'url'=>$v['url'],
'da_values'=>$v['da_values'],
'type'=>GeoLink::TYPE_LINK,
'project_id'=>$this->user['project_id'],
'send_time'=>$v['send_time'] ?? date('Y-m-d H:i:s')
];
}
... ...
... ... @@ -36,7 +36,9 @@ class GeoConf extends Base
if (empty($optimize)) {
$optimize = ManageHr::where(['status' => ManageHr::STATUS_ONE, 'entry_position' => 46])->pluck('name', 'id')->toArray();
$optimize[11] = '陶婵';
$optimize[207] = '吴雨静';
$optimize[875] = '艾媛媛';
$optimize[893] = '杨汀';
ksort($optimize);
Cache::put($key, $optimize, 3600);
}
... ...
... ... @@ -20,5 +20,8 @@ use App\Models\Base;
*/
class GeoLink extends Base
{
const TYPE_NEWS = 1;//权威新闻
const TYPE_LINK = 2;//外链数据
protected $table = 'gl_geo_link';
}
... ...