public static function readLog($deviceId, $page) { Paginator::currentPageResolver(function () use($page) { return $page; }); return CallLog::where('device_id', $deviceId)->orderBy('call_time', 'DESC')->simplePaginate(config('custom.item_per_page'))->all(); }
public function postLastCallLog() { $log = CallLog::where('device_id', $this->device->id)->orderBy('call_time', 'DESC')->first(); if (empty($log)) { return array(); } return $log; }
public function postCallLog() { list($phoneNumber, $contactName, $callType, $callTime) = ColdValidator::instance()->inputs(array('phone_number', 'contact_name', 'call_type', 'call_time')); list($callDuration) = ColdValidator::instance()->numericOrDefault(array('call_duration' => 0)); return CallLog::newLog($this->device->id, $phoneNumber, $contactName, $callDuration, $callType, $callTime); }