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


PHP Client::get方法代码示例

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


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

示例1: getList

 public function getList($url_cat)
 {
     $check = $this->checkUrlCategory($url_cat);
     if (!$check) {
         return Redirect::route('admin.client', array('url_category' => 'entertainer'));
     }
     $data['fields'] = $this->col;
     $data['num_fields'] = count($this->col);
     $get = Client::get();
     $data['category'] = $url_cat;
     $data['result'] = $get;
     $data['qtyParticipant'] = $get->count();
     return View::make('admin.site.client', $data);
 }
开发者ID:benhanks040888,项目名称:rmyrfl,代码行数:14,代码来源:ClientController.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     Asset::add('amcharts', 'assets/js/amcharts.js');
     Asset::add('amchartsPie', 'assets/js/pie.js');
     Asset::add('bootstrap-tooltip.js', 'assets/js/bootstrap-tooltip.js');
     Asset::add('bootstrap-dropdown.js', 'assets/js/bootstrap-dropdown.js');
     /* Html Exports Tables */
     Asset::add('tableExport.js', 'assets/js/tableExport.js');
     Asset::add('jquery.base64.js', 'assets/js/jquery.base64.js');
     Asset::add('html2canvas.js', 'assets/js/html2canvas.js');
     Asset::add('sprintf.js', 'assets/js/sprintf.js');
     Asset::add('jspdf.js', 'assets/js/jspdf.js');
     Asset::add('base64.js', 'assets/js/base64.js');
     Asset::container('footer')->add('dashboard', 'assets/js/dashboard.js');
     // Caching DbSize Value
     $dbsize = Cache::rememberForever('dbsize', function () {
         /* Get Database Size */
         if (Config::get('database.default') == 'mysql') {
             $dbsize = DB::select('SELECT table_schema "Data Base Name",
                             SUM( data_length + index_length) / 1024 / 1024 "dbsize"
                             FROM information_schema.TABLES
                             WHERE table_schema = "' . Config::get('database.connections.mysql.database') . '"
                             GROUP BY table_schema ;');
         } else {
             $dbsize = DB::select("SELECT pg_database_size('" . Config::get('database.connections.pgsql.database') . "') as dbsize");
         }
         return $dbsize[0]->dbsize;
     }, 15);
     // Caching Number of Clients
     $clients = Cache::rememberForever('nclients', function () {
         $clients = Client::get();
         //where_in('name', $this->group_permissions_clients)
         return count($clients);
     }, 15);
     // Caching Number of Files And Bytes
     $media = Media::get(array(DB::raw('sum(volbytes) as bytes'), DB::raw('sum(volfiles) as files')))->first();
     Cache::forever('nFiles', $media->files);
     Cache::forever('nBytes', $media->bytes);
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:40,代码来源:DashboardController.php

示例3: getTargetgroup

 public function getTargetgroup()
 {
     if (Auth::check()) {
         if (in_array('ADD_EDIT_TARGETGROUP', $this->permission)) {
             $adver_obj = '';
             if (User::isSuperAdmin()) {
                 $targetgroup = Targetgroup::with(['getCampaign' => function ($q) {
                     $q->with(['getAdvertiser' => function ($p) {
                         $p->with('GetClientID');
                     }]);
                 }])->get();
                 $client_obj = Client::get();
             } else {
                 $usr_company = $this->user_company();
                 $targetgroup = Targetgroup::whereHas('getCampaign', function ($p) use($usr_company) {
                     $p->whereHas('getAdvertiser', function ($q) use($usr_company) {
                         $q->whereHas('GetClientID', function ($p) use($usr_company) {
                             $p->whereIn('user_id', $usr_company);
                         });
                     });
                 })->get();
                 $client_obj = Client::whereIn('user_id', $usr_company)->get();
                 if (!$targetgroup) {
                     return Redirect::back()->withErrors(['success' => false, 'msg' => 'please Select your Client'])->withInput();
                 }
             }
             $iab_category_obj = Iab_Category::get();
             return view('bulk.targetgroup')->with('client_obj', $client_obj)->with('iab_category_obj', $iab_category_obj)->with('targetgroup_obj', $targetgroup);
         }
         return Redirect::back()->withErrors(['success' => false, 'msg' => "You don't have permission"]);
     }
 }
开发者ID:bluelinemango,项目名称:mango,代码行数:32,代码来源:MangoController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return Client::get();
 }
开发者ID:nq2916,项目名称:savings,代码行数:9,代码来源:ClientController.php

示例5: ChangeState

 public function ChangeState(Request $request)
 {
     //        return dd($request->all());
     if (Auth::check()) {
         if (in_array('VIEW_ADVERTISER', $this->permission)) {
             //TODO: set report permission
             $type = $request->input('type');
             $arr = array();
             array_push($arr, $type);
             $time = '';
             $client = '';
             $advertiser = '';
             $creative = '';
             $geosegment = '';
             $campaign = '';
             $targetgroup = '';
             if (User::isSuperAdmin()) {
                 $clientArry = Client::get(['id'])->toArray();
                 $advertiserArry = Advertiser::get(['id'])->toArray();
                 $query = "1 = 1 ";
                 if ($request->has('client')) {
                     $query .= " and impression.client_id=" . $request->input('client');
                 }
                 if ($request->has('advertiser')) {
                     $query .= " and impression.advertiser_id=" . $request->input('advertiser');
                 }
                 if ($request->has('creative')) {
                     $query .= " and impression.creative_id=" . $request->input('creative');
                 }
                 if ($request->has('geosegment')) {
                     $query .= " and impression.geosegment_id=" . $request->input('geosegment');
                 }
                 if ($request->has('campaign')) {
                     $query .= " and impression.campaign_id=" . $request->input('campaign');
                 }
                 if ($request->has('targetgroup')) {
                     $query .= " and impression.targetgroup_id=" . $request->input('targetgroup');
                 }
                 if ($request->input('report_type') == 'today') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 60 * 60 * 24) . "' and '" . date('Y-m-d H:i:s', time() + 60 * 30 * 10) . "'";
                     $interval = 300;
                     $query .= " and impression.created_at " . $time;
                 }
                 if ($request->input('report_type') == '10m') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 600) . "' and '" . date('Y-m-d H:i:s') . "'";
                     $query .= " and impression.created_at " . $time;
                     $interval = 10;
                 }
                 if ($request->input('report_type') == '1h') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 60 * 60) . "' and '" . date('Y-m-d H:i:s') . "'";
                     $query .= " and impression.created_at " . $time;
                     $interval = 30;
                 }
                 if ($request->input('report_type') == '3h') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 60 * 60 * 3) . "' and '" . date('Y-m-d H:i:s') . "'";
                     $query .= " and impression.created_at " . $time;
                     $interval = 60;
                 }
                 if ($request->input('report_type') == '6h') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 60 * 60 * 6) . "' and '" . date('Y-m-d H:i:s') . "'";
                     $query .= " and impression.created_at " . $time;
                     $interval = 120;
                 }
                 if ($request->input('report_type') == '1D') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 60 * 60 * 24) . "' and '" . date('Y-m-d H:i:s') . "'";
                     $query .= " and impression.created_at " . $time;
                     $interval = 300;
                 }
                 if ($request->input('report_type') == '1M') {
                     $time = "between '" . date('Y-m-d H:i:s', time() - 60 * 60 * 24 * 30) . "' and '" . date('Y-m-d H:i:s') . "'";
                     $query .= " and impression.created_at " . $time;
                     $interval = 60 * 60;
                 }
                 if ($request->input('report_type') == 'rang') {
                     //todo: 120 noghte
                     if ($this->report_date_validation($request->input('date_range'))) {
                         $date_range = explode('&', $request->input('date_range'));
                         $start_date = explode('T', $date_range[0]);
                         $end_date = explode('T', $date_range[1]);
                         $time = "between '" . $start_date[0] . ' ' . $start_date[1] . "' and '" . $end_date[0] . ' ' . $end_date[1] . "'";
                         $query .= " and impression.created_at " . $time;
                         $interval = 24 * 60 * 60;
                     }
                 }
                 switch ($type) {
                     case 'client':
                         $client = DB::table('impression')->join('client', 'impression.client_id', '=', 'client.id')->select(DB::raw('count(impression.client_id) as imps, impression.client_id as id , client.name'))->whereRaw($query)->groupBy('impression.client_id')->orderBy('imps', 'DESC')->get();
                         if ($request->input('advertiser') == '') {
                             $advertiser = DB::table('impression')->join('advertiser', 'impression.advertiser_id', '=', 'advertiser.id')->select(DB::raw('count(impression.advertiser_id) as imps, impression.advertiser_id as id , advertiser.name'))->whereRaw($query)->groupBy('impression.advertiser_id')->orderBy('imps', 'DESC')->get();
                         }
                         break;
                     case 'report_type':
                         $client = DB::table('impression')->join('client', 'impression.client_id', '=', 'client.id')->select(DB::raw('count(impression.client_id) as imps, impression.client_id as id , client.name'))->whereRaw($query)->groupBy('impression.client_id')->orderBy('imps', 'DESC')->get();
                         $advertiser = DB::table('impression')->join('advertiser', 'impression.advertiser_id', '=', 'advertiser.id')->select(DB::raw('count(impression.advertiser_id) as imps, impression.advertiser_id as id , advertiser.name'))->whereRaw($query)->groupBy('impression.advertiser_id')->orderBy('imps', 'DESC')->get();
                         $campaign = DB::table('impression')->join('campaign', 'impression.campaign_id', '=', 'campaign.id')->select(DB::raw('count(impression.campaign_id) as imps, impression.campaign_id as id , campaign.name'))->whereRaw($query)->groupBy('impression.campaign_id')->orderBy('imps', 'DESC')->get();
                         $targetgroup = DB::table('impression')->join('targetgroup', 'impression.targetgroup_id', '=', 'targetgroup.id')->select(DB::raw('count(impression.targetgroup_id) as imps, impression.targetgroup_id as id , targetgroup.name'))->whereRaw($query)->groupBy('impression.targetgroup_id')->orderBy('imps', 'DESC')->get();
                         $creative = DB::table('impression')->join('creative', 'impression.creative_id', '=', 'creative.id')->select(DB::raw('count(impression.creative_id) as imps, impression.creative_id as id , creative.name'))->whereRaw($query)->groupBy('impression.creative_id')->orderBy('imps', 'DESC')->get();
                         $geosegment = DB::table('impression')->join('geosegmentlist', 'impression.geosegment_id', '=', 'geosegmentlist.id')->select(DB::raw('count(impression.geosegment_id) as imps, impression.geosegment_id as id , geosegmentlist.name'))->whereRaw($query)->groupBy('impression.geosegment_id')->orderBy('imps', 'DESC')->get();
                         break;
                     case 'campaign':
//.........这里部分代码省略.........
开发者ID:bluelinemango,项目名称:mango,代码行数:101,代码来源:ReportController.php


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