예제 #1
0
 /**
  * Recalculates score based on current vote composition.
  *
  * @return Description
  */
 protected function updateScore()
 {
     $votes = $this->vote_ups + $this->vote_downs;
     $ratio = $this->vote_downs > 0 ? $this->vote_ups / $this->vote_downs : 1;
     $score = round($votes * $ratio, 2);
     \Log::info($this->id . ': ' . $score);
     $this->score = $score;
     return $this;
 }
 public static function registroPersonaTicket($idPersona, $id_ticket, $idUsuCrea)
 {
     $persona_aplicativo = new aplicativo_ticket_persona();
     $persona_aplicativo->aplicativo_id = $id_ticket;
     $persona_aplicativo->ticket_persona_id = $idPersona;
     $persona_aplicativo->usucrea = $idUsuCrea;
     $persona_aplicativo->estado = '0';
     $persona_aplicativo->save();
     \Log::info('Se registro Correctamente el aplicativo en la cuenta...dao: aplicativo_ticket_persona/36.');
     return $persona_aplicativo->ticket_persona_id;
 }
예제 #3
0
 public function fire($job, $data)
 {
     // Could be added to database here!
     Log::info('We can put this in the database: ' . print_r($data, TRUE));
     $job->delete();
 }
예제 #4
0
 public function fastParse(VKUsers $forUser, $logger = false, $notLoadUsers = false)
 {
     if ($this->offset > 996) {
         return false;
     }
     $this->count++;
     $this->save();
     $f = $this->filter;
     $inApi = [];
     $inPostProgress = [];
     \Log::info('MEM_3_1 ' . memory_get_usage());
     $this->processFilters($inApi, $inPostProgress, $f);
     \Log::info('MEM_3_2 ' . memory_get_usage());
     if (count($inApi) < 3 && $this->search_offset == 0) {
         //			$this->search_offset = 800;
     }
     $inApi['offset'] = $this->search_offset;
     \Log::info('MEM_3_3 ' . memory_get_usage());
     $searcher = new VKSearch($inApi, $inPostProgress, $this->user->access_token);
     \Log::info('MEM_3_4 ' . memory_get_usage());
     $arUsers = $searcher->execute($countFetch, $logger);
     \Log::info('MEM_3_5 ' . memory_get_usage());
     $arExist = DB::table('filter_user')->select('user_id')->where('filter_id', $this->id)->get();
     $arExist = array_map(function ($item) {
         return $item->user_id;
     }, $arExist);
     $arNew = array_map(function ($item) {
         return $item->id;
     }, $arUsers);
     $diff = array_diff($arNew, $arExist);
     $diff = array_unique($diff);
     $diff = array_map(function ($item) {
         return ['user_id' => $item, 'filter_id' => $this->id];
     }, $diff);
     DB::table('filter_user')->insert($diff);
     \Log::info('MEM_3_6 ' . memory_get_usage());
     $this->search_offset += $countFetch;
     $this->save();
     \Log::info('MEM_3_7 ' . memory_get_usage());
     if ($notLoadUsers) {
         return [];
     } else {
         return $this->users()->whereNotIn('vk_users.id', $forUser->getPassedUserIds())->take(20)->get();
     }
 }
예제 #5
0
파일: Todo.php 프로젝트: shafi-/vlibrary
 public static function insertToTask($a)
 {
     \Log::info('**********........Todo MODEL.................insertToTask function');
     DB::insert('insert into tasks (user_id, name, created_at, updated_at) ' . 'values (?, ? , ?, ?)', [6, $a, 'now()', 'now()']);
 }