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


PHP DB::table方法代码示例

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


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

示例1: AplicativoFaltantedelTicket

 public static function AplicativoFaltantedelTicket($idPersona)
 {
     $resultado = \DB::table('aplicativo')->select(['aplicativo.id', 'aplicativo.nombre_aplicativo'])->whereNotIn('aplicativo.id', function ($query) use($idPersona) {
         $query->select(['aplicativo_ticket_persona.aplicativo_id'])->from('persona_tickets')->where('persona_tickets.persona_id', $idPersona)->join('aplicativo_ticket_persona', 'persona_tickets.id', '=', 'aplicativo_ticket_persona.ticket_persona_id')->get();
     })->get();
     return $resultado;
 }
开发者ID:juans05,项目名称:rimacSeguros,代码行数:7,代码来源:Aplicativo.php

示例2: buscarAplicativoRelacionados2

 public static function buscarAplicativoRelacionados2($idTicket_persona)
 {
     $result = \DB::table('aplicativo_ticket_persona')->select(['aplicativo.nombre_aplicativo', 'aplicativo.id', 'aplicativo_ticket_persona.created_at', 'aplicativo_ticket_persona.usucrea'])->whereIn('aplicativo_ticket_persona.ticket_persona_id', function ($query) use($idTicket_persona) {
         $query->select(['persona_tickets.id'])->from('persona_tickets')->where('persona_tickets.id', $idTicket_persona)->get();
     })->join('aplicativo', 'aplicativo_ticket_persona.aplicativo_id', '=', 'aplicativo.id')->get();
     return $result;
 }
开发者ID:juans05,项目名称:rimacSeguros,代码行数:7,代码来源:Ticket.php

示例3: notify

 public static function notify($idArr = array(), $body, $type, $to_all = 0, $is_system = 0)
 {
     $currentId = auth()->id();
     if (!$currentId) {
         return;
     }
     $data = $notifiedUidArr = [];
     $now = \Carbon\Carbon::now();
     if ($to_all) {
         $data = ['user_id' => 0, 'body' => $body, 'type' => $type, 'to_all' => $to_all, 'is_system' => $is_system, 'created_at' => $now, 'updated_at' => $now];
     } elseif (!empty($idArr)) {
         $idArr = array_unique($idArr);
         foreach ($idArr as $id) {
             if ($id == $currentId) {
                 return;
             }
             $data[] = ['user_id' => $id, 'body' => $body, 'type' => $type, 'to_all' => $to_all, 'is_system' => $is_system, 'created_at' => $now, 'updated_at' => $now];
             $notifiedUidArr[] = $id;
         }
     }
     if (!empty($data)) {
         Notify::insert($data);
         if ($to_all) {
             \DB::table('users')->increment('notice_count');
         } elseif ($notifiedUidArr) {
             User::whereIn('id', $notifiedUidArr)->increment('notice_count');
         }
     }
 }
开发者ID:misterebs,项目名称:cmsku,代码行数:29,代码来源:Notify.php

示例4: getMatches

 /**
  * [getMatches description]
  * @param  [type] $tournament_id [description]
  * @param  [type] $player_id     [description]
  * @return [type]                [description]
  */
 public function getMatches($tournament_id, $player_id)
 {
     $m = \DB::table('matches')->join('tournaments', 'tournaments.tournament_id', '=', 'matches.tournament_id')->join('players as winner', 'winner.player_id', '=', 'matches.player1_id')->join('players as loser', 'loser.player_id', '=', 'matches.player2_id')->where('matches.tournament_id', '=', $tournament_id)->where(function ($q) use($player_id) {
         $q->where('player1_id', '=', $player_id)->orWhere('player2_id', '=', $player_id);
     })->orderBy('match_division')->orderBy('round')->select('*', 'winner.first_name as winner_first_name', 'winner.last_name as winner_last_name', 'loser.first_name as loser_first_name', 'loser.last_name as loser_last_name', 'loser.player_id as loser_id', 'tournaments.name as tournament')->distinct()->get();
     return $m;
 }
开发者ID:jenidarnold,项目名称:racquetball,代码行数:13,代码来源:Tournament.php

示例5: closest

 public function closest($lat, $lng, $max_distance = 25, $max_locations = 10, $units = 'miles', $fields = false)
 {
     /*
      *  Allow for changing of units of measurement
      */
     switch ($units) {
         case 'miles':
             //radius of the great circle in miles
             $gr_circle_radius = 3959;
             break;
         case 'kilometers':
             //radius of the great circle in kilometers
             $gr_circle_radius = 6371;
             break;
     }
     /*
      *  Support the selection of certain fields
      */
     if (!$fields) {
         $fields = array('*');
     }
     /*
      *  Generate the select field for disctance
      */
     $disctance_select = sprintf("( %d * acos( cos( radians(%s) ) " . " * cos( radians( lat ) ) " . " * cos( radians( lng ) - radians(%s) ) " . " + sin( radians(%s) ) * sin( radians( lat ) ) " . ") " . ") " . "AS distance", $gr_circle_radius, $lat, $lng, $lat);
     return DB::table($table)->having('distance', '<', $max_distance)->take($max_locations)->order_by('distance', 'ASC')->get(array($fields, $disctance_select));
 }
开发者ID:jordi69,项目名称:parkmycar,代码行数:27,代码来源:Parkeerplaats.php

示例6: cuentasAplicativosExportar

 public static function cuentasAplicativosExportar($ticket_id)
 {
     $resultado = \DB::table('cuenta')->select(['cuenta.id', 'cuenta.cuenta_usu', 'ticket.nroticket', 'aplicativo.nombre_aplicativo', 'cuenta.created_at', 'cuenta.clave'])->whereIn('cuenta.aplicativo_ticket_id', function ($query) use($ticket_id) {
         $query->select(['aplicativo_tickets.id'])->from('ticket')->where('ticket.id', $ticket_id)->join('aplicativo_tickets', 'ticket.id', '=', 'aplicativo_tickets.ticket_id')->join('aplicativo', 'aplicativo_tickets.aplicativo_id', '=', 'aplicativo.id')->get();
     })->join('aplicativo_tickets', 'cuenta.aplicativo_ticket_id', '=', 'aplicativo_tickets.id')->join('aplicativo', 'aplicativo_tickets.aplicativo_id', '=', 'aplicativo.id')->join('ticket', 'aplicativo_tickets.ticket_id', '=', 'ticket.id')->get();
     return $resultado;
 }
开发者ID:juans05,项目名称:rimacSeguros,代码行数:7,代码来源:aplicativo_ticket.php

示例7: AplicativoAreaFaltante

 public static function AplicativoAreaFaltante($idarea)
 {
     $resultado = \DB::table('aplicativo')->select(['aplicativo.id', 'aplicativo.nombre_aplicativo'])->whereNotIn('aplicativo.id', function ($query) use($idarea) {
         $query->select(['aplicativo_area.aplicativo_id'])->from('aplicativo_area')->where('area.id', $idarea)->join('area', 'aplicativo_area.area_id', '=', 'area.id')->get();
     })->get();
     return $resultado;
 }
开发者ID:juans05,项目名称:rimacSeguros,代码行数:7,代码来源:Area_aplicativo.php

示例8: select

 public function select()
 {
     $user = DB::table('login')->where('name', 'crdf')->first();
     var_dump($user);
     die;
     return $user->name;
 }
开发者ID:aramharutyunyan1234,项目名称:laravel,代码行数:7,代码来源:User.php

示例9: user

 public function user()
 {
     //return $this->hasManyThrough('App\User','App\AccountLink',
     //	                          'user_id', 'id', 'app_user_id');
     $user = \DB::table('users')->join('account_links', 'users.id', '=', 'account_links.user_id')->where('account_links.app_user_id', '=', $this->id)->first();
     return $user;
 }
开发者ID:jenidarnold,项目名称:racquetball,代码行数:7,代码来源:FacebookUser.php

示例10: callStatesIndicator

 public static function callStatesIndicator($ind)
 {
     //$p = \DB::statement('call PKG_CMI_INDICATOR_STATES.PROC_MAKE_FEED(?,?,?)',[$stateid, $val, $user]);
     //$p = \DB::exec('pkg_cmi_indicator_states.func_get_valid_fees(?, ?, ?)',[$ind, $per, $user]);
     //$p= \DB::table('select * from CMI_INDICATOR_STATE t where t.indicatorid = '.$ind.';');
     $datasStates = \DB::table('CMI_INDICATOR_STATE')->select('*')->where('indicatorid', '=', $ind)->get();
     return $datasStates;
 }
开发者ID:klas120,项目名称:cmi,代码行数:8,代码来源:Tablero.php

示例11: getName

 function getName()
 {
     DB::table('users')->whereExists(function ($query) {
         $query->select(DB::raw(1))->from('orders')->whereRaw('orders.user_id = users.id');
     })->get();
     //select * from users where exists (select 1 from orders where orders.user_id = users.id)
     //生成上面那句语句  exists 判断括号内语句是否为真  为真则搜索 为假则放弃
 }
开发者ID:elickzhao,项目名称:laravel_test,代码行数:8,代码来源:Flight.php

示例12: minId

 public function minId()
 {
     $vacancy = DB::table($this->table)->select('min(id)')->first();
     if ($vacancy) {
         return $vacancy->min;
     } else {
         return null;
     }
 }
开发者ID:mgalex8,项目名称:laraparser,代码行数:9,代码来源:Vacancy.php

示例13: getPassedUserIds

 public function getPassedUserIds()
 {
     $arIds = \DB::table('vk_like')->select('to_id')->where(['from_id' => $this->id])->get();
     $arIds = array_map(function ($item) {
         return $item->to_id;
     }, $arIds);
     $arIds[] = $this->id;
     return $arIds;
 }
开发者ID:stels-cs,项目名称:tinder-olega,代码行数:9,代码来源:VKUsers.php

示例14: generateOrder

 public function generateOrder()
 {
     $max = \DB::table($this->table)->where('parent_id', $this->parent_id)->max('order');
     if (!$max) {
         $this->order = '1';
     } else {
         $this->order = (string) ++$max;
     }
 }
开发者ID:ronal2do,项目名称:Laravel-CMS,代码行数:9,代码来源:Menu.php

示例15: hasPermission

 public function hasPermission($permission_id)
 {
     $result = 0;
     $result = \DB::table('permissions')->where('user_id', '=', $this->id)->where('permission_id', '=', $permission_id)->count();
     if ($result > 0) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:jenidarnold,项目名称:racquetball,代码行数:10,代码来源:User.php


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