当前位置: 首页>>代码示例>>PHP>>正文


PHP Entry::where方法代码示例

本文整理汇总了PHP中Entry::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::where方法的具体用法?PHP Entry::where怎么用?PHP Entry::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show($groupName)
 {
     $group = Group::name($groupName)->with('creator')->firstOrFail();
     $group->checkAccess();
     $stats = ['contents' => intval(Content::where('group_id', $group->getKey())->count()), 'comments' => intval(Content::where('group_id', $group->getKey())->sum('comments')), 'entries' => intval(Entry::where('group_id', $group->getKey())->count()), 'banned' => intval(GroupBanned::where('group_id', $group->getKey())->count()), 'subscribers' => $group->subscribers, 'moderators' => intval(GroupModerator::where('group_id', $group->getKey())->count())];
     return array_merge($group->toArray(), ['stats' => $stats]);
 }
开发者ID:vegax87,项目名称:Strimoid,代码行数:7,代码来源:GroupController.php

示例2: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $x = 1;
     foreach (Group::all() as $group) {
         $contents = Content::where('group_id', $group->getKey())->count();
         $entries = Entry::where('group_id', $group->getKey())->count();
         $total = $contents + $entries;
         // Default activity is medium = 2
         $group->activity = 2;
         // Low activity, when nothing was added last week
         if ($total == 0) {
             $group->activity = 1;
         }
         if ($total > 15) {
             $group->activity = 3;
         }
         if ($total > 50) {
             $group->activity = 4;
         }
         $group->save();
         if (!($x % 100)) {
             $this->info($x . ' groups processed');
         }
         $x++;
     }
     $this->info('All groups processed');
 }
开发者ID:vegax87,项目名称:Strimoid,代码行数:32,代码来源:GroupActivity.php

示例3: isValidSlug

 protected function isValidSlug()
 {
     $slugs = Entry::where('slug', '=', $this->data['slug'])->first();
     if ($slugs > 0) {
         return;
     } else {
         $this->data['slug'] = $this->data['slug'] . $slugs;
     }
 }
开发者ID:judavi,项目名称:laravel-challenge,代码行数:9,代码来源:CreateEntryManager.php

示例4: updateEntry

 /**
  * Updates the admin entry.
  */
 public function updateEntry()
 {
     $input = Input::all();
     $entry = Entry::where('email', 'admin')->first();
     if ($entry) {
         $entry->update($input);
         $entry->save();
     }
     return Redirect::route('admin.index')->withInfo('Admin entry saved.');
 }
开发者ID:ajwgibson,项目名称:rugby-world-cup-laravel,代码行数:13,代码来源:AdminController.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  int  $logbook_id
  * @return Response
  */
 public function show($logbook_id)
 {
     try {
         $logbook = Logbook::findOrFail($logbook_id);
         $entries = Entry::where('logbook_id', $logbook_id)->orderBy('finished_at', 'desc')->orderBy('started_at', 'desc')->paginate(10);
         return View::make('logbooks.show', array('logbook' => $logbook, 'entries' => $entries));
     } catch (ModelNotFoundException $e) {
         return Redirect::to(route('logbooks.index'))->with('message', ['content' => 'Logboek niet gevonden!', 'class' => 'danger']);
     }
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:16,代码来源:LogbooksController.php

示例6: showAsAuthor

 public function showAsAuthor($token)
 {
     $entry = Entry::where('token', '=', $token)->first();
     if ($entry) {
         $positiveVotes = $entry->upVotes();
         $negativeVotes = $entry->downVotes();
         return View::make('entries.show')->with('entry', $entry)->with('votes_count', $entry->votes()->count())->with('positiveVotes', $positiveVotes)->with('negativeVotes', $negativeVotes)->with('is_author', true);
     } else {
         App::abort(404);
     }
 }
开发者ID:CreativeMons,项目名称:creative-city,代码行数:11,代码来源:EntryController.php

示例7: create

 public static function create($entry_id, $entry_type, $privacy)
 {
     $entry = Entry::where('entry_id', $entry_id)->where('type', $entry_type)->get()->first();
     if ($entry->count() > 0) {
         $entry->entry_id = $entry_id;
         $entry->type = $entry_type;
         $entry->privacy = $privacy;
         return $entry->save();
     } else {
         return false;
     }
 }
开发者ID:huuson94,项目名称:WebProject,代码行数:12,代码来源:FEEntriesHelper.php

示例8: getViewProfileDatas

 private function getViewProfileDatas($user_id)
 {
     $privacy = Privacy::where('name', "Công khai")->get()->first();
     $datas = array();
     if (FEUsersHelper::isCurrentUser($user_id)) {
         $entries = Entry::where('user_id', $user_id)->orderBy('updated_at', 'DESC')->paginate($this->entries_per_page);
         $left_albums = Album::where('user_id', $user_id)->orderBy('updated_at', 'DESC')->get();
     } else {
         $entries = Entry::where('user_id', $user_id)->where('privacy', $privacy->id)->orderBy('updated_at', 'DESC')->paginate($this->entries_per_page);
         $left_albums = Album::where('user_id', $user_id)->where('privacy', 1)->orderBy('updated_at', 'DESC')->get();
     }
     return array("entries" => $entries, "left_albums" => $left_albums);
 }
开发者ID:huuson94,项目名称:WebProject,代码行数:13,代码来源:FEViewController.php

示例9: calculateScore

 /**
  * Calculates the score for this entry.
  */
 public function calculateScore()
 {
     // Start with the group matches
     $score = $this->calculateMatchPredictionsScore();
     $admin_entry = Entry::where('email', 'admin')->first();
     if ($admin_entry) {
         $score = $score + $this->calculateGroupPredictionsScore($admin_entry);
         $score = $score + $this->calculateFinalEightScore($admin_entry);
         $score = $score + $this->calculateFinalFourScore($admin_entry);
         $score = $score + $this->calculateFinalTwoScore($admin_entry);
         $score = $score + $this->calculateWinnerScore($admin_entry);
     }
     $this->score = $score;
     $this->save();
 }
开发者ID:ajwgibson,项目名称:rugby-world-cup-laravel,代码行数:18,代码来源:Entry.php

示例10: requeue_deadbeats

 public function requeue_deadbeats()
 {
     dd("Don't run me yet, I'm not ready.");
     foreach (Entry::where('file_sha', null)->where('is_dir', 0)->get() as $entry) {
         $data = ['action' => 'create', 'entry' => $entry->toArray()];
         if (!$stored_entry->is_dir) {
             Queue::push('FileHandlerController@create', $data, $this->file_queue_id);
         }
     }
 }
开发者ID:andrewpurkett,项目名称:demo-dropbox-rest-service,代码行数:10,代码来源:DropboxCrawlerController.php

示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $entry = Entry::where('entid', '=', $id)->with('section')->get();
     //dd($entry[0]);
     // does user have access?
     if ($entry[0]->uid != $this->user->uid) {
         return Response::json(array('status' => false, 'errors' => array('total' => 'You are not authorized to delete this entry.')), 400);
     }
     //dd($entry[0]);
     if (Entry::delete_entry($id)) {
         if ($entry[0]->type == 100) {
             // SPECIAL CASE; deleting a monthly reset.
             $tmp = [];
             foreach ($entry[0]->section as $es) {
                 $tmp['balance'] = $es->amount;
                 DB::table('user_categories')->where('ucid', $es->ucid)->update($tmp);
             }
             return Response::json(array('success' => true), 200);
         }
         // first do reverse math on entry
         // fun stuff; if its a cc entry we're reversing, gotta be funky because I am a moron and did the
         // stupid ucid = 0 for everyones bank instead of just having an extra row for each user.
         $is_add = 0;
         if ($entry[0]->type == 50 || $entry[0]->type == 10 && $entry[0]->paid_to == 0) {
             $is_add = 1;
         }
         $this->do_the_math($id, $entry[0]->paid_to, $entry[0]->total_amount, $entry[0]->purchase_date, $is_add, 0, 1);
         // Then for each entry section
         foreach ($entry[0]->section as $es) {
             $this->do_the_math($id, $es->ucid, $es->amount, $entry[0]->purchase_date, 1, 0, 1, $es->paid_from, $entry[0]->type);
         }
         return Response::json(array('success' => true), 200);
     } else {
         return Response::json(array('status' => false, 'errors' => array('total' => 'There was a problem deleting this entry.')), 400);
     }
 }
开发者ID:bane138,项目名称:Nickelpinch,代码行数:42,代码来源:EntryController.php

示例12: archive

 public function archive($date)
 {
     $entries = Entry::where('created_at', '>=', $date)->where('created_at', '<=', $date . ' 23:59:59')->where('user_id', '=', Auth::user()->id)->get();
     $totalCalories = 0;
     $totalFats = 0;
     $totalCarbs = 0;
     $totalProteins = 0;
     foreach ($entries as $entry) {
         $totalCalories += $entry->calories;
         $totalFats += $entry->fats;
         $totalCarbs += $entry->carbohydrates;
         $totalProteins += $entry->proteins;
     }
     return View::make('entries.index')->with(compact('entries'))->with(compact('totalCalories'))->with(compact('totalFats'))->with(compact('totalCarbs'))->with(compact('totalProteins'));
 }
开发者ID:JustinMackenzie,项目名称:meal-log,代码行数:15,代码来源:EntriesController.php

示例13: search

 public function search($value)
 {
     return Response::json(Entry::where('name', 'LIKE', "%{$value}%")->get());
 }
开发者ID:judavi,项目名称:laravel-challenge,代码行数:4,代码来源:MainPageController.php

示例14: confirm

 /**
  * Confirms an entry to make it visible on the scoreboard. 
  */
 public function confirm($confirmation)
 {
     $entry = Entry::where('confirmation', $confirmation)->first();
     if ($entry) {
         $entry->confirmation = null;
         $entry->save();
         return View::make('entry.confirm');
     }
     return Redirect::route('entry.index')->withMessage("Sorry, the entry could not be confirmed.");
 }
开发者ID:ajwgibson,项目名称:rugby-world-cup-laravel,代码行数:13,代码来源:EntryController.php

示例15: results

 public function results()
 {
     $matches = Match::all();
     $admin_entry = Entry::where('email', 'admin')->first();
     return View::make('results')->with('matches', $matches)->with('entry', $admin_entry);
 }
开发者ID:ajwgibson,项目名称:rugby-world-cup-laravel,代码行数:6,代码来源:HomeController.php


注:本文中的Entry::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。