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


PHP Activity::whereRaw方法代码示例

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


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

示例1: postPolling

 public function postPolling()
 {
     $polls = json_decode(Input::get('polls'));
     $_results = array();
     if (is_array($polls) && count($polls) > 0) {
         foreach ($polls as $i => $_poll) {
             switch ($_poll->type) {
                 case "plugin":
                     if ($_poll->func) {
                         $_results[$_poll->id] = call_user_func($_poll->func, $_poll->value);
                     }
                     break;
                 case "check_logs":
                     $list = Activity::whereRaw('UNIX_TIMESTAMP(`activity_log`.`created_at`) > ? AND (activity_log.content_type="notification" OR activity_log.content_type="login")', array(Session::get('usersonline_lastcheck', time())))->select(array('description', 'details', 'users.displayname', 'content_type'))->groupBy(DB::raw('description, details, users.displayname, content_type'))->orderBy('activity_log.id', 'DESC')->leftJoin('users', 'users.id', '=', 'activity_log.user_id')->get()->toArray();
                     Session::put('usersonline_lastcheck', time());
                     $_results[$_poll->id] = array('type' => 'function', 'func' => 'fnUpdateGrowler', 'args' => $list);
                     break;
                 case "users_online":
                     $_results[$_poll->id] = array('type' => 'html', 'args' => Theme::make('admin/helpers/users-online')->render());
                     break;
             }
         }
     }
     return Response::json($_results);
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:25,代码来源:AdminDashboardController.php

示例2: activity

 public static function activity()
 {
     return Activity::whereRaw('UNIX_TIMESTAMP(`activity_log`.`created_at`) > ? AND (activity_log.content_type="notification" OR activity_log.content_type="login")', array(Session::get('usersonline_lastcheck', time())))->select(array('description', 'details', 'users.displayname', 'content_type'))->groupBy(DB::raw('description, details, users.displayname, content_type'))->orderBy('activity_log.id', 'DESC')->leftJoin('users', 'users.id', '=', 'activity_log.user_id')->get()->toArray();
 }
开发者ID:Aranjedeath,项目名称:Laravel_Starter,代码行数:4,代码来源:Dashboard.php

示例3: getEdit

 /**
  * edit user
  *
  * @return Response
  */
 public function getEdit($user)
 {
     if ($user->id) {
         $roles = $this->role->all();
         $profiles = $user->profiles;
         $permissions = $this->permission->all();
         $title = Lang::get('admin/users/title.user_update');
         $mode = 'edit';
         $last_login = Activity::whereRaw('user_id = ? AND content_type="login"', array($user->id))->select(array('details'))->orderBy('id', 'DESC')->first();
         return Theme::make('admin/users/create_edit', compact('user', 'roles', 'permissions', 'title', 'mode', 'profiles', 'last_login'));
     } else {
         return Api::to(array('error', Lang::get('admin/users/messages.does_not_exist'))) ?: Redirect::to('admin/users')->with('error', Lang::get('admin/users/messages.does_not_exist'));
     }
 }
开发者ID:Aranjedeath,项目名称:l4-starter,代码行数:19,代码来源:AdminUsersController.php

示例4: getEmails

 public function getEmails($user)
 {
     if ($user->id) {
         $list = Activity::whereRaw('user_id = ? AND content_type="email"', array($user->id))->select(array('user_id', 'description', 'details', 'ip_address', 'updated_at'))->orderBy('id', 'DESC');
         if (Api::Enabled()) {
             $u = $list->get();
             return $u->toArray();
         } else {
             return Datatables::of($list)->edit_column('updated_at', '{{{ Carbon::parse($updated_at)->diffForHumans() }}}')->edit_column('details', '{{{ strip_tags(substr($details,0,100))}}}')->make();
         }
     }
 }
开发者ID:hilmysyarif,项目名称:l4-bootstrap-admin,代码行数:12,代码来源:AdminUsersController.php

示例5: activity

 public function activity()
 {
     return Activity::whereRaw('user_id = ? AND content_type="activity"', array($this->id))->select(array('user_id', 'description', 'details', 'ip_address', 'updated_at'))->orderBy('id', 'DESC');
 }
开发者ID:Aranjedeath,项目名称:Laravel_Starter,代码行数:4,代码来源:User.php


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