GoogleLinkController.php
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @remark :
* @name :GoogleLinkController.php
* @author :lyh
* @method :post
* @time :2025/4/3 15:05
*/
namespace App\Http\Controllers\Bside\GoogleKeyword;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\GoogleSearch\GoogleLink;
use App\Services\GoogleLinkService;
class GoogleLinkController extends BaseController
{
/**
* @remark :外链数据
* @name :getLink
* @author :lyh
* @method :post
* @time :2025/4/3 16:09
*/
public function getLink(){
$linkModel = new GoogleLink();
$this->map['project_id'] = $this->user['project_id'];
$lists = $linkModel->lists($this->map,$this->page,$this->row,'id',['url','moz_da','status','google_search','date','project_id','domain']);
if(empty($lists['list'])){
$linkService = new GoogleLinkService();
$data = $linkService->linkPageData($this->user['domain'],$this->user['project_id']);
$lists = paginateArray($data,$this->page,$this->row);
}
$lists['y_total'] = $linkModel->counts(['status'=>1]);
$lists['n_total'] = $linkModel->counts(['status'=>0]);
$this->response('success',Code::SUCCESS,$lists);
}
}