作者 刘锟

update

正在显示 37 个修改的文件 包含 711 行增加113 行删除
... ... @@ -77,14 +77,16 @@ class AiBlogAutoPublish extends Command
$this->output("项目{$project->id}未到执行时间" . $next_auto_date);
continue;
}
//核心关键词+网站关键词
//核心关键词+网站关键词+白帽关键词
$main_keywords = ProjectKeyword::where('project_id', $project->id)->value('main_keyword');
$main_keywords = explode("\r\n", $main_keywords);
$seo_keywords = ProjectKeyword::where('project_id', $project->id)->value('seo_keywords');
$seo_keywords = explode("\r\n", $seo_keywords);
ProjectServer::useProject($project->id);
$site_keywords = WebSetting::where('project_id', $project->id)->value('keyword');
DB::disconnect('custom_mysql');
$site_keywords = explode(",", $site_keywords);
$keywords = array_filter(array_merge($main_keywords, $site_keywords));
$keywords = array_filter(array_merge($main_keywords, $site_keywords, $seo_keywords));
$keywords = array_map('trim', $keywords);
if (empty($keywords)) {
$this->output("项目{$project->id}未获取到关键词");
... ...
... ... @@ -87,6 +87,9 @@ class CountProject extends Command
//剩余服务时常
$arr['service_day'] = $projectInfo['remain_day'];
$arr = $this->inquiry($arr,$domain, $project_id,$projectInfo['is_upgrade'] ?? 0);
if($arr === false){
continue;
}
//查询当天数据是否存在 存在则更新
$info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]);
if($info === false){
... ... @@ -146,7 +149,7 @@ class CountProject extends Command
public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade);
if($inquiry_list == false){
return false;
return $arr;
}
// echo date('Y-m-d H:i:s') . '拉取询盘状态:' .json_encode($inquiry_list) . PHP_EOL;
if($inquiry_list['status'] == self::STATUS_ERROR){
... ...
... ... @@ -35,7 +35,7 @@ class RemainDay extends Command
* 按照达标天数收费的项目(白帽)
*/
protected $bm_projectId = [
4247,4299,4310,4215,4038,4084,4148
4247,4299,4310,4215,4038,4084,4148,4178
];
... ... @@ -83,7 +83,7 @@ class RemainDay extends Command
* @time :2025/4/2 10:48
*/
public function saveRemainDay(){
$list = $this->project->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','uptime','remain_day','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']);
$list = $this->project->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','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']);
foreach ($list as $item){
$deploy_build = $this->deployBuild->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;
... ... @@ -120,7 +120,7 @@ class RemainDay extends Command
//白帽版本的系统
if($deploy_build['seo_plan'] == 1){
if($deploy_build['seo_service_duration'] != 0){
if(in_array($item['id'],$this->bm_projectId)){
if(in_array($item['id'],$this->bm_projectId) || (strpos($item['level'], '19') !== false)){
$compliance_day = (int)$item['bm_finish_remain_day'];
$seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day'];
}else{
... ...
... ... @@ -113,12 +113,32 @@ class GeoQuestionRes extends Command
}
// 命中文案
$hit_data[] = $result['text'];
if(!empty($result['annotations'])){
$url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
$title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
$hit_data = array_merge($url, $title, $hit_data);
}
$hit = 0;
//todo::与预期结果是否复合
if(!empty($taskInfo['expect_result'])){
$str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否";
$strResult = $geo_service->getChatResult($str, 'gpt-4o-mini');
if(isset($strResult['text']) && !empty($strResult['text'])){
switch ($strResult['text']){
case '是':
$is_match = 1;
$hit++;
break;
case '否':
$is_match = 2;
break;
default:
$is_match = 0;
break;
}
}
}
$hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data);
if (!empty($hit_keyword['keywords'])) {
$hit++;
... ... @@ -144,6 +164,7 @@ class GeoQuestionRes extends Command
'hit' => $hit ?? 0,
'keywords_num'=>$keyword_num ?? [],
'url_num'=>$url_num ?? [],
'is_match'=>$is_match ?? 0,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
];
... ... @@ -294,6 +315,17 @@ class GeoQuestionRes extends Command
}
/**
* @remark :预期结果对比
* @name :getExpectResult
* @author :lyh
* @method :post
* @time :2025/8/12 13:51
*/
public function getExpectResult($question,$answer,$expect){
$str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否";
}
/**
* 获取待执行任务ID
* @return mixed
*/
... ...
... ... @@ -717,7 +717,7 @@ class RelayInquiry extends Command
$project = Project::getProjectByDomain($domain);
if (empty($project)) {
$this->logChannel()->info('广告任务ID:' . $task['id'] . ', 转发对象:' . $re_website . '非v6链接,转发失败;', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]);
return [[], $lang];
return [[], $lang, ''];
}
$lang = WebLanguage::getLangById($project->main_lang_id ?? 1)['short'];
... ...
... ... @@ -23,6 +23,8 @@ use App\Models\Project\ProjectWhiteHatAffix;
use App\Models\Template\BTemplateMain;
use App\Models\Template\TemplateTypeMain;
use App\Models\WebSetting\WebSetting;
use App\Models\WorkOrder\TicketLog;
use App\Models\WorkOrder\Tickets;
use App\Services\AiBlogService;
use App\Services\CosService;
use App\Services\Geo\GeoService;
... ... @@ -48,13 +50,20 @@ class lyhDemo extends Command
protected $description = '更新路由';
public function handle(){
// $content = "{Introducing the cutting-edge product from Zhejiang Yuexiang Gas Technology Co., Ltd., the Bracket Gas Flowmeter. This innovative gas flowmeter is designed to provide accurate and reliable measurements for a wide range of industrial applications,Equipped with advanced technology and precision components, the Bracket Gas Flowmeter ensures exceptional performance and durability. It offers highly accurate gas flow readings, allowing users to closely monitor and control gas consumption in various processes. The meter's user-friendly interface displays real-time flow rates and totalized flow data, facilitating efficient and convenient data management,With its robust construction and corrosion-resistant materials, the Bracket Gas Flowmeter guarantees long-term reliability, even in harsh operating conditions. It is compatible with various gases such as natural gas, propane, and hydrogen, making it a versatile choice for multiple industries including oil and gas, chemical, and manufacturing,Furthermore, the Bracket Gas Flowmeter is engineered with ease of installation and maintenance in mind. Its compact and space-saving design allows for flexible mounting options, while its modular construction enables quick and hassle-free maintenance. Additionally, it meets international standards for accuracy and safety, ensuring compliance with industry regulations,Choose the Bracket Gas Flowmeter for precise and efficient gas flow measurement, backed by the expertise and commitment of Zhejiang Yuexiang Gas Technology Co., Ltd},{Shop Quality Brackets: Top China Products & Services for Your Needs},4K,高清 --no logo --ar 16:9";
// $midJourneyService = new MidJourneyService();
// $result = $midJourneyService->imagine($content);
$url = 'https://ecdn6-nc.globalso.com/upload/p/1/png/2025-08/688dcebc26a7a59911.png';
$cosService = new CosService();
$data = $cosService->cropAndUploadToCOS($url);
dd($data);
return $this->getExpectResult();
return true;
}
public function getExpectResult(){
$geo_service = new GeoService();
$question = 'Top AI Coffee Robot';
$answer = "Top AI Coffee Robot\" refers to advanced robotic systems that combine **precision automation, artificial intelligence, and specialty coffee expertise** to create high-quality beverages with minimal human intervention. Here's a breakdown of key features, leading examples, and benefits:\n\n### Core Features of Top AI Coffee Robots:\n1. **AI-Driven Customization** \n - Analyzes user preferences (strength, milk type, sweetness) via app profiles or voice commands. \n - Learns from feedback to refine future orders (e.g., \"less bitter than last time\"). \n2. **Robotic Precision Brewing** \n - Industrial arms handle grinding, tamping, steaming milk, and latte art with sub-millimeter accuracy. \n - Sensors monitor temperature, extraction time, and pressure for optimal flavor.";
$expect = "While I don't have specific information on the RobotAnno coffee machine, in general";
$str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否";
$data = $geo_service->getChatResult($str, 'gpt-4o-mini');
if(isset($data['text']) && $data['text'] == '是'){
}
}
/**
... ...
... ... @@ -151,13 +151,12 @@ class SyncProject extends Command
'contract' => json_encode($param['files']),
'bill' => json_encode($param['images']),
];
$seoPlan = Project::seoMap();
if (in_array($param['plan_marketing'], $seoPlan)) {
$data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;
$data['deploy_build']['seo_plan'] = $this->versionSeoData($param['plan_marketing'],$seoPlan);
} else {
$data['deploy_build']['plan'] = $this->versionData($param['plan_marketing'] ?? '');
$data['deploy_build']['seo_plan'] = $this->versionSeoData($param['geo_plan'] ?? '');
if(!empty($data['deploy_build']['plan'])){
$data['deploy_build']['service_duration'] = $param['years'] ?? 0;
$data['deploy_build']['plan'] = $this->versionData($param['plan_marketing']);
}else{
$data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;
}
$renewModel = new ProjectRenew();
$rs = $renewModel->add($data);
... ... @@ -184,7 +183,8 @@ class SyncProject extends Command
}
}
public function versionSeoData($param,$data){
public function versionSeoData($param){
$data = Project::seoMap();
$data = array_flip($data);
if(isset($data[$param])){
return $data[$param];
... ... @@ -242,13 +242,12 @@ class SyncProject extends Command
'bill'=>$param['images']
],
];
$seoPlan = Project::seoMap();
if (in_array($param['plan_marketing'], $seoPlan)) {
$data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;
$data['deploy_build']['seo_plan'] = $this->versionSeoData($param['plan_marketing'],$seoPlan);
} else {
$data['deploy_build']['plan'] = $this->versionData($param['plan_marketing'] ?? '');
$data['deploy_build']['seo_plan'] = $this->versionSeoData($param['geo_plan'] ?? '');
if(!empty($data['deploy_build']['plan'])){
$data['deploy_build']['service_duration'] = $param['years'] ?? 0;
$data['deploy_build']['plan'] = $this->versionData($param['plan_marketing']);
}else{
$data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;
}
DB::beginTransaction();
try {
... ...
... ... @@ -46,16 +46,16 @@ class RankDataLog extends BaseCommands
{
while (true) {
$log_id = Redis::rpop('rank_data_task');
echo $log_id . PHP_EOL;
if (!$log_id) {
sleep(10);
continue;
$log_id = RankDataLogModel::where('status', 0)->value('id');
}
$log = RankDataLogModel::where('id', $log_id)->where('status', 0)->first();
if(!$log){
sleep(10);
continue;
}
try {
$this->output('项目开始:ID'.$log->project_id . ',APINO' . $log->api_no);
$project = Project::find($log->project_id);
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Console\Commands\Tdk;
use App\Exceptions\ValidateException;
use App\Helper\Arr;
use App\Helper\Gpt;
use App\Helper\Translate;
use App\Models\Ai\AiCommand;
use App\Models\Com\NoticeLog;
use App\Models\Com\UpdateNotify;
... ... @@ -14,6 +15,7 @@ use App\Models\Project\AggregateKeywordAffix;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use App\Models\Project\ProjectKeywordAiTask;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -51,6 +53,8 @@ class KeywordPageAiContent extends Command
'折线图',
];
protected $project;
/**
* @return bool
*/
... ... @@ -66,7 +70,7 @@ class KeywordPageAiContent extends Command
echo getmypid() . ' ' . date('Y-m-d H:i:s') . ' start project_id: ' . $project_id . PHP_EOL;
try {
ProjectServer::useProject($project_id);
$this->project = ProjectServer::useProject($project_id);
$update_rows = $this->ai_content($task);
... ... @@ -109,6 +113,10 @@ class KeywordPageAiContent extends Command
$prefix = empty($affix['prefix']) ? explode("\n", $default_affix['prefix']) : explode("\n", $affix['prefix']);
$suffix = empty($affix['suffix']) ? explode("\n", $default_affix['suffix']) : explode("\n", $affix['suffix']);
$lang = WebLanguage::getLangById($this->project['main_lang_id']??1);
$prefix = Translate::tran($prefix, $lang['short']);
$suffix = Translate::tran($suffix, $lang['short']);
if (!$prefix || !$suffix) {
throw new ValidateException('扩展标题前后缀不存在');
}
... ... @@ -193,8 +201,8 @@ class KeywordPageAiContent extends Command
//打乱顺序
shuffle($prefix);
shuffle($suffix);
//标题(title):{聚合页扩展标题前缀} keywords {聚合页扩展标题后缀} {聚合页扩展标题后缀}
//标题(title):{聚合页扩展标题前缀} keywords {聚合页扩展标题后缀} {聚合页扩展标题后缀}
return sprintf('%s %s %s %s', $prefix[0], $title, $suffix[0], $suffix[1]);
}
... ... @@ -211,6 +219,11 @@ class KeywordPageAiContent extends Command
shuffle($this->chart_types);
$prompt = str_replace('{chart_type}', $this->chart_types[0], $prompt);
}
if (strpos($prompt, '{lang}') !== false) {
$lang = WebLanguage::getLangById($this->project['main_lang_id']??1);
$lang = $lang['english'] ?? 'English';
$prompt = str_replace('{lang}', $lang, $prompt);
}
$text = Gpt::instance()->openai_chat_qqs($prompt);
if (!$text) {
... ... @@ -243,7 +256,7 @@ class KeywordPageAiContent extends Command
foreach ($body->childNodes as $child) {
$modifiedHtml .= $dom->saveHTML($child);
}
return $modifiedHtml;
return html_entity_decode($modifiedHtml, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
public function sendNotify($project_id)
... ...
... ... @@ -59,14 +59,15 @@ class RerunSeoTdk extends Command
*/
public function handle()
{
$where = [
'id' => 624
];
$project_ids = Project::where('type', Project::TYPE_TWO)->where($where)->pluck('id')->toArray();
$project_ids = Project::where('type', Project::TYPE_TWO)->where('site_status',0)->where('extend_type',0)->where('delete_status',0)->where('tag_page_version', '>' ,1)->where('uptime', '<=', date('Y-m-d H:i:s'))->pluck('id')->toArray();
foreach ($project_ids as $project_id){
try {
ProjectServer::useProject($project_id);
$this->changeCompanyName($project_id);
$project = ProjectServer::useProject($project_id);
//小语种
if($project['main_lang_id'] != 1){
$this->needTransKeywordPage($project_id);
}
DB::disconnect('custom_mysql');
}catch (\Exception $e){
dump($e->getMessage());
... ... @@ -74,6 +75,13 @@ class RerunSeoTdk extends Command
}
}
public function needTransKeywordPage($project_id)
{
$row = Keyword::whereNotNull('sale_title')->update(['sale_title' => null, 'sale_content' => null, 'count_title'=>null, 'table_html'=>null, 'count_html' => null]);
dump($project_id .' - ' .$row);
}
/**
* 换了公司英文名的
* @author zbj
... ...
<?php
/**
* @remark :
* @name :TicketCount.php
* @author :lyh
* @method :post
* @time :2025/8/7 17:42
*/
namespace App\Console\Commands\Ticket;
use App\Models\Manage\BelongingGroup;
use App\Models\Manage\ManageHr;
use App\Models\Ticket\TicketDailyCount;
use App\Models\Ticket\TicketDailyDeptCount;
use App\Models\Ticket\TicketDailyManageCount;
use App\Models\WorkOrder\TicketLog;
use App\Models\WorkOrder\TicketProject;
use App\Models\WorkOrder\Tickets;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class TicketCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ticket_count {action}';
/**
* The console command description.
*
* @var string
*/
protected $description = '日统计工单';
public $belong = [
1 => [1,2,3,4,5,6,7,8,9],
2 => [10,11,12],
];
/**
* @remark :统计脚本
* @name :handle
* @author :lyh
* @method :post
* @time :2025/8/7 17:45
*/
public function handle(){
$action = $this->argument('action');
if($action == 'manage_action'){
$this->manage_action();
}
if($action == 'dept_action'){
$this->dept_action();
}
if($action == 'yesterday_daily_action'){
$this->yesterday_daily_action();
}
}
/**
* @remark :按管理员统计(只统计技术组)
* @name :manage_action
* @author :lyh
* @method :post
* @time :2025/8/7 17:45
*/
public function manage_action(){
$manageHrModel = new ManageHr();
$manageList = $manageHrModel->list(['status'=>1,'dept_id'=>['in',[1,2]]],'id',['id','dept_id','manage_id','name','nickname']);
$date = Carbon::yesterday()->toDateString(); // 昨日时间
$ticketManageCountModel = new TicketDailyManageCount();
foreach ($manageList as $item){
$average_time = '';
$this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']);
$ticketLogModel = new TicketLog();
$ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
//工单总时长
$timeCount = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1])->sum('end_time');
$ticket_end_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]]);
if(!empty($timeCount)){
$average_time = round($timeCount / $ticket_end_num, 2);
}
//最快完成的时间
$fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time');
//超时工单数量
$timeout_num = $ticketLogModel->counts(['end_at'=>null,'engineer_id'=>$item['manage_id'],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
$complete_num = $ticketLogModel->counts(['end_at'=>['!=',null],'engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
$data = [
'date'=>$date,
'manage_id'=>$item['id'],
'manage_name'=>$item['name'],
'ticket_num'=>$ticket_num,//工单总数量
'average_time'=>$average_time ?? '',//平均完成工单时长
'fastest_time'=>$fastest_time,//最快完成工单时间
'timeout_num'=>$timeout_num,//超时工单数量
'complete_num'=>$complete_num,//完成工单数量
'dept_id'=>$item['dept_id']
];
//查询当前用户是否当日已有记录
$ticketManageInfo = $ticketManageCountModel->read(['date'=>$date,'manage_id'=>$item['id']],['id']);
if($ticketManageInfo === false){
//TODO::执行新增
$ticketManageCountModel->addReturnId($data);
}else{
//TODO::执行编辑
$ticketManageCountModel->edit($data,['id'=>$ticketManageInfo['id']]);
}
}
return true;
}
/**
* @remark :按技术组统计数据
* @name :dept_action
* @author :lyh
* @method :post
* @time :2025/8/8 11:48
*/
public function dept_action(){
$belongingGroupModel = new BelongingGroup();
$groupList = $belongingGroupModel->list(['id'=>['in',[1,2,3,4,5,6,7,8,9]]],'id',['id','name']);
$manageHrModel = new ManageHr();
$ticketLogModel = new TicketLog();
$ticketDailyDeptModel = new TicketDailyDeptCount();
$date = Carbon::yesterday()->toDateString(); // "2025-08-07"
foreach ($groupList as $item){
$average_time = '';
$this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']);
$manageIdArr = $manageHrModel->selectField(['belong_group'=>$item['id'],'status'=>1,'dept_id'=>1],'manage_id');
$ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]);
$timeCount = $ticketLogModel->formatQuery(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1])->sum('end_time');
if(!empty($timeCount)){
$average_time = round($timeCount / $ticket_num, 2);
}
$data = [
'date'=>$date,
'dept_id'=>$item['id'],
'dept_name'=>$item['name'],
'ticket_num'=>$ticket_num ?? 0,
'average_time'=>$average_time ?? ''
];
$deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']);
if($deptInfo === false){
$ticketDailyDeptModel->addReturnId($data);
}else{
$ticketDailyDeptModel->edit($data,['id'=>$deptInfo['id']]);
}
}
return true;
}
/**
* @remark :技术组所有工单记录
* @name :daily_action
* @author :lyh
* @method :post
* @time :2025/8/8 14:33
*/
public function yesterday_daily_action(){
$ticketModel = new Tickets();
$date = Carbon::yesterday()->toDateString(); // "2025-08-07"
$ticket_num = $ticketModel->counts(['id'=>['!=',0]]);
$time_end_num = $ticketModel->counts(['end_at'=>['!=',null]]);//已完成的工单
$time_end_count = $ticketModel->formatQuery(['end_at'=>['!=',null]])->sum('end_time');//已完成工单时长
if(!empty($time_end_count)){
$average_time = round($time_end_count / $time_end_num, 2);
}
$add_num = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);
$untreated_num = $ticketModel->counts(['end_at'=>null]);
$processed_num = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);
$submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side');
$submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side');
$dbResult = DB::table('gl_ticket_projects as p')->leftJoin('gl_tickets as t', 'p.id', '=', 't.project_id')
->select(
'p.project_cate',
DB::raw('COUNT(t.id) as ticket_count')
)
->groupBy('p.project_cate')
->pluck('ticket_count', 'project_cate');
$data = [
'date' => $date,
'ticket_num'=>$ticket_num,
'add_num'=>$add_num,
'untreated_num'=>$untreated_num,
'processed_num'=>$processed_num,
'average_time'=>$average_time ?? '',
'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true),
'source_type'=>json_encode($dbResult,true)
];
$ticketDailyModel = new TicketDailyCount();
$ticketDailyInfo = $ticketDailyModel->read(['date'=>$date],['id']);
if($ticketDailyInfo === false){
$ticketDailyModel->addReturnId($data);
}else{
$ticketDailyModel->edit($data,['id'=>$ticketDailyInfo['id']]);
}
return true;
}
/**
* @remark :日志
* @name :output
* @author :lyh
* @method :post
* @time :2025/8/8 11:43
*/
public function output($message)
{
// Log::channel('ticket_log')->info($message);
echo date('Y-m-d H:i:s') . ' ' . $message . PHP_EOL;
}
}
... ...
... ... @@ -18,7 +18,7 @@ class FetchTicketProjects extends Command
*
* @var string
*/
protected $signature = 'workorder:fetch-ticket-projects {action}';
protected $signature = 'workorder:fetch-Ticket-projects {action}';
/**
* The console command description.
... ...
... ... @@ -1421,3 +1421,22 @@ function getTopDomain ($url) {
return $host;
}
/**
* @remark :两个时间的差值
* @name :diffInHours
* @author :lyh
* @method :post
* @time :2025/8/8 9:10
*/
function diffInHours($startTime, $endTime)
{
$start = new DateTime($startTime);
$end = new DateTime($endTime);
// 计算时间差
$interval = $start->diff($end);
// 总小时数 = 天数 * 24 + 小时数 + 分钟数换算成小数小时
$hours = $interval->days * 24 + $interval->h + ($interval->i / 60);
// 四舍五入保留1位小数
return round($hours, 1);
}
... ...
... ... @@ -37,7 +37,7 @@ class BaseController extends Controller
$info = Cache::get(Common::MANAGE_TOKEN . $this->token);
if(!empty($this->token) && !empty($info)){
$this->manage = $info;
Cache::put(Common::MANAGE_TOKEN . $this->token, $info, 3600 * 6);//更新缓存时间
Cache::put(Common::MANAGE_TOKEN . $this->token, $info, 3600 * 12);//更新缓存时间
$this->uid = $info['id'];
}
}
... ...
... ... @@ -255,7 +255,11 @@ class OptimizeController extends BaseController
$query = $query->where('gl_project.site_status',$this->map['site_status']);
}
if(isset($this->map['seo_plan'])){
$query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
if(is_array($this->map['seo_plan'])){
$query = $query->whereIn('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
}else{
$query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
}
}
if(isset($this->map['main_lang_id'])){
$query = $query->where('gl_project.main_lang_id',$this->map['main_lang_id']);
... ...
... ... @@ -23,6 +23,7 @@ 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\GeoLink;
use App\Models\HomeCount\Count;
use App\Models\Industry\ProjectIndustry;
use App\Models\Inquiry\InquirySet;
... ... @@ -142,7 +143,11 @@ class ProjectController extends BaseController
* @time :2023/12/29 17:14
*/
public function orderByList($query){
$query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc');
if(isset($this->map['seo_plan']) && $this->map['seo_plan'] == 1){
$query = $query->orderBy('gl_project.cooperate_date', 'desc')->orderBy('gl_project.id', 'desc');
}else{
$query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc');
}
return $query;
}
... ... @@ -314,7 +319,7 @@ class ProjectController extends BaseController
}
}
if(isset($this->map['seo_plan'])){
$query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
$query = $query->where('gl_project_deploy_build.seo_plan','!=',0);
}
if(isset($this->map['site_status'])){
$query = $query->where('gl_project.site_status',$this->map['site_status']);
... ... @@ -329,6 +334,15 @@ class ProjectController extends BaseController
if(isset($this->map['project_type'])){
$query = $query->where('gl_project.project_type',$this->map['project_type']);
}
if(isset($this->param['geo'])){
if($this->param['geo'] == 1){
$query = $query->where('gl_project.geo_status',1);
}else{
$ids = GeoLink::pluck('project_id')->unique()->values()->all();
$query = $query->whereIn('gl_project.id',$ids);
}
}
return $query;
}
... ... @@ -765,13 +779,15 @@ class ProjectController extends BaseController
* @author zbj
* @date 2023/9/11
*/
public function getProjectByChannel(){
public function getProjectByChannel(Request $request){
$id = $this->param['id'] ?? '';
$notice_order_id = $this->param['notice_order_id'] ?? '';
$source_id = $this->param['channel_id'] ?? 0; //原系统渠道id
$size = $this->param['page_size'] ?? 20;
$type = $this->param['type'] ?? '';
$company = $this->param['company'] ?? '';
$order_by_field = $request->input('order_by_field', 'id');
$order_by_sort = $request->input('order_by_sort', 'desc');
if(!$source_id && !$id){
$this->response('参数异常',Code::SYSTEM_ERROR);
... ... @@ -814,7 +830,7 @@ class ProjectController extends BaseController
if ($notice_order_id) {
$query->whereIn('notice_order_id', $notice_order_id);
}
})->orderBy('id', 'desc')->paginate($size)->toArray();
})->orderBy($order_by_field, $order_by_sort)->paginate($size)->toArray();
$list = [];
foreach ($data['list'] as $item){
$domain = '';
... ...
<?php
/**
* @remark :
* @name :TicketController.php
* @author :lyh
* @method :post
* @time :2025/8/11 10:46
*/
namespace App\Http\Controllers\Aside\Ticket;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Ticket\TicketLogic;
use Illuminate\Http\Request;
class TicketController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new TicketLogic();
}
/**
* @remark :统计记录(今日)
* @name :ticketCount
* @author :lyh
* @method :post
* @time :2025/8/11 10:47
*/
public function ticketCount(){
$data['daily'] = $this->logic->getTicketCount();
$data['list'] = $this->logic->getDailyTicketCount();
$data['ticket'] = $this->logic->getTicketList();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :技术组
* @name :manageTicketCount
* @author :lyh
* @method :post
* @time :2025/8/11 14:24
*/
public function manageTicketCount(){
$this->request->validate([
'dept_id' => 'required',
],[
'dept_id.required' => '技术组id',
]);
$this->order = 'ticket_num';
$sort = $this->map['sort'] ?? 'desc';
$data = $this->logic->getManageTicketCount($this->map,$this->order,$sort);
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -67,13 +67,21 @@ class AsideTicketController extends BaseController
});
});
});
//TODO::用户部门搜索
if(isset($this->param['dept_id']) && !empty($this->param['dept_id'])){
$manageHrModel = new ManageHr();
$manageIdArr = $manageHrModel->selectField(['dept_id'=>$this->param['dept_id'],'status'=>1],'manage_id');
$query->whereHas('logs', function ($q) use ($manageIdArr) {
$q->whereIn('engineer_id', $manageIdArr);
});
}
// 添加排序功能
$query->orderBy('status', 'asc');
// $query->orderBy('id', 'desc');
$sortField = $request->input('sort_field', 'plan_end_at');
$sortOrder = strtolower($request->input('sort_order', 'asc'));
$query->orderBy($sortField, $sortOrder);
// 添加次要排序:按状态升序排列
$query->orderBy('status', 'asc');
if ($sortField != 'plan_end_at') $query->orderBy('plan_end_at', 'asc');
$lists = $query->paginate($this->row, ['*'], 'page', $this->page);
$this->response('success', Code::SUCCESS, $lists);
}
... ... @@ -177,6 +185,7 @@ class AsideTicketController extends BaseController
$ticket->star = $request->input('star', 3);
$ticket->plan_end_at = $request->input('plan_end_at', null);
$ticket->close_wechat = $request->input('close_wechat', false);
$ticket->num = $request->input('num', 0);
$ticket->save();
// 分配工单参与人
... ... @@ -234,13 +243,16 @@ class AsideTicketController extends BaseController
$ticket->plan_end_at = $request->input('plan_end_at');
if ($request->input('status'))
$ticket->status = $request->input('status');
if ($request->input('num'))
$ticket->num = $request->input('num',0);
if ($ticket->status == Tickets::STATUS_COMPLETED)
{
// 完成工单,把子任务里面未完成的工单改为完成
$ticket->end_at = now();
$ticket->end_time = diffInHours($ticket->created_at,now());
$ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED)->where('is_engineer', 1)
->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]);
->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now(),'end_time'=>$ticket->end_time]);
// 推动微信通知
$project = $ticket->project;
if ($project->wechat_switch && !$ticket->close_wechat)
... ...
... ... @@ -70,6 +70,7 @@ class AsideTicketLogController extends BaseController
{
// 我的工单标记为已完成
$log->end_at = now();
$log->end_time = diffInHours($ticket->created_at,now());
}
}
if ($request->input('reply') !== null)
... ... @@ -91,6 +92,7 @@ class AsideTicketLogController extends BaseController
{
$ticket->status = Tickets::STATUS_COMPLETED;
$ticket->end_at = now();
$ticket->end_time = diffInHours($ticket->created_at,$ticket->end_at);
$project = $ticket->project;
if ($project->wechat_switch && !$ticket->close_wechat)
$project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!");
... ...
... ... @@ -178,7 +178,7 @@ class LoginController extends BaseController
$wechat = new Wechat();
$accessToken = $wechat->getAccessToken();
$data = $wechat->setQrcode('global-v6_'.$this->param['type'].'_'.$this->param['id'],$accessToken);
if(!empty($data)){
if(!empty($data) && isset($data['ticket'])){
$data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".$data['ticket'];
}
$this->response('success',Code::SUCCESS,$data);
... ...
... ... @@ -41,13 +41,20 @@ class WebSettingImageController extends BaseController
public function save(WebSettingImage $webSettingImage){
try {
foreach ($this->param['data'] as $v){
if(isset($v['id']) && !empty($v['id'])){
$v['image'] = str_replace_url($v['image']);
$webSettingImage->edit($v,['id'=>$v['id']]);
}else{
$v['project_id'] = $this->user['project_id'];
$v['image'] = str_replace_url($v['image']);
$webSettingImage->add($v);
$info = $webSettingImage->read(['type'=>$v['type']],'id');
if($info === false){
$v['project_id'] = $this->user['project_id'];
$v['image'] = str_replace_url($v['image']);
$webSettingImage->add($v);
}else{
$v['image'] = str_replace_url($v['image']);
$webSettingImage->edit($v,['id'=>$info['id']]);
}
}
}
}catch (\Exception $e){
... ...
<?php
/**
* @remark :
* @name :TestController.php
* @author :lyh
* @method :post
* @time :2024/11/5 9:44
*/
namespace App\Http\Controllers\Bside;
use App\Enums\Common\Code;
use App\Helper\FormGlobalsoApi;
use App\Helper\PayStripeApi;
use App\Helper\Translate;
use App\Http\Logic\Bside\News\NewsLogic;
use App\Models\Ai\AiBlog;
use App\Models\Channel\Channel;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\CustomModule\CustomModuleExtentContent;
use App\Models\Domain\DomainInfo;
use App\Models\ExtentModule\ExtensionModuleValue;
use App\Models\HomeCount\Count;
use App\Models\Manage\ManageHr;
use App\Models\Project\CountAllProject as AllProject;
use App\Models\Project\Project;
use App\Models\Project\ProjectAiSetting;
use App\Models\RouteMap\RouteMap;
use App\Services\AiBlogService;
use App\Services\AiVideoService;
use App\Services\RapIdApIService;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
class TestController extends BaseController
{
/**
* @remark :创建项目
* @name :createProject
* @author :lyh
* @method :post
* @time :2025/2/13 16:34
*/
public function ceshi(){
$hrModel = new ManageHr();
$data = $hrModel->accordIdGetLeader($this->param['id']);
$this->response('success',Code::SUCCESS,$data);
}
}
... ... @@ -83,7 +83,7 @@ class LoginLogic extends BaseLogic
$manage['special'] = $this->getSpecialMenu($manage['id']);
//岗位
$manage['entry_position'] = ManageHr::where('manage_id', $manage['id'])->value('entry_position')?:0;
Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6);
Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 12);
return $this->success($manage->makeVisible('token')->toArray());
}
... ...
<?php
/**
* @remark :
* @name :TicketLogic.php
* @author :lyh
* @method :post
* @time :2025/8/11 10:54
*/
namespace App\Http\Logic\Aside\Ticket;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Manage\ManageHr;
use App\Models\Project\Project;
use App\Models\Ticket\TicketDailyCount;
use App\Models\Ticket\TicketDailyDeptCount;
use App\Models\Ticket\TicketDailyManageCount;
use App\Models\WorkOrder\TicketLog;
use App\Models\WorkOrder\TicketProject;
use App\Models\WorkOrder\Tickets;
use Illuminate\Support\Carbon;
class TicketLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
}
/**
* @remark :获取今日统计数据
* @name :getTicketCount
* @author :lyh
* @method :post
* @time :2025/8/11 10:54
*/
public function getTicketCount(){
$data = [];
$ticketModel = new Tickets();
$data['ticket_num'] = $ticketModel->count();//工单总数
$date = date('Y-m-d');//今日时间
$data['add_num'] = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日新增工单
$data['processed_num'] = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日已处理工单
$data['untreated_num'] = $ticketModel->counts(['end_at'=>null]);//今日未处理工单
$submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side');
$submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side');
$data['source'] = ['a'=>$submit_a_side,'b'=>$submit_b_side];
return $this->success($data);
}
/**
* @remark :按日统计数据
* @name :getDailyTicketCount
* @author :lyh
* @method :post
* @time :2025/8/11 10:57
*/
public function getDailyTicketCount(){
$date = Carbon::yesterday()->toDateString(); //昨日时间
$dailyModel = new TicketDailyCount();
$dailyList = $dailyModel->list([],'date',['*'],'desc',5);//取最近5条数据
$manageModel = new TicketDailyManageCount();
$manageList = $manageModel->list(['date'=>$date,'ticket_num'=>['!=',0],'average_time'=>['!=','']],'average_time',['*'],'asc',5);//取最近5条数据
$deptModel = new TicketDailyDeptCount();
$deptList = $deptModel->list(['date'=>$date,'ticket_num'=>['!=',0]],'average_time',['*'],'asc',5);
$data = ['daily'=>$dailyList,'manage'=>$manageList,'dept'=>$deptList];
return $this->success($data);
}
/**
* @remark :获取随机工单列表(20条)
* @name :ticketList
* @author :lyh
* @method :post
* @time :2025/8/12 11:06
*/
public function getTicketList(){
$ticketsList = Tickets::select(['project_id','title','end_at','end_time','id'])->inRandomOrder()->limit(20)->get();
$projectModel = new TicketProject();
$ticketLogModel = new TicketLog();
$manageModel = new ManageHr();
foreach ($ticketsList as $key => $item){
$item['project_name'] = $projectModel->getValue(['id'=>$item['project_id']],'title');
$engineer_id = $ticketLogModel->getValue(['ticket_id'=>$item['id'],'is_engineer'=>1],'engineer_id');
if(!empty($engineer_id)){
$item['manage_name'] = $manageModel->getValue(['manage_id'=>$engineer_id],'name');
}else{
$item['manage_name'] = '未分配';
}
$ticketsList[$key] = $item;
$item['status'] = (empty($item['end_at']) ? '未完成' : '完成');
}
return $this->success($ticketsList);
}
/**
* @remark :根据技术组获取
* @name :getManageTicketCount
* @author :lyh
* @method :post
* @time :2025/8/11 14:41
*/
public function getManageTicketCount($map,$order = 'ticket_num',$desc = 'desc'){
$manageModel = new TicketDailyManageCount();
unset($map['sort']);
$map['date'] = Carbon::yesterday()->toDateString();
$manageList = $manageModel->list($map,$order,['*'],$desc);
return $this->success($manageList);
}
}
... ...
... ... @@ -48,7 +48,7 @@ class GeoQuestionResLogic extends BaseLogic
*/
public function getResultList($map = [],$page = 1,$row = 20){
$map['project_id'] = $this->user['project_id'];
$filed = ['id','project_id','question_id','platform','question','en_question','keywords','url','created_at','updated_at'];
$filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','created_at','updated_at'];
if(!empty($map['created_at'])){
$map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']];
$this->model = new GeoQuestionLog();
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Http\Logic\Bside\HomeCount;
use App\Helper\FormGlobalsoApi;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Template\BCustomTemplate;
use App\Models\Visit\Visit;
... ... @@ -14,6 +15,7 @@ use App\Models\Project\Project;
use App\Models\RankData\RankData as RankDataModel;
use App\Models\Service\Service;
use Carbon\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class CountLogic extends BaseLogic
... ... @@ -41,6 +43,17 @@ class CountLogic extends BaseLogic
$info = $this->model->read(['project_id' => $this->user['project_id']],
['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
}
$inquiry_num = Cache::get('inquiry_num_'.$this->user['project_id']);
if(empty($inquiry_num)){
$domain = parse_url($this->user['domain'], PHP_URL_HOST); // 直接取域名部分
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$this->user['is_upgrade']);
if($inquiry_list !== false){
if($inquiry_list['status'] != 400){
$info['inquiry_num'] = $inquiry_list['data']['count'];
Cache::add('inquiry_num_'.$this->user['project_id'],$inquiry_list['data']['count'],3600);
}
}
}
//获取项目的剩余时长
$projectModel = new Project();
$projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']);
... ...
... ... @@ -51,7 +51,11 @@ class TranslateLogic extends BaseLogic
return $this->success($data);
}
// 需要校对路由
$url = $this->user['domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
if($this->user['project_id'] == 3778){
$url = $this->user['test_domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
}else{
$url = $this->user['domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
}
// 需要校对语种
$languageInfo = $this->getLanguage($this->param['language_id']);
// 原始校对内容
... ... @@ -139,7 +143,11 @@ class TranslateLogic extends BaseLogic
}
return $this->success($data);
}
$url = $this->user['domain'].(($this->param['url'] != '/') ? $this->param['url'] : '');
if($this->user['project_id'] == 3778){
$url = $this->user['test_domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
}else{
$url = $this->user['domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
}
$param = $this->getRouteSource($this->param['url']);
$param['language_id'] = $this->param['language_id'];
$param['type'] = $this->param['type'];
... ...
... ... @@ -292,12 +292,14 @@ class UserLoginLogic
$info['project_location'] = $project['project_location'];
$info['file_cdn'] = $project['deploy_build']['file_cdn'];
$info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0;
$info['seo_service_duration'] = $project['deploy_build']['seo_service_duration'] ?? 0;
$info['is_comment'] = $project['deploy_build']['is_comment'] ?? 0;
$info['is_ai_blog_send'] = $project['deploy_optimize']['is_ai_blog_send'] ?? 0;
$info['tech_leader'] = $project['deploy_optimize']['tech_leader'] ?? 0;
$manageModel = new ManageHr();
$info['tech_leader_name'] = $manageModel->getName($project['deploy_optimize']['tech_leader'] ?? 0);
$info['remain_day'] = $project['remain_day'] ?? 0;
$info['seo_remain_day'] = $project['seo_remain_day'] ?? 0;
$info['project_created_at'] = $project['created_at'];
$info['type'] = $project['type'] ?? 1;
if($info['is_customized'] == 1){
... ...
... ... @@ -4,11 +4,13 @@ namespace App\Models\Inquiry;
use App\Helper\Arr;
use App\Helper\Translate;
use App\Models\Base;
use App\Utils\HttpUtils;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
/**
* Class InquiryRelateDomain
... ... @@ -59,6 +61,22 @@ class InquiryRelateDomain extends Base
}
Cache::put($list_cache_key, $data, 3600);
}
if(empty($data[$domain])){
$domainPrefix = explode(".",$domain);
if (!empty($domainPrefix)){
if($domainPrefix[0] == 'm'){
$domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
}else{
$isLang = Translate::getTls($domainPrefix[0]);
if ($isLang) {
$domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
}
}
}
if(!Str::startsWith($domain, 'www')){
$domain = 'www.' . $domain;
}
}
return $data[$domain]??'';
}
}
... ...
... ... @@ -44,7 +44,10 @@ class AiVideoTask extends Base
*/
public function videoFrequency(){
return [
1 => '5-7',
1 => '3-4',
2 => '5-7',
3 => '7-10',
2 => '10-15',
];
}
}
... ...
... ... @@ -139,7 +139,9 @@ class Project extends Base
{
return [
1 => 'GEO标准版',
2 => 'GEO商务版'
2 => 'GEO商务版',
3 => '白帽SEO版',
9 => 'GEO体验版'
];
}
/**
... ...
<?php
/**
* @remark :
* @name :TicketDailyCount.php
* @author :lyh
* @method :post
* @time :2025/8/7 17:50
*/
namespace App\Models\Ticket;
use App\Helper\Arr;
use App\Models\Base;
/**
* @remark :工单日统计
* @name :TicketDailyCount
* @author :lyh
* @method :post
* @time :2025/8/7 17:51
*/
class TicketDailyCount extends Base
{
protected $table = 'gl_ticket_daily_count';
public function getSourceAttribute($value)
{
return Arr::s2a($value);
}
public function getSourceTypeAttribute($value)
{
return Arr::s2a($value);
}
}
... ...
<?php
/**
* @remark :
* @name :TicketDailyDeptCount.php
* @author :lyh
* @method :post
* @time :2025/8/7 17:51
*/
namespace App\Models\Ticket;
use App\Models\Base;
/**
* @remark :工单日统计:按照技术组统计
* @name :TicketDailyDeptCount
* @author :lyh
* @method :post
* @time :2025/8/7 17:51
*/
class TicketDailyDeptCount extends Base
{
protected $table = 'gl_ticket_daily_dept_count';
}
... ...
<?php
/**
* @remark :
* @name :TicketDailyManageCount.php
* @author :lyh
* @method :post
* @time :2025/8/7 17:52
*/
namespace App\Models\Ticket;
use App\Models\Base;
/**
* @remark :工单日统计:按照人员统计
* @name :TicketDailyManageCount
* @author :lyh
* @method :post
* @time :2025/8/7 17:53
*/
class TicketDailyManageCount extends Base
{
protected $table = 'gl_ticket_daily_manage_count';
}
... ...
... ... @@ -84,6 +84,7 @@ class Tickets extends Base
if ($log && $log->is_engineer != in_array($engineer_id, $engineer_ids))
{
$log->is_engineer = in_array($engineer_id, $engineer_ids);
$log->plan_end_at = $this->plan_end_at; // 新增时写入 plan_end_at
$log->save();
}else
{
... ... @@ -91,6 +92,7 @@ class Tickets extends Base
$log = new TicketLog();
$log->engineer_id = $engineer_id;
$log->is_engineer = in_array($engineer_id, $engineer_ids);
$log->plan_end_at = $this->plan_end_at; // 新增时写入 plan_end_at
$this->logs()->save($log);
}
}catch (\Exception $exception){
... ...
... ... @@ -27,7 +27,7 @@ class MessagePush extends Base
const TYPE_INQUIRY = 'inquiry';
const TYPE_WEEK = 'week';
const TYPE_TICKET = 'ticket';
const TYPE_TICKET = 'Ticket';
const TYPE_DOMAIN = 'domain';
//设置关联表名
/**
... ...
... ... @@ -632,7 +632,11 @@ Route::middleware(['aloginauth'])->group(function () {
// 流量统计
Route::any('/flow', [Aside\Project\StatisticsController::class, 'flow'])->name('admin.statistics_flow');
});
//ticket
Route::prefix('ticket_count')->group(function () {
Route::any('/ticketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'ticketCount'])->name('ticket_count_ticketCount');
Route::any('/manageTicketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'manageTicketCount'])->name('ticket_count_manageTicketCount');
});
});
//无需登录验证的路由组
... ...