Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
23 个修改的文件
包含
273 行增加
和
49 行删除
| @@ -41,18 +41,36 @@ class lyhDemo extends Command | @@ -41,18 +41,36 @@ class lyhDemo extends Command | ||
| 41 | protected $description = '更新路由'; | 41 | protected $description = '更新路由'; |
| 42 | 42 | ||
| 43 | public function handle(){ | 43 | public function handle(){ |
| 44 | - //获取 | ||
| 45 | - $keywordPrefixModel = new KeywordPrefix(); | ||
| 46 | - $lists = $keywordPrefixModel->list(['project_id'=>0,'id'=>['<',29]]); | ||
| 47 | - $whiteModel = new ProjectWhiteHatAffix(); | ||
| 48 | - foreach ($lists as $val) { | ||
| 49 | - echo date('Y-m-d H:i:s') . '开始--项目的id:' . $val['id'] . PHP_EOL; | ||
| 50 | - $data = [ | ||
| 51 | - 'project_id'=>0, | ||
| 52 | - 'name'=>$val['keyword'], | ||
| 53 | - 'type'=>$val['type'], | ||
| 54 | - ]; | ||
| 55 | - $whiteModel->add($data); | 44 | + return $this->aggregate_keyword_affix(); |
| 45 | + } | ||
| 46 | + | ||
| 47 | + /** | ||
| 48 | + * @remark :获取数据 | ||
| 49 | + * @name :aggregate_keyword_affix | ||
| 50 | + * @author :lyh | ||
| 51 | + * @method :post | ||
| 52 | + * @time :2025/6/26 17:58 | ||
| 53 | + */ | ||
| 54 | + public function aggregate_keyword_affix(){ | ||
| 55 | + $projectModel = new Project(); | ||
| 56 | + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,4,6]]], 'id', ['id']); | ||
| 57 | + $keywordAffixModel = new AggregateKeywordAffix(); | ||
| 58 | + foreach ($lists as $val){ | ||
| 59 | + $info = $keywordAffixModel->read(['project_id'=>$val['id']]); | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + $prefix = "How To find"."\n"."Why Choose"."\n"."China Top"."\n"."Best Way To Choose"."\n"."Methods To Choose"; | ||
| 63 | + $suffix = "Manufacturer"."\n"."Supplier"."\n"."Products"."\n"."Factory"; | ||
| 64 | + if($info === false){ | ||
| 65 | + echo '执行的项目id:'.$val['id'].PHP_EOL; | ||
| 66 | + $data = [ | ||
| 67 | + 'project_id'=>$val['id'], | ||
| 68 | + 'prefix'=>$prefix, | ||
| 69 | + 'suffix'=>$suffix, | ||
| 70 | + ]; | ||
| 71 | + $keywordAffixModel->addReturnId($data); | ||
| 72 | + } | ||
| 73 | + | ||
| 56 | } | 74 | } |
| 57 | return true; | 75 | return true; |
| 58 | } | 76 | } |
| @@ -52,7 +52,7 @@ class GeneratePage extends Command | @@ -52,7 +52,7 @@ class GeneratePage extends Command | ||
| 52 | $noticeModel = new NoticeLog(); | 52 | $noticeModel = new NoticeLog(); |
| 53 | while (true){ | 53 | while (true){ |
| 54 | $task_id = $this->getTaskId(); | 54 | $task_id = $this->getTaskId(); |
| 55 | - if (empty($noticeInfo)) { | 55 | + if (empty($task_id)) { |
| 56 | sleep(10); | 56 | sleep(10); |
| 57 | continue; | 57 | continue; |
| 58 | } | 58 | } |
| @@ -90,16 +90,17 @@ class GeneratePage extends Command | @@ -90,16 +90,17 @@ class GeneratePage extends Command | ||
| 90 | */ | 90 | */ |
| 91 | public function getTaskId() | 91 | public function getTaskId() |
| 92 | { | 92 | { |
| 93 | - $task_id = Redis::rpop('generate_page_id'); | 93 | + $task_id = Redis::rpop('generate_page'); |
| 94 | + echo '任务id:'.$task_id.PHP_EOL; | ||
| 94 | if (empty($task_id)) { | 95 | if (empty($task_id)) { |
| 95 | $noticeModel = new NoticeLog(); | 96 | $noticeModel = new NoticeLog(); |
| 96 | - $ids = $noticeModel->selectField(['status'=>0],'id'); | 97 | + $ids = $noticeModel->selectField(['status'=>0,'type'=>NoticeLog::GENERATE_PAGE],'id'); |
| 97 | if(!empty($ids)){ | 98 | if(!empty($ids)){ |
| 98 | foreach ($ids as $id) { | 99 | foreach ($ids as $id) { |
| 99 | - Redis::lpush('generate_page_id', $id); | 100 | + Redis::lpush('generate_page', $id); |
| 100 | } | 101 | } |
| 101 | } | 102 | } |
| 102 | - $task_id = Redis::rpop('generate_page_id'); | 103 | + $task_id = Redis::rpop('generate_page'); |
| 103 | } | 104 | } |
| 104 | return $task_id; | 105 | return $task_id; |
| 105 | } | 106 | } |
| @@ -36,16 +36,9 @@ class InitKeywordComment extends Command | @@ -36,16 +36,9 @@ class InitKeywordComment extends Command | ||
| 36 | public $number = 100; | 36 | public $number = 100; |
| 37 | 37 | ||
| 38 | public function handle(){ | 38 | public function handle(){ |
| 39 | - $projectModel = new Project(); | ||
| 40 | - $lists = $projectModel->list(['delete_status' => 0,'id'=>['<',1368],'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']); | ||
| 41 | - foreach ($lists as $val) { | ||
| 42 | - echo date('Y-m-d H:i:s') . '开始--项目的id:' . $val['id'] . PHP_EOL; | ||
| 43 | - $this->_action($val['id']); | ||
| 44 | - } | ||
| 45 | - return true; | ||
| 46 | $keywordCommentModel = new AggregateKeywordComment(); | 39 | $keywordCommentModel = new AggregateKeywordComment(); |
| 47 | while (true){ | 40 | while (true){ |
| 48 | - $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMON)->where('status', NoticeLog::STATUS_PENDING)->get(); | 41 | + $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMENT)->where('status', NoticeLog::STATUS_PENDING)->get(); |
| 49 | if(empty($list)){ | 42 | if(empty($list)){ |
| 50 | sleep(200); | 43 | sleep(200); |
| 51 | continue; | 44 | continue; |
| @@ -7,6 +7,7 @@ use App\Helper\Arr; | @@ -7,6 +7,7 @@ use App\Helper\Arr; | ||
| 7 | use App\Helper\Gpt; | 7 | use App\Helper\Gpt; |
| 8 | use App\Models\Ai\AiCommand; | 8 | use App\Models\Ai\AiCommand; |
| 9 | use App\Models\Com\NoticeLog; | 9 | use App\Models\Com\NoticeLog; |
| 10 | +use App\Models\Com\UpdateNotify; | ||
| 10 | use App\Models\Domain\DomainInfo; | 11 | use App\Models\Domain\DomainInfo; |
| 11 | use App\Models\Product\Keyword; | 12 | use App\Models\Product\Keyword; |
| 12 | use App\Models\Project\AggregateKeywordAffix; | 13 | use App\Models\Project\AggregateKeywordAffix; |
| @@ -133,7 +134,7 @@ class KeywordPageAiContent extends Command | @@ -133,7 +134,7 @@ class KeywordPageAiContent extends Command | ||
| 133 | } | 134 | } |
| 134 | Redis::expire($cache_key, 120); | 135 | Redis::expire($cache_key, 120); |
| 135 | 136 | ||
| 136 | - $keyword = Keyword::where('id', $id)->select(['id', 'title', 'sale_title', 'sale_content', 'table_html', 'count_title', 'count_html'])->first(); | 137 | + $keyword = Keyword::where('id', $id)->select(['id', 'title', 'sale_title', 'sale_content', 'table_html', 'count_title', 'count_html', 'route'])->first(); |
| 137 | 138 | ||
| 138 | echo getmypid() . ' ' . date('Y-m-d H:i:s') . ' id:' . $keyword['id'] . ' project_id:' . $task->project_id . PHP_EOL; | 139 | echo getmypid() . ' ' . date('Y-m-d H:i:s') . ' id:' . $keyword['id'] . ' project_id:' . $task->project_id . PHP_EOL; |
| 139 | 140 | ||
| @@ -171,6 +172,8 @@ class KeywordPageAiContent extends Command | @@ -171,6 +172,8 @@ class KeywordPageAiContent extends Command | ||
| 171 | } | 172 | } |
| 172 | if ($update) { | 173 | if ($update) { |
| 173 | $keyword->save(); | 174 | $keyword->save(); |
| 175 | + //tdk已更新的数据,存入按需更新表 | ||
| 176 | + UpdateNotify::addUpdateItem($task->project_id, 'product_keyword', $keyword['route']); | ||
| 174 | $update_rows++; | 177 | $update_rows++; |
| 175 | } | 178 | } |
| 176 | } | 179 | } |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Console\Commands\WorkOrder; | ||
| 4 | + | ||
| 5 | +use App\Models\ProjectAssociation\ProjectAssociation; | ||
| 6 | +use App\Models\Workchat\MessagePush; | ||
| 7 | +use App\Models\WorkOrder\Tickets; | ||
| 8 | +use Illuminate\Console\Command; | ||
| 9 | + | ||
| 10 | +class PushNotify extends Command | ||
| 11 | +{ | ||
| 12 | + /** | ||
| 13 | + * The name and signature of the console command. | ||
| 14 | + * | ||
| 15 | + * @var string | ||
| 16 | + */ | ||
| 17 | + protected $signature = 'workorder:push-notify'; | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * The console command description. | ||
| 21 | + * | ||
| 22 | + * @var string | ||
| 23 | + */ | ||
| 24 | + protected $description = 'tickets push notify'; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * Create a new command instance. | ||
| 28 | + * | ||
| 29 | + * @return void | ||
| 30 | + */ | ||
| 31 | + public function __construct() | ||
| 32 | + { | ||
| 33 | + parent::__construct(); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * Execute the console command. | ||
| 38 | + * | ||
| 39 | + * @return int | ||
| 40 | + */ | ||
| 41 | + public function handle() | ||
| 42 | + { | ||
| 43 | + while (true) { | ||
| 44 | + try { | ||
| 45 | + $tick = Tickets::where('ding', 0) | ||
| 46 | + ->where('submit_side', 2) | ||
| 47 | +// ->where('project_id', 1) | ||
| 48 | + ->first(); | ||
| 49 | + if (!$tick) { | ||
| 50 | + echo now() . " WARNING | 没有待推送的工单\n"; | ||
| 51 | + sleep(3); | ||
| 52 | + continue; | ||
| 53 | + } | ||
| 54 | + $project = $tick->project; | ||
| 55 | + if ($project->version != 6 || $project->is_del == 1) { | ||
| 56 | + echo now() . " WARNING | 项目版本或状态异常 \n"; | ||
| 57 | + $tick->ding = 1; | ||
| 58 | + $tick->save(); | ||
| 59 | + continue; | ||
| 60 | + } | ||
| 61 | + $message_push = new MessagePush(); | ||
| 62 | + $message_push->project_id = $project->table_id; | ||
| 63 | + $message_push->friend_id = ProjectAssociation::where('project_id', $project->table_id) | ||
| 64 | + ->where('status', ProjectAssociation::STATUS_NORMAL) | ||
| 65 | + ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT) | ||
| 66 | + ->value('friend_id'); | ||
| 67 | + if (empty($message_push->friend_id)) | ||
| 68 | + { | ||
| 69 | + echo now() . " WARNING | 项目ID:{$project->table_id} 没有绑定企微群\n"; | ||
| 70 | + $tick->ding = 1; | ||
| 71 | + $tick->save(); | ||
| 72 | + continue; | ||
| 73 | + } | ||
| 74 | + $message_push->content_type = 'Link'; | ||
| 75 | + $message_push->content = json_encode([ | ||
| 76 | + 'title' => '工单查看 - ' . $project->company_name, | ||
| 77 | + 'desc' => $tick->title, | ||
| 78 | + 'size' => 0, | ||
| 79 | + 'thumbSize' => 0, | ||
| 80 | + 'thumbUrl' => 'https://oa.quanqiusou.cn/logo.ico', | ||
| 81 | + 'url' => 'https://oa.quanqiusou.cn/tickets?project_id='.$project->uuid | ||
| 82 | + ], JSON_UNESCAPED_UNICODE); | ||
| 83 | + $message_push->send_time = now(); | ||
| 84 | + $message_push->type = MessagePush::TYPE_TICKET; | ||
| 85 | + $message_push->save(); | ||
| 86 | + $tick->ding = 1; | ||
| 87 | + $tick->save(); | ||
| 88 | + echo now() . " INFO | 项目ID:{$project->table_id} 工单ID:{$tick->id} 推送成功\n"; | ||
| 89 | + }catch (\Exception $exception){ | ||
| 90 | + echo date('Y-m-d H:i:s')." ERROR | ".$exception->getMessage()."\n"; | ||
| 91 | + break; | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | +} |
| @@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
| 3 | namespace App\Console\Commands\WorkOrder; | 3 | namespace App\Console\Commands\WorkOrder; |
| 4 | 4 | ||
| 5 | use App\Models\WorkOrder\TicketLog; | 5 | use App\Models\WorkOrder\TicketLog; |
| 6 | -use App\Models\WorkOrder\WorkOrderLog; | ||
| 7 | use App\Services\DingTalkService; | 6 | use App\Services\DingTalkService; |
| 8 | use Illuminate\Console\Command; | 7 | use Illuminate\Console\Command; |
| 9 | use Illuminate\Support\Facades\Http; | 8 | use Illuminate\Support\Facades\Http; |
| @@ -45,6 +44,7 @@ class WorkOrderDing extends Command | @@ -45,6 +44,7 @@ class WorkOrderDing extends Command | ||
| 45 | try { | 44 | try { |
| 46 | $log = TicketLog::where('ding', 0)->first(); | 45 | $log = TicketLog::where('ding', 0)->first(); |
| 47 | if (!$log) { | 46 | if (!$log) { |
| 47 | + echo now() . " INFO | 没有通知任务\n"; | ||
| 48 | sleep(3); | 48 | sleep(3); |
| 49 | continue; | 49 | continue; |
| 50 | } | 50 | } |
| @@ -70,7 +70,7 @@ class WorkOrderDing extends Command | @@ -70,7 +70,7 @@ class WorkOrderDing extends Command | ||
| 70 | $log->ding = 2; | 70 | $log->ding = 2; |
| 71 | $log->save(); | 71 | $log->save(); |
| 72 | }catch (\Exception $exception){ | 72 | }catch (\Exception $exception){ |
| 73 | - echo date('Y-m-d H:i:s')." ".$exception->getMessage()."\n"; | 73 | + echo now() . " ERROR | ".$exception->getMessage()."\n"; |
| 74 | break; | 74 | break; |
| 75 | } | 75 | } |
| 76 | } | 76 | } |
| @@ -133,7 +133,7 @@ class NoticeController extends BaseController | @@ -133,7 +133,7 @@ class NoticeController extends BaseController | ||
| 133 | $origin_domain = $origin_array['host'] ?? ''; | 133 | $origin_domain = $origin_array['host'] ?? ''; |
| 134 | } | 134 | } |
| 135 | if (empty($origin_domain)) { | 135 | if (empty($origin_domain)) { |
| 136 | - return $this->error('origin_domain参数不能为空'); | 136 | + return $this->error('origin_domain参数填写有误'); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | if(strpos($target_domain,'http') !== false){ | 139 | if(strpos($target_domain,'http') !== false){ |
| @@ -141,7 +141,7 @@ class NoticeController extends BaseController | @@ -141,7 +141,7 @@ class NoticeController extends BaseController | ||
| 141 | $target_domain = $target_array['host'] ?? ''; | 141 | $target_domain = $target_array['host'] ?? ''; |
| 142 | } | 142 | } |
| 143 | if (empty($target_domain)) { | 143 | if (empty($target_domain)) { |
| 144 | - return $this->error('target_domain参数不能为空'); | 144 | + return $this->error('target_domain参数填写有误'); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | 147 | ||
| @@ -150,7 +150,14 @@ class NoticeController extends BaseController | @@ -150,7 +150,14 @@ class NoticeController extends BaseController | ||
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | if($other_domain){ | 152 | if($other_domain){ |
| 153 | - foreach ($other_domain as $ov) { | 153 | + foreach ($other_domain as &$ov) { |
| 154 | + if(strpos($ov,'http') !== false){ | ||
| 155 | + $ov_array = parse_url($ov); | ||
| 156 | + $ov = $ov_array['host'] ?? ''; | ||
| 157 | + } | ||
| 158 | + if(empty($ov)){ | ||
| 159 | + return $this->error('other_domain参数填写有误'); | ||
| 160 | + } | ||
| 154 | if (!check_domain_record($ov, ['domain'=>'','ip'=>DomainInfo::SERVER_IP_301])) { | 161 | if (!check_domain_record($ov, ['domain'=>'','ip'=>DomainInfo::SERVER_IP_301])) { |
| 155 | return $this->error($ov . ' 未解析至 ' . DomainInfo::SERVER_IP_301); | 162 | return $this->error($ov . ' 未解析至 ' . DomainInfo::SERVER_IP_301); |
| 156 | } | 163 | } |
| @@ -68,7 +68,7 @@ class SelfSiteController extends BaseController | @@ -68,7 +68,7 @@ class SelfSiteController extends BaseController | ||
| 68 | foreach ($files as $key => $file) { | 68 | foreach ($files as $key => $file) { |
| 69 | $cos = new CosService(); | 69 | $cos = new CosService(); |
| 70 | $fileName = uniqid() . rand(10000, 99999) . '.' . $file['ext']; | 70 | $fileName = uniqid() . rand(10000, 99999) . '.' . $file['ext']; |
| 71 | - $file_data = 'data:' . $file['type'] . ';base64,' . $file['data']; | 71 | + $file_data = base64_decode($file['data']); |
| 72 | $path = $cos->uploadFile($file_data, '/inquiry/' . date('Ymd'), $fileName,true); | 72 | $path = $cos->uploadFile($file_data, '/inquiry/' . date('Ymd'), $fileName,true); |
| 73 | $data[$key] = [ | 73 | $data[$key] = [ |
| 74 | 'path' => $path, | 74 | 'path' => $path, |
| @@ -56,9 +56,9 @@ class TicketChatController extends Controller | @@ -56,9 +56,9 @@ class TicketChatController extends Controller | ||
| 56 | $chat->content = $request->input('content'); | 56 | $chat->content = $request->input('content'); |
| 57 | $files = $request->input('files'); | 57 | $files = $request->input('files'); |
| 58 | if (empty($files) || (is_array($files) && count(array_filter($files, function($v){ return !is_null($v); })) === 0)) { | 58 | if (empty($files) || (is_array($files) && count(array_filter($files, function($v){ return !is_null($v); })) === 0)) { |
| 59 | - $ticket->files = null; | 59 | + $chat->files = null; |
| 60 | } else { | 60 | } else { |
| 61 | - $ticket->files = json_encode($files); | 61 | + $chat->files = json_encode($files); |
| 62 | } | 62 | } |
| 63 | $chat->submit_side = 2; | 63 | $chat->submit_side = 2; |
| 64 | $chat->submit_username = $request->input('submit_username'); | 64 | $chat->submit_username = $request->input('submit_username'); |
| @@ -29,7 +29,7 @@ class TicketController extends BaseController | @@ -29,7 +29,7 @@ class TicketController extends BaseController | ||
| 29 | 'logs.engineer:id,name', | 29 | 'logs.engineer:id,name', |
| 30 | ]) | 30 | ]) |
| 31 | ->where('project_id', $project->id) | 31 | ->where('project_id', $project->id) |
| 32 | - ->where('submit_side', 2) | 32 | +// ->where('submit_side', 2) |
| 33 | ->orderBy('id', 'desc') | 33 | ->orderBy('id', 'desc') |
| 34 | ->paginate($size, ['*'], 'page', $page); | 34 | ->paginate($size, ['*'], 'page', $page); |
| 35 | return response()->json(['data' => $tickets]); | 35 | return response()->json(['data' => $tickets]); |
| @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController; | @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController; | ||
| 7 | use App\Http\Requests\Aside\WorkOrder\AsideTicketStoreRequest; | 7 | use App\Http\Requests\Aside\WorkOrder\AsideTicketStoreRequest; |
| 8 | use App\Http\Requests\Aside\WorkOrder\AsideTicketListRequest; | 8 | use App\Http\Requests\Aside\WorkOrder\AsideTicketListRequest; |
| 9 | use App\Http\Requests\Aside\WorkOrder\AsideTicketUpdateRequest; | 9 | use App\Http\Requests\Aside\WorkOrder\AsideTicketUpdateRequest; |
| 10 | +use App\Http\Requests\Aside\WorkOrder\TicketProjectListRequest; | ||
| 10 | use App\Models\WorkOrder\TicketLog; | 11 | use App\Models\WorkOrder\TicketLog; |
| 11 | use App\Models\WorkOrder\TicketProject; | 12 | use App\Models\WorkOrder\TicketProject; |
| 12 | use App\Models\WorkOrder\Tickets; | 13 | use App\Models\WorkOrder\Tickets; |
| @@ -26,7 +27,7 @@ class AsideTicketController extends BaseController | @@ -26,7 +27,7 @@ class AsideTicketController extends BaseController | ||
| 26 | 'logs.engineer:id,name', | 27 | 'logs.engineer:id,name', |
| 27 | 'project', | 28 | 'project', |
| 28 | ]) | 29 | ]) |
| 29 | - ->when($validated['engineer_id'], function ($query) use ($validated) { | 30 | + ->when(!empty($validated['engineer_id']), function ($query) use ($validated) { |
| 30 | // 查 gl_tickets 表 submit_user_id 或 gl_ticket_logs 表 engineer_id | 31 | // 查 gl_tickets 表 submit_user_id 或 gl_ticket_logs 表 engineer_id |
| 31 | $engineerId = $validated['engineer_id']; | 32 | $engineerId = $validated['engineer_id']; |
| 32 | return $query->where(function ($q) use ($engineerId) { | 33 | return $query->where(function ($q) use ($engineerId) { |
| @@ -82,6 +83,32 @@ class AsideTicketController extends BaseController | @@ -82,6 +83,32 @@ class AsideTicketController extends BaseController | ||
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | /** | 85 | /** |
| 86 | + * @param TicketProjectListRequest $request | ||
| 87 | + * @return void | ||
| 88 | + * A端V5V6项目列表 | ||
| 89 | + */ | ||
| 90 | + public function projectList(TicketProjectListRequest $request) | ||
| 91 | + { | ||
| 92 | + $validated = $request->validated(); | ||
| 93 | + $lists = TicketProject::where('is_del', 0) | ||
| 94 | + ->when(!empty($validated['search']), function ($query) use ($validated) { | ||
| 95 | + // 查找项目名称或公司名称 | ||
| 96 | + $search = $validated['search']; | ||
| 97 | + return $query->where(function ($q) use ($search) { | ||
| 98 | + $q->where('title', 'like', '%' . $search . '%') | ||
| 99 | + ->orWhere('company_name', 'like', '%' . $search . '%'); | ||
| 100 | + }); | ||
| 101 | + }) | ||
| 102 | + ->when(!empty($validated['version']), function ($query) use ($validated) { | ||
| 103 | + // 版本号筛选 | ||
| 104 | + $version = $validated['version']; | ||
| 105 | + return $query->where('version', $version); | ||
| 106 | + }) | ||
| 107 | + ->paginate($this->row, ['*'], 'page', $this->page); | ||
| 108 | + $this->response('success', Code::SUCCESS, $lists); | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + /** | ||
| 85 | * Store a newly created resource in storage. | 112 | * Store a newly created resource in storage. |
| 86 | * | 113 | * |
| 87 | * @param \Illuminate\Http\Request $request | 114 | * @param \Illuminate\Http\Request $request |
| @@ -43,7 +43,7 @@ class TicketChatController extends BaseController | @@ -43,7 +43,7 @@ class TicketChatController extends BaseController | ||
| 43 | public function store(TicketChatStoreRequest $request, $ticket_id) | 43 | public function store(TicketChatStoreRequest $request, $ticket_id) |
| 44 | { | 44 | { |
| 45 | $validated = $request->validated(); | 45 | $validated = $request->validated(); |
| 46 | - $ticket = Tickets::find($request->input('ticket_id')); | 46 | + $ticket = Tickets::find($ticket_id); |
| 47 | if (!$ticket) return response('工单未找到', 404); | 47 | if (!$ticket) return response('工单未找到', 404); |
| 48 | if ($ticket->project->is_del) return response('项目状态异常', 400); | 48 | if ($ticket->project->is_del) return response('项目状态异常', 400); |
| 49 | 49 | ||
| @@ -51,11 +51,11 @@ class TicketChatController extends BaseController | @@ -51,11 +51,11 @@ class TicketChatController extends BaseController | ||
| 51 | $chat->ticket_id = $ticket->id; | 51 | $chat->ticket_id = $ticket->id; |
| 52 | $chat->content = $validated['content']; | 52 | $chat->content = $validated['content']; |
| 53 | 53 | ||
| 54 | - $files = $validated['files']; | 54 | + $files = $validated['files'] ?? []; |
| 55 | if (empty($files) || (is_array($files) && count(array_filter($files, function($v){ return !is_null($v); })) === 0)) { | 55 | if (empty($files) || (is_array($files) && count(array_filter($files, function($v){ return !is_null($v); })) === 0)) { |
| 56 | - $ticket->files = null; | 56 | + $chat->files = null; |
| 57 | } else { | 57 | } else { |
| 58 | - $ticket->files = json_encode($files); | 58 | + $chat->files = json_encode($files); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | $chat->submit_username = $this->manage['name']; | 61 | $chat->submit_username = $this->manage['name']; |
| @@ -59,16 +59,23 @@ class EnterpriseProductLogic extends BaseLogic | @@ -59,16 +59,23 @@ class EnterpriseProductLogic extends BaseLogic | ||
| 59 | ProjectServer::useProject($this->param['project_id']); | 59 | ProjectServer::useProject($this->param['project_id']); |
| 60 | $linkModel = new LinkData(); | 60 | $linkModel = new LinkData(); |
| 61 | $data = []; | 61 | $data = []; |
| 62 | + $count = count($this->param['data']); | ||
| 63 | + $error_num = 0; | ||
| 62 | foreach ($this->param['data'] as $v){ | 64 | foreach ($this->param['data'] as $v){ |
| 65 | + if(empty($v['send_time'])){ | ||
| 66 | + $error_num++; | ||
| 67 | + continue; | ||
| 68 | + } | ||
| 63 | $data[] = [ | 69 | $data[] = [ |
| 64 | 'url'=>$v['url'], | 70 | 'url'=>$v['url'], |
| 65 | 'da_values'=>$v['da_values'], | 71 | 'da_values'=>$v['da_values'], |
| 72 | + 'send_time'=>$v['send_time'] ?? date('Y-m-d H:i:s') | ||
| 66 | ]; | 73 | ]; |
| 67 | } | 74 | } |
| 68 | if(!empty($data)){ | 75 | if(!empty($data)){ |
| 69 | $linkModel->insertAll($data); | 76 | $linkModel->insertAll($data); |
| 70 | } | 77 | } |
| 71 | DB::disconnect('custom_mysql'); | 78 | DB::disconnect('custom_mysql'); |
| 72 | - return $this->success(); | 79 | + return $this->success(['success'=>$count,'error'=>$error_num]); |
| 73 | } | 80 | } |
| 74 | } | 81 | } |
| @@ -432,7 +432,13 @@ class ProjectLogic extends BaseLogic | @@ -432,7 +432,13 @@ class ProjectLogic extends BaseLogic | ||
| 432 | $keywordCommentModel = new AggregateKeywordComment(); | 432 | $keywordCommentModel = new AggregateKeywordComment(); |
| 433 | $commentNum = $keywordCommentModel->counts(['project_id'=>$param['id']]); | 433 | $commentNum = $keywordCommentModel->counts(['project_id'=>$param['id']]); |
| 434 | if(empty($commentNum)){ | 434 | if(empty($commentNum)){ |
| 435 | - NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD_COMMON, ['project_id' => $param['id']]); | 435 | + NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD_COMMENT, ['project_id' => $param['id']]); |
| 436 | + } | ||
| 437 | + } | ||
| 438 | + if(isset($param['tag_page_version']) && $param['tag_page_version'] == 1){ | ||
| 439 | + $project_info = $this->model->read(['id'=>$param['id']],'tag_page_version'); | ||
| 440 | + if($project_info['tag_page_version'] == 2){ | ||
| 441 | + $this->fail('新版聚合页开启后不允许关闭,如需关闭,请联系管理员'); | ||
| 436 | } | 442 | } |
| 437 | } | 443 | } |
| 438 | if($param['type'] == Project::TYPE_FIVE){ | 444 | if($param['type'] == Project::TYPE_FIVE){ |
| @@ -52,7 +52,12 @@ class CustomTemplateLogic extends BaseLogic | @@ -52,7 +52,12 @@ class CustomTemplateLogic extends BaseLogic | ||
| 52 | if(!empty($info['html'])){ | 52 | if(!empty($info['html'])){ |
| 53 | $info['is_renovation'] = 1; | 53 | $info['is_renovation'] = 1; |
| 54 | }else{ | 54 | }else{ |
| 55 | - $info['html'] = $info['text']; | 55 | + if(strpos($info['text'],"<main>") === false){ |
| 56 | + $info['html'] = "<main>".$info['text']."</main>"; | ||
| 57 | + }else{ | ||
| 58 | + $info['html'] = $info['text']; | ||
| 59 | + } | ||
| 60 | + $info['html_style'] = "<style id='globalsojs-styles'></style>"; | ||
| 56 | $info['is_renovation'] = 0; | 61 | $info['is_renovation'] = 0; |
| 57 | } | 62 | } |
| 58 | $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']); | 63 | $info['image'] = getImageUrl($info['image'],$this->user['storage_type'],$this->user['project_location']); |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Requests\Aside\WorkOrder; | ||
| 4 | + | ||
| 5 | +use Illuminate\Foundation\Http\FormRequest; | ||
| 6 | + | ||
| 7 | +class TicketProjectListRequest extends FormRequest | ||
| 8 | +{ | ||
| 9 | + /** | ||
| 10 | + * Determine if the user is authorized to make this request. | ||
| 11 | + * | ||
| 12 | + * @return bool | ||
| 13 | + */ | ||
| 14 | + public function authorize() | ||
| 15 | + { | ||
| 16 | + return true; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * Get the validation rules that apply to the request. | ||
| 21 | + * | ||
| 22 | + * @return array | ||
| 23 | + */ | ||
| 24 | + public function rules() | ||
| 25 | + { | ||
| 26 | + return [ | ||
| 27 | + 'search' => 'nullable|string', // 搜索关键词 | ||
| 28 | + 'version' => 'nullable|in:5,6', // 版本号 | ||
| 29 | + ]; | ||
| 30 | + } | ||
| 31 | +} |
| @@ -12,7 +12,6 @@ class AutoPullNotify extends Base | @@ -12,7 +12,6 @@ class AutoPullNotify extends Base | ||
| 12 | { | 12 | { |
| 13 | return [ | 13 | return [ |
| 14 | 1 => '硅谷云服务器', | 14 | 1 => '硅谷云服务器', |
| 15 | - 20 => '硅谷建站服务器01', | ||
| 16 | 25 => '硅谷建站服务器02', | 15 | 25 => '硅谷建站服务器02', |
| 17 | 15 => '硅谷IDC服务器01(6.0美服1)', | 16 | 15 => '硅谷IDC服务器01(6.0美服1)', |
| 18 | 14 => '硅谷IDC服务器02(6.0美服2)', | 17 | 14 => '硅谷IDC服务器02(6.0美服2)', |
| @@ -27,7 +26,7 @@ class AutoPullNotify extends Base | @@ -27,7 +26,7 @@ class AutoPullNotify extends Base | ||
| 27 | 24 => '白帽专属服务器02', | 26 | 24 => '白帽专属服务器02', |
| 28 | 23 => '西班牙服务器', | 27 | 23 => '西班牙服务器', |
| 29 | 6 => '自建站服务器群', | 28 | 6 => '自建站服务器群', |
| 30 | - 27 => '硅谷建站服务器03', | 29 | + 27 => '硅谷建站服务器01', |
| 31 | ]; | 30 | ]; |
| 32 | } | 31 | } |
| 33 | 32 |
| @@ -13,7 +13,7 @@ class NoticeLog extends Base | @@ -13,7 +13,7 @@ class NoticeLog extends Base | ||
| 13 | const TYPE_PROJECT = 'project'; | 13 | const TYPE_PROJECT = 'project'; |
| 14 | const TYPE_RANK_DATA = 'rank_data'; | 14 | const TYPE_RANK_DATA = 'rank_data'; |
| 15 | const TYPE_INIT_PROJECT = 'init_project'; | 15 | const TYPE_INIT_PROJECT = 'init_project'; |
| 16 | - const TYPE_INIT_KEYWORD_COMMON = 'init_keyword_common';//聚合页关键词评论 | 16 | + const TYPE_INIT_KEYWORD_COMMENT = 'init_keyword_comment';//聚合页关键词评论 |
| 17 | const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成 | 17 | const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成 |
| 18 | const TYPE_COPY_PROJECT = 'copy_project'; | 18 | const TYPE_COPY_PROJECT = 'copy_project'; |
| 19 | const TYPE_INIT_KEYWORD = 'init_keyword'; | 19 | const TYPE_INIT_KEYWORD = 'init_keyword'; |
| @@ -27,6 +27,7 @@ class MessagePush extends Base | @@ -27,6 +27,7 @@ class MessagePush extends Base | ||
| 27 | 27 | ||
| 28 | const TYPE_INQUIRY = 'inquiry'; | 28 | const TYPE_INQUIRY = 'inquiry'; |
| 29 | const TYPE_WEEK = 'week'; | 29 | const TYPE_WEEK = 'week'; |
| 30 | + const TYPE_TICKET = 'ticket'; | ||
| 30 | //设置关联表名 | 31 | //设置关联表名 |
| 31 | /** | 32 | /** |
| 32 | * @var mixed | 33 | * @var mixed |
| @@ -28,8 +28,10 @@ class AiVideoService | @@ -28,8 +28,10 @@ class AiVideoService | ||
| 28 | if($project_id){ | 28 | if($project_id){ |
| 29 | $projectAiSettingModel = new ProjectAiSetting(); | 29 | $projectAiSettingModel = new ProjectAiSetting(); |
| 30 | $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]); | 30 | $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]); |
| 31 | - $this->mch_id = $aiSettingInfo['mch_id']; | ||
| 32 | - $this->key = $aiSettingInfo['key']; | 31 | + if($aiSettingInfo !== false){ |
| 32 | + $this->mch_id = $aiSettingInfo['mch_id']; | ||
| 33 | + $this->key = $aiSettingInfo['key']; | ||
| 34 | + } | ||
| 33 | } | 35 | } |
| 34 | } | 36 | } |
| 35 | 37 |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | namespace App\Services; | 9 | namespace App\Services; |
| 10 | 10 | ||
| 11 | use App\Models\CustomModule\CustomModule; | 11 | use App\Models\CustomModule\CustomModule; |
| 12 | +use App\Models\Project\AggregateKeywordAffix; | ||
| 12 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| 13 | use App\Models\RouteMap\RouteMap; | 14 | use App\Models\RouteMap\RouteMap; |
| 14 | use App\Models\Template\BCustomTemplate; | 15 | use App\Models\Template\BCustomTemplate; |
| @@ -140,6 +141,8 @@ class ProjectServer | @@ -140,6 +141,8 @@ class ProjectServer | ||
| 140 | self::initColumn(); | 141 | self::initColumn(); |
| 141 | //初始化search页面 | 142 | //初始化search页面 |
| 142 | // self::initSearchPage($project_id); | 143 | // self::initSearchPage($project_id); |
| 144 | + //聚合页关键词前后缀 | ||
| 145 | + self::initAggregateKeywordAffix($project_id); | ||
| 143 | DB::disconnect('custom_mysql'); | 146 | DB::disconnect('custom_mysql'); |
| 144 | return true; | 147 | return true; |
| 145 | } | 148 | } |
| @@ -280,4 +283,29 @@ class ProjectServer | @@ -280,4 +283,29 @@ class ProjectServer | ||
| 280 | } | 283 | } |
| 281 | } | 284 | } |
| 282 | } | 285 | } |
| 286 | + | ||
| 287 | + /** | ||
| 288 | + * @remark :gl_aggregate_keyword_affix处理聚合页关键词前后缀 | ||
| 289 | + * @name :initAffix | ||
| 290 | + * @author :lyh | ||
| 291 | + * @method :post | ||
| 292 | + * @time :2025/6/26 17:48 | ||
| 293 | + */ | ||
| 294 | + public static function initAggregateKeywordAffix($project_id){ | ||
| 295 | + $time = date('Y-m-d H:i:s'); | ||
| 296 | + $prefix = "How To"."\n"."Why"."\n"."Top 5"."\n"."Top 3"."\n"."Best Way To"."\n"."Methods To"."\n"."Top-Rated"."\n"."How To find"."\n"."why choose"."\n"."China Top"."\n"."Best Way To Choose"."\n"."Methods To choose"."\n"."10 tips"."\n"."Top 10"."\n"."How To Select"."\n"."How To Find The Best"."\n"."How To Evaluate"."\n"."How To Compare"."\n"."How To Identify"."\n"."How To Source"."\n"."How To Pick The Right"."\n"."How To Decide Between"."\n"."Why Opt For"."\n"."Why Invest In"."\n"."Why Consider"."\n"."Why Trust"."\n"."Why Professionals Prefer"."\n"."Top Picks For"."\n"."Best Practices For"."\n"."Best Ways To"."\n"."Best Options For"."\n"."Best Brands For"."\n"."Best Methods To"."\n"."Best Strategies For"."\n"."Effective Ways To"."\n"."Proven Methods To"."\n"."Simple Ways To"."\n"."Key Methods For"."\n"."Smart Ways To"."\n"."Practical Methods To"."\n"."Step-by-Step Guide To"."\n"."10 Essential Tips For"."\n"."7 Key Tips To"."\n"."Ultimate Guide To"."\n"."Expert Tips For"."\n"."Must-Know Tips For"."\n"."Quick Tips To"."\n"."Insider Tips For"."\n"."Leading Chinese"."\n"."Best Chinese"."\n"."China’s Best-Selling"."\n"."Why China’s"."\n"."How Chinese Manufacturers"."\n"."Exploring"."\n"."Uncovering"."\n"."Discovering"."\n"."Pinpointing"."\n"."Decoding"."\n"."Reasons to Choose"."\n"."Advantages Explained"."\n"."Where the Value Lies"."\n"."Not to Be Missed"."\n"."Must-Choose Reasons"."\n"."Excellence in"."\n"."Cutting-Edge"."\n"."Premier"."\n"."Champions of"."\n"."The Ultimate Guide to"."\n"."Practical Strategies for"."\n"."Making Smart Choices"."\n"."Key Steps to Choosing"."\n"."Finding Your Perfect Match"."\n"."Avoiding Pitfalls"."\n"."Tips & Tricks for"."\n"."In-Depth Analysis of"."\n"."Methods"."\n"."How-To Guide"."\n"."Step-by-Step Guide"."\n"."The Secret to"."\n"."Must-See List"."\n"."Curated Selection of"."\n"."Trending"."\n"."Popular"."\n"."Don't Miss These"."\n"."Comprehensive Comparison of"."\n"."The Clear Choice of"."\n"."Today's Choice of"."\n"."Expert Choice of"; | ||
| 297 | + $suffix = "Manufacturer"."\n"."Supplier"."\n"."Application"."\n"."Products"."\n"."Service"."\n"."Factory"."\n"."Is The Best"."\n"."Stands Out"."\n"."Dominates"."\n"."in 2025"."\n"."Industry Leaders"."\n"."Industry Giant"."\n"."Market Leader"."\n"."For the Current Year"."\n"."Ahead of the Curve"."\n"."Trusted by Pros"."\n"."Pioneers in the Field"."\n"."Now Trending"."\n"."Sets the Industry Standard"."\n"."Leads the Global Market"."\n"."Delivers Unmatched Quality"."\n"."Guarantees Peak Performance"."\n"."Exceeds Industry Benchmarks"."\n"."Winning in 2025"."\n"."Where Innovation Meets 2025"."\n"."Your Trusted OEM Partner"."\n"."Supplies the World’s Top Brands"."\n"."Manufacturers You Can Rely On"."\n"."Factory-Direct Excellence"."\n"."Custom Solutions,"."\n"."Global Reach"."\n"."Where Service Meets Innovation"."\n"."Your End-to-End Solution"."\n"."More Than a Supplier - A Partner"."\n"."Service Backed by Expertise"."\n"."From Concept to Delivery"."\n"."Outperforms the Competition"; | ||
| 298 | + $info = DB::table('gl_aggregate_keyword_affix')->where('project_id',$project_id)->first(); | ||
| 299 | + if(empty($info)){ | ||
| 300 | + $data = [ | ||
| 301 | + 'project_id'=>$project_id, | ||
| 302 | + 'prefix'=>$prefix, | ||
| 303 | + 'suffix'=>$suffix, | ||
| 304 | + 'created_at' => $time, | ||
| 305 | + 'updated_at' => $time | ||
| 306 | + ]; | ||
| 307 | + DB::table('gl_aggregate_keyword_affix')->insert($data); | ||
| 308 | + } | ||
| 309 | + return true; | ||
| 310 | + } | ||
| 283 | } | 311 | } |
| @@ -255,6 +255,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -255,6 +255,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 255 | Route::get('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'show'])->name('admin.tickets.show')->summary('A端工单详情'); | 255 | Route::get('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'show'])->name('admin.tickets.show')->summary('A端工单详情'); |
| 256 | Route::post('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'update'])->name('admin.tickets.update')->summary('A端更新工单,审核,邀请同事'); | 256 | Route::post('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'update'])->name('admin.tickets.update')->summary('A端更新工单,审核,邀请同事'); |
| 257 | Route::get('/projects/{search}', [Aside\WorkOrder\AsideTicketController::class, 'getProjects'])->name('admin.tickets.projects')->summary('A端V5V6项目列表'); | 257 | Route::get('/projects/{search}', [Aside\WorkOrder\AsideTicketController::class, 'getProjects'])->name('admin.tickets.projects')->summary('A端V5V6项目列表'); |
| 258 | + Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表'); | ||
| 258 | Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); | 259 | Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); |
| 259 | Route::get('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'index'])->name('admin.tickets.chat.index')->summary('A端工单聊天记录'); | 260 | Route::get('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'index'])->name('admin.tickets.chat.index')->summary('A端工单聊天记录'); |
| 260 | Route::post('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'store'])->name('admin.tickets.chat.store')->summary('A端工单聊天记录创建'); | 261 | Route::post('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'store'])->name('admin.tickets.chat.store')->summary('A端工单聊天记录创建'); |
-
请 注册 或 登录 后发表评论