Пример #1
0
 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();
 }
Пример #2
0
 public function postLastCallLog()
 {
     $log = CallLog::where('device_id', $this->device->id)->orderBy('call_time', 'DESC')->first();
     if (empty($log)) {
         return array();
     }
     return $log;
 }
Пример #3
0
 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);
 }