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


PHP Manager::enableQueryLog方法代码示例

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


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

示例1: asJsonResponse

 public function asJsonResponse()
 {
     $data = [];
     $total = $amount_displayed = 0;
     if ($this->model) {
         $model_name = $this->model;
         if ($this->columns) {
         }
         $sql = $model_name::query()->select($this->columns ?: '*');
         $search_info = $this->a->input('search');
         if (!empty($search_info['value'])) {
             foreach ($this->a->input('columns') as $index => $column) {
                 if ($index) {
                     $sql->orWhere($column['name'], 'LIKE', '%' . $search_info['value'] . '%');
                 } else {
                     $sql->where($column['name'], 'LIKE', '%' . $search_info['value'] . '%');
                 }
             }
         }
         foreach ($this->a->input('order', []) as $order) {
             $sql->orderBy($this->a->input('columns')[$order['col']]['name'], $order['dir']);
         }
         \Illuminate\Database\Capsule\Manager::enableQueryLog();
         $total = $sql->count();
         $sql->skip($this->a->input('start'));
         $models = $sql->take($this->a->input('length'))->get();
         $data = $models->toArray();
         $total = $total;
         $amount_displayed = count($models);
     }
     $data = ['aaData' => $data, 'iTotalRecords' => $total, 'iTotalDisplayRecords' => $amount_displayed];
     return new JsonResponse($data, 200);
 }
开发者ID:mindofmicah,项目名称:laravel-datatables,代码行数:33,代码来源:Datatable.php

示例2: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     $schema = Capsule::schema();
     $schema->dropIfExists('categories');
     $schema->create('categories', function (\Illuminate\Database\Schema\Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->softDeletes();
         NestedSet::columns($table);
     });
     Capsule::enableQueryLog();
 }
开发者ID:nutsdo,项目名称:nong-store,代码行数:12,代码来源:NodeTest.php

示例3: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     $schema = Capsule::schema();
     $schema->dropIfExists('menu_items');
     Capsule::disableQueryLog();
     $schema->create('menu_items', function (\Illuminate\Database\Schema\Blueprint $table) {
         $table->increments('id');
         $table->unsignedInteger('menu_id');
         $table->string('title')->nullable();
         NestedSet::columns($table);
     });
     Capsule::enableQueryLog();
 }
开发者ID:nutsdo,项目名称:nong-store,代码行数:13,代码来源:ScopedNodeTest.php


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