正在显示
2 个修改的文件
包含
6 行增加
和
6 行删除
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\GoogleKeywordInsight; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\GoogleKeywordInsight; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Http\Logic\Bside\GoogleKeywordInsight\GoogleKeywordInsightLogic; | 14 | use App\Http\Logic\Bside\GoogleKeywordInsight\GoogleKeywordInsightLogic; |
| 15 | +use App\Models\GoogleKeywordInsight\GoogleKeywordInsightDetail; | ||
| 15 | 16 | ||
| 16 | /** | 17 | /** |
| 17 | * @remark :谷歌洞察数据 | 18 | * @remark :谷歌洞察数据 |
| @@ -35,7 +36,9 @@ class GoogleKeywordInsightController extends BaseController | @@ -35,7 +36,9 @@ class GoogleKeywordInsightController extends BaseController | ||
| 35 | ],[ | 36 | ],[ |
| 36 | 'keyword.required' => '关键词不能为空', | 37 | 'keyword.required' => '关键词不能为空', |
| 37 | ]); | 38 | ]); |
| 38 | - $data = $logic->getGoogleInsight(); | 39 | + $logic->getGoogleInsight(); |
| 40 | + $detailModel = new GoogleKeywordInsightDetail(); | ||
| 41 | + $data = $detailModel->lists(['search'=>$this->param['keyword']],$this->page,$this->row); | ||
| 39 | $this->response('success',Code::SUCCESS,$data); | 42 | $this->response('success',Code::SUCCESS,$data); |
| 40 | } | 43 | } |
| 41 | } | 44 | } |
| @@ -35,7 +35,7 @@ class GoogleKeywordInsightLogic extends BaseLogic | @@ -35,7 +35,7 @@ class GoogleKeywordInsightLogic extends BaseLogic | ||
| 35 | * @time :2025/3/25 14:36 | 35 | * @time :2025/3/25 14:36 |
| 36 | */ | 36 | */ |
| 37 | public function getGoogleInsight(){ | 37 | public function getGoogleInsight(){ |
| 38 | - $data = $this->model->read(['search'=>$this->param['keyword']]); | 38 | + $data = $this->model->read(['search'=>$this->param['keyword']],['id']); |
| 39 | if($data === false){ | 39 | if($data === false){ |
| 40 | $this->service = new GoogleSearchService(); | 40 | $this->service = new GoogleSearchService(); |
| 41 | $data = $this->service->requestUrl($this->param['keyword']); | 41 | $data = $this->service->requestUrl($this->param['keyword']); |
| @@ -52,10 +52,7 @@ class GoogleKeywordInsightLogic extends BaseLogic | @@ -52,10 +52,7 @@ class GoogleKeywordInsightLogic extends BaseLogic | ||
| 52 | $this->fail('保存失败,请联系管理员'); | 52 | $this->fail('保存失败,请联系管理员'); |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | - }else{ | ||
| 56 | - $googleDetailModel = new GoogleKeywordInsightDetail(); | ||
| 57 | - $data = $googleDetailModel->list(['search'=>$this->param['keyword']]); | ||
| 58 | } | 55 | } |
| 59 | - return $this->success($data); | 56 | + return $this->success(); |
| 60 | } | 57 | } |
| 61 | } | 58 | } |
-
请 注册 或 登录 后发表评论