正在显示
5 个修改的文件
包含
126 行增加
和
3 行删除
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | * @remark : | 3 | * @remark : |
| 4 | - * @name :GeoQuestionRes.php | 4 | + * @name :GeoQuestionResController.php |
| 5 | * @author :lyh | 5 | * @author :lyh |
| 6 | * @method :post | 6 | * @method :post |
| 7 | * @time :2025/7/3 15:13 | 7 | * @time :2025/7/3 15:13 |
| @@ -93,6 +93,7 @@ class GeoQuestionRes extends Command | @@ -93,6 +93,7 @@ class GeoQuestionRes extends Command | ||
| 93 | 'keywords'=>json_encode($keywords ?? [],true),//命中的关键词 | 93 | 'keywords'=>json_encode($keywords ?? [],true),//命中的关键词 |
| 94 | 'text'=>json_encode($result_data ?? [],true), | 94 | 'text'=>json_encode($result_data ?? [],true), |
| 95 | 'url'=>json_encode($urls ?? [],true),//命中的网址 | 95 | 'url'=>json_encode($urls ?? [],true),//命中的网址 |
| 96 | + 'type'=>$info['type'] ?? 1 | ||
| 96 | ]; | 97 | ]; |
| 97 | if($resultInfo === false){ | 98 | if($resultInfo === false){ |
| 98 | $geoResultModel->addReturnId($data); | 99 | $geoResultModel->addReturnId($data); |
| @@ -105,6 +106,7 @@ class GeoQuestionRes extends Command | @@ -105,6 +106,7 @@ class GeoQuestionRes extends Command | ||
| 105 | 'platform'=>$p_item, | 106 | 'platform'=>$p_item, |
| 106 | 'question'=>$q_item, | 107 | 'question'=>$q_item, |
| 107 | 'text'=>json_encode($result_data ?? [],true), | 108 | 'text'=>json_encode($result_data ?? [],true), |
| 109 | + 'type'=>$info['type'] ?? 1 | ||
| 108 | ]; | 110 | ]; |
| 109 | $geoLogModel = new GeoQuestionLog(); | 111 | $geoLogModel = new GeoQuestionLog(); |
| 110 | $geoLogModel->addReturnId($data_log); | 112 | $geoLogModel->addReturnId($data_log); |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoQuestionResController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/7/4 9:37 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Bside\Geo; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Bside\BaseController; | ||
| 14 | +use App\Http\Logic\Bside\Geo\GeoQuestionResLogic; | ||
| 15 | +use Illuminate\Http\Request; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @remark :请求数据结果 | ||
| 19 | + * @name :GeoQuestionResController | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2025/7/4 9:37 | ||
| 23 | + */ | ||
| 24 | +class GeoQuestionResController extends BaseController | ||
| 25 | +{ | ||
| 26 | + public function __construct(Request $request) | ||
| 27 | + { | ||
| 28 | + parent::__construct($request); | ||
| 29 | + $this->logic = new GeoQuestionResLogic(); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * @remark :获取列表数据 | ||
| 34 | + * @name :getList | ||
| 35 | + * @author :lyh | ||
| 36 | + * @method :post | ||
| 37 | + * @time :2025/7/4 9:38 | ||
| 38 | + */ | ||
| 39 | + public function getList(){ | ||
| 40 | + $this->request->validate([ | ||
| 41 | + 'project_id'=>'required', | ||
| 42 | + 'type'=>'required' | ||
| 43 | + ],[ | ||
| 44 | + 'project_id.required' => 'project_id不能为空', | ||
| 45 | + 'type.required' => '品牌类型不能为空' | ||
| 46 | + ]); | ||
| 47 | + $data = $this->logic->getResultList($this->map,$this->page,$this->row,$this->order); | ||
| 48 | + $this->response('success',Code::SUCCESS,$data); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * @remark : | ||
| 53 | + * @name :getInfo | ||
| 54 | + * @author :lyh | ||
| 55 | + * @method :post | ||
| 56 | + * @time :2025/7/4 9:38 | ||
| 57 | + */ | ||
| 58 | + public function getInfo(){ | ||
| 59 | + $this->request->validate([ | ||
| 60 | + 'id'=>'required', | ||
| 61 | + ],[ | ||
| 62 | + 'id.required' => 'id不能为空', | ||
| 63 | + ]); | ||
| 64 | + $data = $this->logic->getResultInfo(); | ||
| 65 | + $this->response('success',Code::SUCCESS,$data); | ||
| 66 | + } | ||
| 67 | +} |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoQuestionResLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/7/4 9:47 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Bside\Geo; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Bside\BaseLogic; | ||
| 13 | +use App\Models\Geo\GeoQuestionResult; | ||
| 14 | + | ||
| 15 | +class GeoQuestionResLogic extends BaseLogic | ||
| 16 | +{ | ||
| 17 | + public function __construct() | ||
| 18 | + { | ||
| 19 | + parent::__construct(); | ||
| 20 | + $this->model = new GeoQuestionResult(); | ||
| 21 | + $this->param = $this->requestAll; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * @remark :获取列表页数据 | ||
| 26 | + * @name :getResultList | ||
| 27 | + * @author :lyh | ||
| 28 | + * @method :post | ||
| 29 | + * @time :2025/7/4 9:48 | ||
| 30 | + */ | ||
| 31 | + public function getResultList($map = [],$page = 1,$row = 20,$order = 'id'){ | ||
| 32 | + $filed = ['id','project_id','question_id','platform','question','keywords','url']; | ||
| 33 | + $data = $this->model->lists($map,$page,$row,$order,$filed); | ||
| 34 | + return $this->success($data); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * @remark :获取数据详情 | ||
| 39 | + * @name :getResultInfo | ||
| 40 | + * @author :lyh | ||
| 41 | + * @method :post | ||
| 42 | + * @time :2025/7/4 10:19 | ||
| 43 | + */ | ||
| 44 | + public function getResultInfo(){ | ||
| 45 | + $data = $this->model->read($this->param); | ||
| 46 | + return $this->success($data); | ||
| 47 | + } | ||
| 48 | +} |
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | * @remark : | 3 | * @remark : |
| 4 | - * @name :GeoQuestionRes.php | 4 | + * @name :GeoQuestionResController.php |
| 5 | * @author :lyh | 5 | * @author :lyh |
| 6 | * @method :post | 6 | * @method :post |
| 7 | * @time :2025/7/3 16:01 | 7 | * @time :2025/7/3 16:01 |
| @@ -13,7 +13,7 @@ use App\Models\Base; | @@ -13,7 +13,7 @@ use App\Models\Base; | ||
| 13 | 13 | ||
| 14 | /** | 14 | /** |
| 15 | * @remark :geo设置请求结果 | 15 | * @remark :geo设置请求结果 |
| 16 | - * @name :GeoQuestionRes | 16 | + * @name :GeoQuestionResController |
| 17 | * @author :lyh | 17 | * @author :lyh |
| 18 | * @method :post | 18 | * @method :post |
| 19 | * @time :2025/7/3 16:01 | 19 | * @time :2025/7/3 16:01 |
| @@ -748,6 +748,12 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -748,6 +748,12 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 748 | Route::prefix('authority_score')->group(function () { | 748 | Route::prefix('authority_score')->group(function () { |
| 749 | Route::any('/authorityScoreInfo', [\App\Http\Controllers\Bside\BCom\AuthorityScoreController::class,'AuthorityScoreInfo'])->name('authority_score_AuthorityScoreInfo'); | 749 | Route::any('/authorityScoreInfo', [\App\Http\Controllers\Bside\BCom\AuthorityScoreController::class,'AuthorityScoreInfo'])->name('authority_score_AuthorityScoreInfo'); |
| 750 | }); | 750 | }); |
| 751 | + | ||
| 752 | + //geo设置 | ||
| 753 | + Route::prefix('geo_result')->group(function () { | ||
| 754 | + Route::any('/getList', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getList'])->name('geo_result_getList'); | ||
| 755 | + Route::any('/getInfo', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getInfo'])->name('geo_result_getInfo'); | ||
| 756 | + }); | ||
| 751 | }); | 757 | }); |
| 752 | //无需登录验证的路由组 | 758 | //无需登录验证的路由组 |
| 753 | Route::group([], function () { | 759 | Route::group([], function () { |
-
请 注册 或 登录 后发表评论