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


PHP History::where方法代码示例

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


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

示例1: getDetail

 public function getDetail($id)
 {
     $_id = new MongoId($id);
     $history = History::where('historyObject._id', $_id)->where('historyObjectType', 'asset')->orderBy('historyTimestamp', 'desc')->orderBy('historySequence', 'desc')->get();
     $diffs = array();
     foreach ($history as $h) {
         $h->date = date('Y-m-d H:i:s', $h->historyTimestamp->sec);
         $diffs[$h->date][$h->historySequence] = $h->historyObject;
     }
     $history = History::where('historyObject._id', $_id)->where('historyObjectType', 'asset')->where('historySequence', 0)->orderBy('historyTimestamp', 'desc')->get();
     $tab_data = array();
     foreach ($history as $h) {
         $apv_status = Assets::getApprovalStatus($h->approvalTicket);
         if ($apv_status == 'pending') {
             $bt_apv = '<span class="btn btn-info change-approval ' . $h->approvalTicket . '" data-id="' . $h->approvalTicket . '" >' . $apv_status . '</span>';
         } else {
             if ($apv_status == 'verified') {
                 $bt_apv = '<span class="btn btn-success" >' . $apv_status . '</span>';
             } else {
                 $bt_apv = '';
             }
         }
         $d = date('Y-m-d H:i:s', $h->historyTimestamp->sec);
         $tab_data[] = array($d, $h->historyAction, $h->historyObject['itemDescription'], $h->historyAction == 'new' ? 'NA' : $this->objdiff($diffs[$d]), $bt_apv);
     }
     $header = array('Modified', 'Event', 'Name', 'Diff', 'Approval');
     $attr = array('class' => 'table', 'id' => 'transTab', 'style' => 'width:100%;', 'border' => '0');
     $t = new HtmlTable($tab_data, $attr, $header);
     $itemtable = $t->build();
     $asset = Asset::find($id);
     Breadcrumbs::addCrumb('Ad Assets', URL::to(strtolower($this->controller_name)));
     Breadcrumbs::addCrumb('Detail', URL::to(strtolower($this->controller_name) . '/detail/' . $asset->_id));
     Breadcrumbs::addCrumb($asset->SKU, URL::to(strtolower($this->controller_name)));
     return View::make('history.table')->with('a', $asset)->with('title', 'Asset Detail ' . $asset->itemDescription)->with('table', $itemtable);
 }
开发者ID:awidarto,项目名称:jexadmin,代码行数:35,代码来源:OrderarchiveController.php

示例2: index

 public function index()
 {
     if (!Auth::check()) {
         return Redirect::to('/');
     }
     $user = Auth::user();
     if (Scheduler::where('uid', '=', $user->id)->count() > 0) {
         return Redirect::to('/inline');
     }
     $count_matches = History::where('uid', '=', $user->id)->count();
     //return Scheduler::where('uid', '=', $user->id)->count();
     return View::make('sessions.index', ['count' => $count_matches]);
 }
开发者ID:neostoic,项目名称:sharemeal,代码行数:13,代码来源:MemberSessionController.php

示例3: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $log = new Process();
     $log->name = "make-history";
     $log->status = "running";
     $log->save();
     $today = Carbon::today();
     $topToday = array();
     $newspapers = Newspaper::select('id')->get();
     $tags = Tag::select('id')->get();
     foreach ($newspapers as $key => $n) {
         $top = $this->getTopLink($today, $n->id, false);
         if ($top) {
             $topToday[] = $top;
         }
     }
     foreach ($tags as $key => $t) {
         $top = $this->getTopLink($today, false, $t->id);
         if ($top) {
             $topToday[] = $top;
         }
     }
     $topToday = array_unique($topToday);
     //Remove links for today
     History::where('date', '=', $today)->delete();
     //Save history
     foreach ($topToday as $key => $t) {
         $this->info($t->title);
         try {
             $h = new History();
             $h->id_ref = $t->id;
             unset($t->id);
             $h->fill($t->toArray());
             $h->date = $today;
             $h->save();
         } catch (Exception $e) {
         }
     }
     $log->status = "finished";
     $log->save();
 }
开发者ID:vmariano,项目名称:shared-links-ranking,代码行数:46,代码来源:HistoryCommand.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (!Auth::check()) {
         return Redirect::to('/');
     }
     $user = Auth::user();
     if (Scheduler::where('uid', '=', $user->id)->count() > 0) {
         return Redirect::to('/inline');
     }
     $zipcode = Session::get('zipcode');
     $gender = Session::get('gender');
     if (!isset($zipcode) || !isset($gender)) {
         return Redirect::route('sessions.index');
     }
     $query = "search?location=" . $zipcode[0] . "&term=";
     $cuisines = Session::get('cuisines');
     for ($i = 0; $i < count($cuisines); $i++) {
         $query = $query . $cuisines[$i] . "+";
     }
     $query = $query . "food";
     //return $query;
     $results = Shareameal\Yelp\Yelp::search($query);
     if (!isset($results)) {
         return Redirect::to('/404error');
     }
     //Get relevant information and send to view
     $businesses_id = array_fetch($results['businesses'], 'id');
     $businesses_name = array_fetch($results['businesses'], 'name');
     $businesses_locations = array_fetch($results['businesses'], 'location.address');
     $businesses_url = array_fetch($results['businesses'], 'url');
     $waiting = [];
     for ($j = 0; $j < count($businesses_id); $j++) {
         $count = Scheduler::where('rid', '=', $businesses_id[$j])->count();
         if ($count >= 1) {
             $sch = Scheduler::where('rid', '=', $businesses_id[$j])->firstorFail();
             //$waiting[] = $sch;
             $scheduler_user = User::find($sch->uid);
             if ($gender[0] == "either" || $scheduler_user->gender == $gender[0]) {
                 //Gender Test Passed on Current User
                 if ($sch->gender == "either" || $sch->gender == $user->gender) {
                     // Gender Test Passed on user in Scheduler
                     #return History::where('uid', '=' ,$user->id)->where('matched_id', '=',$scheduler_user->id)->where('ban', '=', 'yes')->count();
                     if (History::where('uid', '=', $user->id)->where('matched_id', '=', $scheduler_user->id)->where('ban', '=', 'yes')->count() == 0 && History::where('uid', '=', $scheduler_user->id)->where('matched_id', '=', $user->id)->where('ban', '=', 'yes')->count() == 0) {
                         //Not on each others ban list
                         array_push($waiting, $sch);
                         // Then add this restaurant to the waiting restaurants
                     }
                 }
             }
             // Remove this restaurant from the list
             unset($businesses_id[$j]);
             unset($businesses_name[$j]);
             unset($businesses_locations[$j]);
             unset($businesses_url[$j]);
             $businesses_id = array_values($businesses_id);
             $businesses_name = array_values($businesses_name);
             $businesses_locations = array_values($businesses_locations);
             $businesses_url = array_values($businesses_url);
             $j--;
         }
     }
     return View::make('results.show', ['waiting' => $waiting, 'rest_id' => $businesses_id, 'rest_name' => $businesses_name, 'rest_locations' => $businesses_locations, 'rest_url' => $businesses_url]);
 }
开发者ID:neostoic,项目名称:sharemeal,代码行数:68,代码来源:SchedulerController.php

示例5: history

 public function history()
 {
     $searchcontent = Input::get('searchcontent');
     $createdtime = Input::get('registration_date');
     $data = History::where('assetcode', $searchcontent)->where('created_at', '>', $createdtime)->get();
     return view('history', compact('data'));
 }
开发者ID:cmrlweb,项目名称:CMRL_LARAVEL,代码行数:7,代码来源:HomeController.php

示例6: array

      <td><strong><?php 
echo $this->t('user_edits');
?>
</strong></td>
      <td><?php 
echo $this->linkTo(History::where(['user_id' => $this->user->id])->count(), array('history#index', 'search' => 'user:' . $this->user->name));
?>
</td>
    </tr>
    <tr>
      <td><strong><?php 
echo $this->t('user_tag_edits');
?>
</strong></td>
      <td><?php 
echo $this->linkTo(History::where(['user_id' => $this->user->id, 'group_by_table' => 'posts'])->count(), array('history#index', 'search' => 'type:post user:' . $this->user->name));
?>
</td>
    </tr>
    <tr>
      <td><strong><?php 
echo $this->t('user_note_edits');
?>
</strong></td>
      <td><?php 
echo $this->linkTo(NoteVersion::where(['user_id' => $this->user->id])->count(), array('note#history', 'user_id' => $this->user->id));
?>
</td>
    </tr>
    <tr>
      <td><strong><?php 
开发者ID:JCQS04,项目名称:myimouto,代码行数:31,代码来源:show.php

示例7: renderHistoryView

 public function renderHistoryView()
 {
     $user = Auth::user();
     $history = History::where('uid', '=', $user->id)->get();
     return View::make('history.index', ['history' => $history]);
 }
开发者ID:neostoic,项目名称:sharemeal,代码行数:6,代码来源:HistoryController.php


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