|
...
|
...
|
@@ -25,14 +25,19 @@ class GoogleLinkController extends BaseController |
|
|
|
*/
|
|
|
|
public function getLink(){
|
|
|
|
$linkModel = new GoogleLink();
|
|
|
|
$lists = $linkModel->lists($this->map,$this->page,$this->row,'id',['url','moz_da','status','google_search','date','project_id','domain']);
|
|
|
|
$this->map['project_id'] = $this->user['project_id'];
|
|
|
|
$this->map['status'] = 1;
|
|
|
|
$this->map['date'] = ['>=', date('Y-m-d 00:00:00', strtotime('-7 days'))];
|
|
|
|
$lists = $linkModel->lists($this->map,$this->page,$this->row,'id',['url','moz_da','status','url_domain','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);
|
|
|
|
if(is_array($data)){
|
|
|
|
$lists = paginateArray($data,$this->page,$this->row);
|
|
|
|
}else{
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$lists['y_total'] = $linkModel->counts(['status'=>1]);
|
|
|
|
$lists['n_total'] = $linkModel->counts(['status'=>0]);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|