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


PHP Bundle::where方法代码示例

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


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

示例1: showprofile

 /**
  * Show artist profile
  * 
  * return @Response
  */
 public function showprofile($user)
 {
     $profile = User::where('profile_url', '=', $user)->where('approved', '=', '0')->where('deleted_at', '=', null)->first();
     if (!is_null($profile)) {
         $activation = Activation::where('user', '=', $profile->id)->first();
         $page = Page::where('title', '=', 'faq-artist')->first();
         $transactions = Purchase::where('artist', '=', $profile->id)->get();
         if ($activation) {
             return View::make('artist.not-activated');
         } else {
             if ($profile) {
                 if ($profile->active == 1) {
                     $songs = Song::where('artist', '=', $profile->id)->where('completed', '=', '1')->orderBy('id', 'desc')->paginate(10);
                     $bundles = Bundle::where('artist', '=', $profile->id)->get();
                     $wall = new \Illuminate\Database\Eloquent\Collection();
                     $wall = $wall->merge($songs);
                     $wall = $wall->merge($bundles);
                     //dd($wall);
                     $followers = Follow::where('artist', '=', $profile->id)->get();
                     $countries = [];
                     foreach ($followers as $f) {
                         if (empty($f->profile->country)) {
                             $f->profile->country = 'Country unknown';
                         }
                         if (isset($countries[$f->profile->country])) {
                             $countries[$f->profile->country]++;
                         } else {
                             $countries[$f->profile->country] = 1;
                         }
                     }
                     $events = ArtistEvent::where('artist', '=', $profile->id)->where('date', '>', \Carbon\Carbon::now())->orderBy('id', 'desc')->take(3)->get();
                     $songs_in = [];
                     foreach ($songs as $s) {
                         $songs_in[] = $s->id;
                     }
                     if (count($songs_in) > 0) {
                         $comments = Comment::whereIn('song', $songs_in)->orderBy('id', 'desc')->take(3)->get();
                     } else {
                         $comments = "";
                     }
                     $wall->sortByDesc('created_at');
                     //dd($wall);
                     $notifications = MyNotification::where('user', '=', $profile->id)->get();
                     return View::make('artist.profile-new', ['profile' => $profile, 'songs' => $songs, 'events' => $events, 'comments' => $comments, 'notifications' => $notifications, 'wall' => $wall, 'page' => $page, 'transactions' => $transactions, 'countries' => $countries]);
                 } else {
                     return Redirect::to('profile/settings');
                 }
             } else {
                 App::abort(404);
             }
         }
     } else {
         App::abort(404);
     }
 }
开发者ID:centaurustech,项目名称:musicequity,代码行数:60,代码来源:ArtistsController.php


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