Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
8 个修改的文件
包含
46 行增加
和
50 行删除
| @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command | @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command | ||
| 33 | protected $description = '升级项目统计'; | 33 | protected $description = '升级项目统计'; |
| 34 | 34 | ||
| 35 | public function handle(){ | 35 | public function handle(){ |
| 36 | - $project_id = 632; | 36 | + $project_id = 769; |
| 37 | ProjectServer::useProject($project_id); | 37 | ProjectServer::useProject($project_id); |
| 38 | $this->count($project_id); | 38 | $this->count($project_id); |
| 39 | DB::disconnect('custom_mysql'); | 39 | DB::disconnect('custom_mysql'); |
| @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command | @@ -36,7 +36,7 @@ class UpgradeProjectCount extends Command | ||
| 36 | protected $description = '升级项目统计'; | 36 | protected $description = '升级项目统计'; |
| 37 | 37 | ||
| 38 | public function handle(){ | 38 | public function handle(){ |
| 39 | - $project_id = 632; | 39 | + $project_id = 769; |
| 40 | $oldModel = new UpdateOldInfo(); | 40 | $oldModel = new UpdateOldInfo(); |
| 41 | $info = $oldModel->read(['project_id'=>$project_id]); | 41 | $info = $oldModel->read(['project_id'=>$project_id]); |
| 42 | $url = $info['old_domain_online']; | 42 | $url = $info['old_domain_online']; |
| @@ -55,7 +55,7 @@ class UpdateRoute extends Command | @@ -55,7 +55,7 @@ class UpdateRoute extends Command | ||
| 55 | */ | 55 | */ |
| 56 | public function handle(){ | 56 | public function handle(){ |
| 57 | $projectModel = new Project(); | 57 | $projectModel = new Project(); |
| 58 | - $list = $projectModel->list(['is_upgrade'=>0]); | 58 | + $list = $projectModel->list(['id'=>206]); |
| 59 | $data = []; | 59 | $data = []; |
| 60 | foreach ($list as $v){ | 60 | foreach ($list as $v){ |
| 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -114,23 +114,25 @@ class UpdateRoute extends Command | @@ -114,23 +114,25 @@ class UpdateRoute extends Command | ||
| 114 | if(!empty($lists)){ | 114 | if(!empty($lists)){ |
| 115 | foreach ($lists as $v){ | 115 | foreach ($lists as $v){ |
| 116 | if(!empty($v['route'])){ | 116 | if(!empty($v['route'])){ |
| 117 | - $tag = "-tag"; | ||
| 118 | - if ((substr($v['route'], -strlen($tag)) === $tag)) { | ||
| 119 | - echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL; | ||
| 120 | -// $route = Translate::tran($v['route'], 'en').$tag; | ||
| 121 | - // 如果不是以 '-tag' 结尾,则拼接上 '-tag' | ||
| 122 | - $route = trim($v['route'],'-tag'); | ||
| 123 | - $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 124 | - $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 125 | -// }else{ | ||
| 126 | -// $route = Translate::tran($v['title'], 'en').$tag; | 117 | +// $tag = "-tag"; |
| 118 | +// if ((substr($v['route'], -strlen($tag)) === $tag)) { | ||
| 119 | +// echo date('Y-m-d H:i:s') . '拼接 :'.$v['id'] . PHP_EOL; | ||
| 120 | +//// $route = Translate::tran($v['route'], 'en').$tag; | ||
| 121 | +// // 如果不是以 '-tag' 结尾,则拼接上 '-tag' | ||
| 122 | +// $route = trim($v['route'],'-tag'); | ||
| 127 | // $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 123 | // $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); |
| 128 | // $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 124 | // $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); |
| 129 | - } | ||
| 130 | // }else{ | 125 | // }else{ |
| 131 | -// echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 132 | -// $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 126 | +// $route = Translate::tran($v['title'], 'en').$tag; |
| 127 | +// $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 133 | // $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 128 | // $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); |
| 129 | +// } | ||
| 130 | + }else{ | ||
| 131 | + echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 132 | + $route = Translate::tran($v['title'], 'en'); | ||
| 133 | + echo date('Y-m-d H:i:s') . 'route :'.$route . PHP_EOL; | ||
| 134 | + $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 135 | + $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 134 | } | 136 | } |
| 135 | echo date('Y-m-d H:i:s') . 'end :' . PHP_EOL; | 137 | echo date('Y-m-d H:i:s') . 'end :' . PHP_EOL; |
| 136 | } | 138 | } |
| @@ -282,7 +282,9 @@ class WebTraffic extends Command | @@ -282,7 +282,9 @@ class WebTraffic extends Command | ||
| 282 | ProjectServer::useProject($project_id); | 282 | ProjectServer::useProject($project_id); |
| 283 | //已发布产品分类页面 | 283 | //已发布产品分类页面 |
| 284 | $data['urls_cats'] = DB::connection('custom_mysql')->table('gl_product_category') | 284 | $data['urls_cats'] = DB::connection('custom_mysql')->table('gl_product_category') |
| 285 | - ->where('project_id', $project_id)->where('status', Category::STATUS_ACTIVE)->pluck('route','id')->toArray(); | 285 | + ->where('project_id', $project_id)->where('status', Category::STATUS_ACTIVE) |
| 286 | + ->whereNull('deleted_at') | ||
| 287 | + ->pluck('route','id')->toArray(); | ||
| 286 | 288 | ||
| 287 | //已发布单页面 | 289 | //已发布单页面 |
| 288 | $data['urls_page'] = []; | 290 | $data['urls_page'] = []; |
| @@ -291,7 +293,9 @@ class WebTraffic extends Command | @@ -291,7 +293,9 @@ class WebTraffic extends Command | ||
| 291 | 293 | ||
| 292 | //已发布产品详情页 | 294 | //已发布产品详情页 |
| 293 | $data['urls_details'] = DB::connection('custom_mysql')->table('gl_product') | 295 | $data['urls_details'] = DB::connection('custom_mysql')->table('gl_product') |
| 294 | - ->where('project_id', $project_id)->where('status', Product::STATUS_ON)->pluck('route', 'id')->toArray(); | 296 | + ->where('project_id', $project_id)->where('status', Product::STATUS_ON) |
| 297 | + ->whereNull('deleted_at') | ||
| 298 | + ->pluck('route', 'id')->toArray(); | ||
| 295 | 299 | ||
| 296 | $data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']); | 300 | $data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']); |
| 297 | if(empty($data['urls_cats'])){ | 301 | if(empty($data['urls_cats'])){ |
app/Events/CopyProject.php
已删除
100644 → 0
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * @remark : | ||
| 4 | - * @name :CopyProject.php | ||
| 5 | - * @author :lyh | ||
| 6 | - * @method :post | ||
| 7 | - * @time :2024/1/9 16:01 | ||
| 8 | - */ | ||
| 9 | - | ||
| 10 | -namespace App\Events; | ||
| 11 | - | ||
| 12 | -use Illuminate\Broadcasting\InteractsWithSockets; | ||
| 13 | -use Illuminate\Foundation\Events\Dispatchable; | ||
| 14 | -use Illuminate\Queue\SerializesModels; | ||
| 15 | -class CopyProject | ||
| 16 | -{ | ||
| 17 | - use Dispatchable, InteractsWithSockets, SerializesModels; | ||
| 18 | - public $data; | ||
| 19 | - /** | ||
| 20 | - * 监听更新HTML静态页 | ||
| 21 | - */ | ||
| 22 | - public function __construct($data) | ||
| 23 | - { | ||
| 24 | - $this->data = $data; | ||
| 25 | - } | ||
| 26 | -} |
| @@ -7,6 +7,7 @@ use App\Events\CopyImageFile; | @@ -7,6 +7,7 @@ use App\Events\CopyImageFile; | ||
| 7 | use App\Events\CopyProject; | 7 | use App\Events\CopyProject; |
| 8 | use App\Exceptions\AsideGlobalException; | 8 | use App\Exceptions\AsideGlobalException; |
| 9 | use App\Jobs\CopyImageFileJob; | 9 | use App\Jobs\CopyImageFileJob; |
| 10 | +use App\Jobs\CopyProjectJob; | ||
| 10 | use App\Models\Com\NoticeLog; | 11 | use App\Models\Com\NoticeLog; |
| 11 | use App\Models\Com\UpdateLog; | 12 | use App\Models\Com\UpdateLog; |
| 12 | use App\Models\Devops\ServerConfig; | 13 | use App\Models\Devops\ServerConfig; |
| @@ -612,7 +613,7 @@ class ProjectLogic extends BaseLogic | @@ -612,7 +613,7 @@ class ProjectLogic extends BaseLogic | ||
| 612 | * @time :2023/11/8 14:23 | 613 | * @time :2023/11/8 14:23 |
| 613 | */ | 614 | */ |
| 614 | public function copyProject(){ | 615 | public function copyProject(){ |
| 615 | - CopyProject::dispatch(['project_id'=>$this->param['project_id']]); | 616 | + CopyProjectJob::dispatch(['project_id'=>$this->param['project_id']]); |
| 616 | return $this->success(); | 617 | return $this->success(); |
| 617 | } | 618 | } |
| 618 | 619 |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Listeners; | 3 | +namespace App\Jobs; |
| 4 | 4 | ||
| 5 | use App\Events\CopyProject; | 5 | use App\Events\CopyProject; |
| 6 | use App\Events\UpdateHtml; | 6 | use App\Events\UpdateHtml; |
| @@ -14,17 +14,33 @@ use App\Models\Template\Setting; | @@ -14,17 +14,33 @@ use App\Models\Template\Setting; | ||
| 14 | use App\Models\User\User as UserModel; | 14 | use App\Models\User\User as UserModel; |
| 15 | use App\Services\ProjectServer; | 15 | use App\Services\ProjectServer; |
| 16 | use Hashids\Hashids; | 16 | use Hashids\Hashids; |
| 17 | +use Illuminate\Bus\Queueable; | ||
| 17 | use Illuminate\Contracts\Queue\ShouldQueue; | 18 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 19 | +use Illuminate\Foundation\Bus\Dispatchable; | ||
| 20 | +use Illuminate\Queue\InteractsWithQueue; | ||
| 21 | +use Illuminate\Queue\SerializesModels; | ||
| 18 | use Illuminate\Support\Facades\DB; | 22 | use Illuminate\Support\Facades\DB; |
| 19 | use Illuminate\Support\Facades\Schema; | 23 | use Illuminate\Support\Facades\Schema; |
| 20 | 24 | ||
| 21 | -class CopyProjectListener implements ShouldQueue | 25 | +class CopyProjectJob implements ShouldQueue |
| 22 | { | 26 | { |
| 23 | - public function __construct() | 27 | + use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
| 28 | + public $tries = 3; // 可配置任务重试次数 | ||
| 29 | + | ||
| 30 | + protected $param; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * Create a new job instance. | ||
| 34 | + * | ||
| 35 | + * @param CopyImageFile $event | ||
| 36 | + * @return void | ||
| 37 | + */ | ||
| 38 | + public function __construct($data) | ||
| 24 | { | 39 | { |
| 25 | - // | 40 | + $this->param = $data; |
| 26 | } | 41 | } |
| 27 | 42 | ||
| 43 | + | ||
| 28 | /** | 44 | /** |
| 29 | * Handle the event. | 45 | * Handle the event. |
| 30 | * | 46 | * |
| @@ -25,7 +25,6 @@ class EventServiceProvider extends ServiceProvider | @@ -25,7 +25,6 @@ class EventServiceProvider extends ServiceProvider | ||
| 25 | 'Illuminate\Database\Events\QueryExecuted' => [ | 25 | 'Illuminate\Database\Events\QueryExecuted' => [ |
| 26 | 'App\Listeners\QueryListener', | 26 | 'App\Listeners\QueryListener', |
| 27 | ], | 27 | ], |
| 28 | - CopyProject::class => [CopyProjectListener::class], | ||
| 29 | ]; | 28 | ]; |
| 30 | 29 | ||
| 31 | /** | 30 | /** |
-
请 注册 或 登录 后发表评论