test int log

hotfix/paypal-note
LMR 2 years ago
parent 6e6b64d965
commit 1435606462

@ -25,7 +25,8 @@ class Index extends CI_Controller
, 'ru' => 'chinahighlights_ru'
, 'it' => 'viaggio-in-cina'
, 'vac' => 'viaje-a-china'
, 'vc' => 'voyageschine',
, 'vc' => 'voyageschine'
, 'vchw' => 'voyageschine',
); //站点日志存储库,每个网站对应一个
public function __construct()
@ -106,6 +107,60 @@ class Index extends CI_Controller
}
}
//定时抓取订单日志 - 国际站
public function orders_view_path_int($COLI_SN, $sitecode = 'cht', $ip, $offset = 0)
{
// 测试数据
$COLI_SN = 1004250;
$sitecode = 'vchw';
$ip = '2a01:cb1c:8190:df00:dc11:12fb:3ed1:1bcb';
$offset = 0;
$query_string = "
* | select time_local,http_referer,request_uri,http_user_agent,http_x_forwarded_for
remote_addr,request_method,request_time,status,body_bytes_sent,upstream_response_time from log where
request_uri NOT like '%.jpg'
and request_uri NOT like '%.JPG'
and request_uri NOT like '%.png'
and request_uri NOT like '%.gif'
and request_uri NOT like '%.css'
and request_uri NOT like '%.webp'
and request_uri NOT like '%.js'
and request_uri NOT like '%.woff'
and request_uri NOT like '%.ttf'
and request_uri NOT like '%.eot'
and request_uri NOT like '%.ico'
and request_uri NOT like '/guide-use.php%'
and request_uri NOT like '/index.php%'
and request_uri NOT like '/secureforms/form_token'
and request_uri NOT like '/ip/'
and request_uri NOT like '/ajax/getads/'
and request_uri NOT like '/public/template/footer.html'
and request_uri NOT like '/public/%'
and (remote_addr='$ip' OR http_x_forwarded_for like '%$ip%')
"; //ORDER BY time_local ASC 时间精度不够,会导致相同排序错误,只能用系统默认排序
$from = time() - 604800; //往前 604800(7天), 1296000(15天)
$to = time();
$request = new Aliyun_Log_Models_GetLogsRequest('globalhoghlights', $this->logstore[$sitecode], $from, $to, '', $query_string, 100, $offset, true);
try {
$LogData = new StdClass;
$LogData->wl_sitecode = $sitecode;
$LogData->wl_COLI_SN = $COLI_SN; //订单SN
$response = $this->Log_Client->getLogs($request);
foreach ($response->getLogs() as $log) {
foreach ($log->getContents() as $key => $value) {
$LogData->$key = $value;
}
// $this->wwwlogs_model->add('wwwlogs', $LogData);
print_r($LogData);
}
} catch (Aliyun_Log_Exception $ex) {
print_r($ex);
} catch (Exception $ex) {
print_r($ex);
}
}
public function getLogs(Aliyun_Log_Client $client, $project, $logstore)
{
$topic = '';

Loading…
Cancel
Save