35 lines
922 B
PHP
35 lines
922 B
PHP
<?php
|
|
|
|
namespace app\adminapi\lists\crawler;
|
|
|
|
use app\adminapi\lists\BaseAdminDataLists;
|
|
use app\common\lists\ListsSearchInterface;
|
|
use app\common\model\CrawlErrorLog;
|
|
|
|
class CrawlErrorLogLists extends BaseAdminDataLists implements ListsSearchInterface
|
|
{
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'=' => ['task_name', 'error_type', 'channel', 'http_status'],
|
|
];
|
|
}
|
|
|
|
public function lists(): array
|
|
{
|
|
$lists = CrawlErrorLog::field('id,task_name,request_url,request_method,http_status,error_type,error_message,channel,notified,created_at')
|
|
->where($this->searchWhere)
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order('id', 'desc')
|
|
->select()
|
|
->toArray();
|
|
|
|
return $lists;
|
|
}
|
|
|
|
public function count(): int
|
|
{
|
|
return CrawlErrorLog::where($this->searchWhere)->count();
|
|
}
|
|
}
|