本文整理匯總了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;
}