本文整理汇总了PHP中Logs::getAgentLogs方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::getAgentLogs方法的具体用法?PHP Logs::getAgentLogs怎么用?PHP Logs::getAgentLogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logs
的用法示例。
在下文中一共展示了Logs::getAgentLogs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
$this->respond(['GET', 'POST'], '/get-current', function ($request, $response, $service, $app) {
$agent = Agents::getCurrentAgent();
if (!empty($agent)) {
$response->json(Result::success('', $agent));
} else {
$response->json(Result::error('Agent not found'));
}
});
$this->respond(['GET', 'POST'], '/get/[i:id]', function ($request, $response, $service, $app) {
$id = $request->param('id');
// Access only for Current Agent
if (!Agents::isAdmin() && !Agents::isCurrentAgent($id)) {
$response->json(Result::error('Access is denied'));
} else {
$AgentResult = Agents::getAgentForEdit($id);
$LogsResult = Logs::getAgentLogs($id);
$result = array("AgentData" => $AgentResult, "AgentLogs" => $LogsResult);
if ($AgentResult) {
$response->json(Result::success('', $result));
} else {
$response->json(Result::error('Agent not found'));
}
}
});
$this->respond(['GET', 'POST'], '/edit/[:id]', function ($request, $response, $service, $app) {
$id = $request->param('id');
$data = json_decode($request->body(), true);
// Access only for Current Agent
if (!Agents::isAdmin() && !Agents::isCurrentAgent($id)) {
$response->json(Result::error('Access is denied'));
} else {
示例2: deleteAgentLogs
public static function deleteAgentLogs($agentID)
{
$logs = Logs::getAgentLogs($agentID);
foreach ($logs as $log) {
Logs::deleteLog($log['id']);
}
return;
}