Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
5 个修改的文件
包含
98 行增加
和
3 行删除
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Aside\Com; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Aside\Com; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Aside\BaseController; | 13 | use App\Http\Controllers\Aside\BaseController; |
| 14 | use App\Models\Com\KeywordVideoTask; | 14 | use App\Models\Com\KeywordVideoTask; |
| 15 | +use App\Models\Com\KeywordVideoTaskLog; | ||
| 15 | use App\Models\Domain\DomainInfo; | 16 | use App\Models\Domain\DomainInfo; |
| 16 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 17 | 18 | ||
| @@ -125,4 +126,23 @@ class KeywordVideoController extends BaseController | @@ -125,4 +126,23 @@ class KeywordVideoController extends BaseController | ||
| 125 | } | 126 | } |
| 126 | $this->response('success'); | 127 | $this->response('success'); |
| 127 | } | 128 | } |
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * @remark :记录 | ||
| 132 | + * @name :getVideoTaskLog | ||
| 133 | + * @author :lyh | ||
| 134 | + * @method :post | ||
| 135 | + * @time :2024/3/1 16:40 | ||
| 136 | + */ | ||
| 137 | + public function getVideoTaskLog(){ | ||
| 138 | + $this->request->validate([ | ||
| 139 | + 'project_id'=>'required', | ||
| 140 | + ], [ | ||
| 141 | + 'project_id.required' => '项目唯一标识不为空', | ||
| 142 | + ]); | ||
| 143 | + $taskLogModel = new KeywordVideoTaskLog(); | ||
| 144 | + $list = $taskLogModel->lists($this->map,$this->page,$this->row); | ||
| 145 | + $this->response('success',Code::SUCCESS,$list); | ||
| 146 | + } | ||
| 147 | + | ||
| 128 | } | 148 | } |
| @@ -324,4 +324,31 @@ class ComController extends BaseController | @@ -324,4 +324,31 @@ class ComController extends BaseController | ||
| 324 | Cache::add('login-project-'.$this->user['mobile'],1,300); | 324 | Cache::add('login-project-'.$this->user['mobile'],1,300); |
| 325 | $this->response('success',Code::SUCCESS,$data); | 325 | $this->response('success',Code::SUCCESS,$data); |
| 326 | } | 326 | } |
| 327 | + | ||
| 328 | + /** | ||
| 329 | + * @remark :推荐采购商 | ||
| 330 | + * @name :recommendedPurchaser | ||
| 331 | + * @author :lyh | ||
| 332 | + * @method :post | ||
| 333 | + * @time :2024/3/4 10:10 | ||
| 334 | + */ | ||
| 335 | + public function recommendedPurchaser(){ | ||
| 336 | + $this->param['keyword'] = 'led'; | ||
| 337 | + $url = 'https://admin.hagro.cn/api/company_list'; | ||
| 338 | + $data = [ | ||
| 339 | + 'prod_desc'=>$this->param['keyword'], | ||
| 340 | + 'total'=>$this->param['now'] ?? 10, | ||
| 341 | + ]; | ||
| 342 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export(http_build_query($data), true) . PHP_EOL, FILE_APPEND); | ||
| 343 | + $token = 'company_list'.date('Y-m-d').http_build_query(arsort($data)); | ||
| 344 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($token, true) . PHP_EOL, FILE_APPEND); | ||
| 345 | + $param = [ | ||
| 346 | + 'prod_desc'=>$this->param['keyword'], | ||
| 347 | + 'token'=>$token, | ||
| 348 | + 'total'=>$this->param['now'] ?? 10, | ||
| 349 | + ]; | ||
| 350 | + $lists = http_post($url,$param); | ||
| 351 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($token, true) . PHP_EOL, FILE_APPEND); | ||
| 352 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 353 | + } | ||
| 327 | } | 354 | } |
app/Jobs/PurchaserJob.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :PurchaserJob.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/3/4 11:06 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Jobs; | ||
| 11 | + | ||
| 12 | +use Illuminate\Bus\Queueable; | ||
| 13 | +use Illuminate\Contracts\Queue\ShouldQueue; | ||
| 14 | +use Illuminate\Foundation\Bus\Dispatchable; | ||
| 15 | +use Illuminate\Queue\InteractsWithQueue; | ||
| 16 | +use Illuminate\Queue\SerializesModels; | ||
| 17 | + | ||
| 18 | +class PurchaserJob implements ShouldQueue | ||
| 19 | +{ | ||
| 20 | + use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||
| 21 | + public $tries = 3; // 可配置任务重试次数 | ||
| 22 | + | ||
| 23 | + protected $param; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * Create a new job instance. | ||
| 27 | + * | ||
| 28 | + * @param CopyImageFile $event | ||
| 29 | + * @return void | ||
| 30 | + */ | ||
| 31 | + public function __construct($data) | ||
| 32 | + { | ||
| 33 | + $this->param = $data; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * Handle the event. | ||
| 38 | + * | ||
| 39 | + * @param UpdateHtml $event | ||
| 40 | + * @return void | ||
| 41 | + */ | ||
| 42 | + public function handle() | ||
| 43 | + { | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | +} |
| @@ -336,9 +336,10 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -336,9 +336,10 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 336 | * 生成视频的项目 | 336 | * 生成视频的项目 |
| 337 | */ | 337 | */ |
| 338 | Route::prefix('keyword_video')->group(function () { | 338 | Route::prefix('keyword_video')->group(function () { |
| 339 | - Route::any('/', [Aside\Com\KeywordVideoController::class, 'lists'])->name('promotion_keyword_lists'); | ||
| 340 | - Route::any('/createKeywordTask', [Aside\Com\KeywordVideoController::class, 'createKeywordTask'])->name('promotion_keyword_createKeywordTask'); | ||
| 341 | - Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('promotion_keyword_edit'); | 339 | + Route::any('/', [Aside\Com\KeywordVideoController::class, 'lists'])->name('keyword_video_lists'); |
| 340 | + Route::any('/createKeywordTask', [Aside\Com\KeywordVideoController::class, 'createKeywordTask'])->name('keyword_video_createKeywordTask'); | ||
| 341 | + Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('keyword_video_edit'); | ||
| 342 | + Route::any('/getVideoTaskLog', [Aside\Com\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog'); | ||
| 342 | }); | 343 | }); |
| 343 | 344 | ||
| 344 | // 公共主题模版 | 345 | // 公共主题模版 |
| @@ -20,6 +20,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -20,6 +20,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 20 | Route::any('/generateToken', [\App\Http\Controllers\Bside\BCom\ComController::class, 'generateToken'])->name('generateToken'); | 20 | Route::any('/generateToken', [\App\Http\Controllers\Bside\BCom\ComController::class, 'generateToken'])->name('generateToken'); |
| 21 | Route::any('/getLink', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getLink'])->name('getLink'); | 21 | Route::any('/getLink', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getLink'])->name('getLink'); |
| 22 | Route::any('/getMobileProject', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getMobileProject'])->name('getMobileProject'); | 22 | Route::any('/getMobileProject', [\App\Http\Controllers\Bside\BCom\ComController::class, 'getMobileProject'])->name('getMobileProject'); |
| 23 | + Route::any('/recommendedPurchaser', [\App\Http\Controllers\Bside\BCom\ComController::class, 'recommendedPurchaser'])->name('recommendedPurchaser'); | ||
| 23 | //用户相关路由 | 24 | //用户相关路由 |
| 24 | Route::prefix('user')->group(function () { | 25 | Route::prefix('user')->group(function () { |
| 25 | Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); | 26 | Route::any('/', [\App\Http\Controllers\Bside\User\UserController::class, 'lists'])->name('user_lists'); |
-
请 注册 或 登录 后发表评论