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


PHP Client::all方法代码示例

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


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

示例1: __construct

 public function __construct(Request $request)
 {
     /* This checks the client list for the CID. If a matching CID is found, all caching will be ignored
        for this request */
     if (Cache::has('clients')) {
         $clients = Cache::get('clients');
     } else {
         $clients = Client::all();
         Cache::put('clients', $clients, 1);
     }
     if (Cache::has('keys')) {
         $keys = Cache::get('keys');
     } else {
         $keys = Key::all();
         Cache::put('keys', $keys, 1);
     }
     $input_cid = $request->input('cid');
     if (!empty($input_cid)) {
         foreach ($clients as $client) {
             if ($client->uuid == $input_cid) {
                 $this->client = $client;
             }
         }
     }
     $input_key = $request->input('k');
     if (!empty($input_key)) {
         foreach ($keys as $key) {
             if ($key->api_key == $input_key) {
                 $this->key = $key;
             }
         }
     }
 }
开发者ID:Lord-Ptolemy,项目名称:LumenSolder,代码行数:33,代码来源:ApiController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (\Auth::guest()) {
         return redirect('auth/login');
     }
     $clients = Client::all();
     return view('clients/index')->with('clients', $clients);
 }
开发者ID:viliguravlad,项目名称:tokarevsg,代码行数:13,代码来源:NewClientsController.php

示例3: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $table_file = 'File';
     // capital in mysql !
     $table_job = 'Job';
     // capital in mysql !
     $timediff = null;
     $hoursdiff = null;
     $hoursbytes = null;
     /* 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");
     }
     // Get Server Hostname
     $servername = gethostname();
     // Get Number of Clients
     $clientsNumber = Client::all()->count();
     // Get Number of Files Transfered
     $filesNumber = \DB::table($table_file)->select(\DB::raw('count(*) AS filesNumber'))->get();
     // Get Storage Bytes
     $bytesStorage = Media::sum('volbytes');
     //* Query For Hour Starts
     $dataInicio = date('Y-m-d', strtotime("-1 days")) . ' 18:29';
     $dataFim = date('Y-m-d') . ' 18:29';
     if (\Config::get('database.default') == 'mysql') {
         /* Query timediff Stats */
         $timediff = \DB::table($table_job)->select(\DB::raw('TIMEDIFF(max(starttime) , min(starttime)) AS timediff'))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
         $hoursdiff = \DB::table($table_job)->select(\DB::raw("(HOUR(TIMEDIFF(max(starttime), min(starttime))) + (MINUTE(TIMEDIFF(max(starttime) , min(starttime))) / 60.0)) AS hoursdiff"))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
         $hoursbytes = \DB::table($table_job)->select(\DB::raw("(sum(jobbytes)/(HOUR(TIMEDIFF(max(starttime) , min(starttime))) + (MINUTE(TIMEDIFF(max(starttime) , min(starttime))) / 60.0))) AS hoursbytes"))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
         $query = \DB::table($table_job)->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim);
         $fnumber = $filesNumber[0]->filesNumber;
     } elseif (\Config::get('database.default') == 'pgsql') {
         /* Query timediff Stats */
         $timediff = \DB::table($table_job)->select(\DB::raw('(max(starttime) - min(starttime)) AS timediff'))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
         $hoursdiff = \DB::table($table_job)->select(\DB::raw("(date_part('hour',  (max(starttime) - min(starttime))) + (date_part('minutes',  (max(starttime) - min(starttime))) / 60.0)) AS hoursdiff"))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
         $hoursbytes = \DB::table($table_job)->select(\DB::raw("(sum(jobbytes)/(date_part('hour',  (max(starttime) - min(starttime))) + (date_part('minutes',  (max(starttime) - min(starttime))) / 60.0))) AS hoursbytes"))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
         $query = \DB::table($table_job)->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim);
         $fnumber = $filesNumber[0]->filesnumber;
     }
     $jobbytes = $query->sum('jobbytes');
     $starttime = $query->min('starttime');
     $endtime = $query->max('endtime');
     /* Data for Stats to Insert*/
     $daystats = array('data' => date('Y-m-d'), 'server' => $servername, 'bytes' => $bytesStorage, 'files' => $fnumber, 'clients' => $clientsNumber, 'databasesize' => $dbsize[0]->dbsize);
     $hourstats = array('data' => date('Y-m-d'), 'server' => $servername, 'bytes' => $jobbytes, 'starttime' => $starttime, 'endtime' => $endtime, 'timediff' => $timediff[0]->timediff, 'hoursdiff' => (int) $hoursdiff[0]->hoursdiff, 'hourbytes' => $hoursbytes[0]->hoursbytes);
     Hoursstats::firstOrCreate($hourstats);
     Daystats::firstOrCreate($daystats);
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:59,代码来源:BaculaStatsCommand.php

示例4: typeahead

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function typeahead()
 {
     $clients = Client::all();
     $all = [];
     foreach ($clients as $client) {
         $row = new \stdClass();
         $row->id = $client->id;
         $row->name = $client->name;
         $all[] = $row;
     }
     $this->data->data = $all;
     return $this->json();
 }
开发者ID:alfrecuellar,项目名称:muebles,代码行数:19,代码来源:ClientController.php

示例5: clientSelectBox

 public static function clientSelectBox($clientsall = null)
 {
     if ($clientsall == null) {
         $clientsall = Client::all()->toArray();
     }
     // Code to resolve pgsql names
     $f_Name = 'Name';
     $f_ClientID = 'ClientId';
     if (Config::get('database.default') == 'pgsql') {
         $f_Name = strtolower($f_Name);
         $f_ClientID = strtolower($f_ClientID);
     }
     //Both Engines :
     $clientsName = array_fetch($clientsall, $f_Name);
     $clientsId = array_fetch($clientsall, $f_ClientID);
     $clientSelectBox = array_combine($clientsId, $clientsName);
     natsort($clientSelectBox);
     return $clientSelectBox;
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:19,代码来源:Client.php

示例6: insertStats

 public function insertStats()
 {
     /* 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");
     }
     // Get Server Hostname
     $servername = gethostname();
     // Get Number of Clients
     $clientsNumber = Client::all()->count();
     // Get Number of Files Transfered
     $filesNumber = DB::table('file')->select(DB::raw('count(*) AS filesNumber'))->get();
     // Get Storage Bytes
     $bytesStorage = Media::sum('volbytes');
     //* Query For Hour Starts
     $dataInicio = date('Y-m-d', strtotime("-1 days")) . ' 18:29';
     $dataFim = date('Y-m-d') . ' 18:29';
     /* Query timediff Stats */
     $timediff = DB::table('job')->select(DB::raw('(max(starttime) - min(starttime)) AS timediff'))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
     $hoursdiff = DB::table('job')->select(DB::raw("date_part('hour',  (max(starttime) - min(starttime))) AS hoursdiff"))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
     $hoursbytes = DB::table('job')->select(DB::raw("(sum(jobbytes)/date_part('hour',  (max(starttime) - min(starttime)))) AS hoursbytes"))->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim)->get();
     $query = DB::table('job')->where('starttime', '>=', $dataInicio)->where('endtime', '<=', $dataFim);
     $jobbytes = $query->sum('jobbytes');
     $starttime = $query->min('starttime');
     $endtime = $query->max('endtime');
     /* Data for Stats to Insert*/
     $daystats = array('data' => date('Y-m-d'), 'server' => $servername, 'bytes' => $bytesStorage, 'files' => $filesNumber[0]->filesnumber, 'clients' => $clientsNumber, 'databasesize' => $dbsize[0]->dbsize);
     $hourstats = array('data' => date('Y-m-d'), 'server' => $servername, 'bytes' => $jobbytes, 'starttime' => $starttime, 'endtime' => $endtime, 'timediff' => $timediff[0]->timediff, 'hoursdiff' => $hoursdiff[0]->hoursdiff, 'hourbytes' => $hoursbytes[0]->hoursbytes);
     $hourstats = Hoursstats::firstOrCreate($hourstats);
     $daystats = Daystats::firstOrCreate($daystats);
     $t = Hoursstats::insert($hourstats);
     $d = Daystats::insert($daystats);
 }
开发者ID:acrixl,项目名称:Reportula,代码行数:39,代码来源:ActionsController.php

示例7: getIndex

 /**
  * show the invite request to the user
  *
  * @return Response
  */
 public function getIndex()
 {
     $this->data->clients = Client::all();
     return $this->view('home.index');
 }
开发者ID:alfrecuellar,项目名称:muebles,代码行数:10,代码来源:HomeController.php

示例8: function

    //    I know this is bad. It's gonna be gone soon.
    Route::get('projtypedelete/{id}', ['as' => 'projtypedelete', 'uses' => 'ProjectTypesController@destroy']);
    Route::get('projdelete/{id}', ['as' => 'projdelete', 'uses' => 'ProjectsController@destroy']);
    Route::get('quotedelete/{id}', ['as' => 'quotedelete', 'uses' => 'QuotesController@destroy']);
    Route::get('clientdelete/{id}', ['as' => 'clientdelete', 'uses' => 'ClientsController@destroy']);
    Route::get('messagedelete/{id}', ['as' => 'messagedelete', 'uses' => 'MessagesController@destroy']);
    Route::get('filedelete/{id}', ['as' => 'filedelete', 'uses' => 'FilesController@destroy']);
    Route::get('filetypedelete/{id}', ['as' => 'filetypedelete', 'uses' => 'FileTypesController@destroy']);
    Route::get('coverdelete/{id}', ['as' => 'coverdelete', 'uses' => 'CoverLettersController@destroy']);
    Route::post('generateLegitSlug', ['as' => 'generateLegitSlug', 'uses' => 'Blog\\BlogPostsController@generateLegitSlug']);
    Route::get('getfilesbytype/{id?}', ['as' => 'getfilesbytype', 'uses' => 'FilesController@getFilesByTypeId']);
    Route::get('/', function () {
        return view('admin.index');
    });
    Route::get('/clients', function () {
        $clients = \App\Models\Client::all();
        $quotes = \App\Models\Quote::all();
        return view('admin.clients', ['clients' => $clients, 'quotes' => $quotes]);
    });
});
Route::get('/speech', function () {
    return view('speechdemo');
});
Route::get('/blog', function () {
    $posts = \App\Models\Blog_Post::with('Author')->with('picture')->get();
    return view('front.blog.index', ['posts' => $posts]);
});
Route::get('/blog/{slug}', function ($slug) {
    $post = \App\Models\Blog_Post::where('slug', $slug)->with('Author')->with('picture')->first();
    if ($post) {
        return view('front.blog.viewPost', ['post' => $post]);
开发者ID:jardayn,项目名称:portfolio,代码行数:31,代码来源:routes.php

示例9: getAllClients

 public function getAllClients()
 {
     $clients = Client::all();
     return self::parseToJson(["message" => "success", "clients" => $clients]);
 }
开发者ID:JMitac,项目名称:WebService,代码行数:5,代码来源:ClienteController.php

示例10: getAllClientsCount

 public function getAllClientsCount()
 {
     return Client::all()->count();
 }
开发者ID:Bottelet,项目名称:Flarepoint-crm,代码行数:4,代码来源:ClientRepository.php

示例11: postMultiple

 public function postMultiple()
 {
     /*
     |
     | Getting information from user
     |
     */
     $userInfo = array();
     foreach (\Input::all() as $key => $value) {
         $userInfo[$key] = $value;
     }
     //var_dump($userInfo);
     $message = $userInfo['holidayText'];
     $state = $userInfo['state'];
     $spamOrClient = $userInfo['spamOrClient'];
     //echo $message;
     //echo $state;
     //echo $spamClient;
     /*
     |
     | Connecting to the turbosms api via soap connection
     |
     */
     $client = new SoapClient('http://turbosms.in.ua/api/wsdl.html');
     $auth = array('login' => 'bandson', 'password' => '031194vela');
     $result = $client->Auth($auth);
     //echo $result->AuthResult . ' ';
     /*
     |
     | Setting appropriate data
     |
     */
     $ruleMaleClient = ['state' => 'male', 'spamOrClient' => 'client'];
     $ruleMaleSpam = ['state' => 'male', 'spamOrClient' => 'spam'];
     $ruleMaleAll = ['state' => 'male'];
     $ruleFemaleClient = ['state' => 'female', 'spamOrClient' => 'client'];
     $ruleFemaleSpam = ['state' => 'female', 'spamOrClient' => 'spam'];
     $ruleFemaleAll = ['state' => 'female'];
     $ruleAllClient = ['spamOrClient' => 'client'];
     $ruleAllSpam = ['spamOrClient' => 'spam'];
     if ($state == "male") {
         $str = '';
         if ($spamOrClient == "spam") {
             $client = Client::where($ruleMaleSpam)->get();
             //echo $client;
         } else {
             if ($spamOrClient == "client") {
                 $client = Client::where($ruleMaleClient)->get();
                 //echo $client;
             } else {
                 if ($spamOrClient == "spCl") {
                     $client = Client::where($ruleMaleAll)->get();
                     //echo $client;
                 }
             }
         }
         foreach ($client as $row) {
             $str = $str . ',' . $row->mobNum;
         }
         $telephones = substr($str, 1);
         //echo $telephones;
     } else {
         if ($state == "female") {
             $str = '';
             if ($spamOrClient == "spam") {
                 $client = Client::where($ruleFemaleSpam)->get();
                 //echo $client;
             } else {
                 if ($spamOrClient == "client") {
                     $client = Client::where($ruleFemaleClient)->get();
                     //echo $client;
                 } else {
                     if ($spamOrClient == "spCl") {
                         $client = Client::where($ruleFemaleAll)->get();
                         //echo $client;
                     }
                 }
             }
             foreach ($client as $row) {
                 $str = $str . ',' . $row->mobNum;
             }
             $telephones = substr($str, 1);
             //echo $telephones;
         } else {
             if ($state == "all") {
                 $str = '';
                 if ($spamOrClient == "spam") {
                     $client = Client::where($ruleAllSpam)->get();
                     //echo $client;
                 } else {
                     if ($spamOrClient == "client") {
                         $client = Client::where($ruleAllClient)->get();
                         //echo $client;
                     } else {
                         if ($spamOrClient == "spCl") {
                             $client = Client::all();
                             //echo $client;
                         }
                     }
                 }
//.........这里部分代码省略.........
开发者ID:viliguravlad,项目名称:tokarevsg,代码行数:101,代码来源:SendController.php


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