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


PHP DB::table方法代码示例

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


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

示例1: ProsesJadwal

 public function ProsesJadwal($id)
 {
     $data = DB::table('prestasi_kerja_rekap_penilaian')->join('lpp_kemenpan_siasik.daf_unit_staf', 'prestasi_kerja_rekap_penilaian.id_jabatan', '=', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id')->join('lpp_kemenpan_siasik.master_pegawai', 'prestasi_kerja_rekap_penilaian.nip', '=', 'lpp_kemenpan_siasik.master_pegawai.nip')->join('lpp_kemenpan_siasik.daf_gol', 'lpp_kemenpan_siasik.daf_unit_staf.eselon_id', '=', 'lpp_kemenpan_siasik.daf_gol.gol_id')->select('prestasi_kerja_rekap_penilaian.nip', 'prestasi_kerja_rekap_penilaian.id_jabatan', 'lpp_kemenpan_siasik.daf_unit_staf.nama_lengkap', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', 'lpp_kemenpan_siasik.master_pegawai.nama', 'lpp_kemenpan_siasik.daf_gol.pangkat', 'lpp_kemenpan_siasik.daf_gol.golongan')->where('lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', '=', $id)->first();
     $breadcrumbs = array(array("Assessment Internal" => "javascript:void(0)"), array("Pengaturan" => ""), array("Tambah Kandidat Promosi" => ""));
     $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
     $this->layout->content = View::make('career::jadwal/jadwalasessment', compact('data'));
 }
开发者ID:hendrilara,项目名称:kemenpan,代码行数:7,代码来源:KandidatPromosiController.php

示例2: run

 public function run()
 {
     DB::table('master_type_bank')->delete();
     $data = array(array('name' => 'TABUNGAN', 'info' => '', 'uuid' => uniqid(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(), 'createby_id' => 1, 'lastupdateby_id' => 1), array('name' => 'GIRO', 'info' => '', 'uuid' => uniqid(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(), 'createby_id' => 1, 'lastupdateby_id' => 1), array('name' => 'DEPOSITO', 'info' => '', 'uuid' => uniqid(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(), 'createby_id' => 1, 'lastupdateby_id' => 1));
     DB::table('master_type_bank')->insert($data);
     $this->command->info('Done [' . __CLASS__ . ']');
 }
开发者ID:emayk,项目名称:ics,代码行数:7,代码来源:Bank_Type_Account.php

示例3: materiaMaestroEnpalme

 public function materiaMaestroEnpalme()
 {
     $maestroId = Materia::join('maestro_materia', 'materias.id', '=', 'maestro_materia.materia_id')->where('materia_id', '=', Input::get('materia_id'))->select('materia', 'materia_id', 'maestro_id')->first();
     $maestroMateria = DB::table('horarios')->join('materias', 'materias.id', '=', 'horarios.materia_id')->join('maestro_materia', 'maestro_materia.materia_id', '=', 'materias.id')->join('maestros', 'maestros.id', '=', 'maestro_materia.maestro_id')->where('hora_id', Input::get('hora_id'))->where('horarios.ciclo_id', Input::get('ciclo_id'))->where('dia_id', Input::get('dia_id'))->where('maestro_id', $maestroId->maestro_id)->get();
     //dd($maestroMateria);
     return $maestroMateria;
 }
开发者ID:elektroacustica,项目名称:horario-frontend,代码行数:7,代码来源:MateriaRepo.php

示例4: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('roles')->truncate();
     //insert some dummy records
     Role::create(['name' => 'Admin', 'status' => 'active']);
     /*Role::create([
             'name' => 'Project Manager',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Team Lead',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Developer',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Designer',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Tester',
             'status' => 'active',
             ]);*/
     DB::table('roles_users')->insert(['user_id' => 1, 'role_id' => 1, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
 }
开发者ID:komalsavla10,项目名称:timesheet,代码行数:36,代码来源:RolesTableSeeder.php

示例5: run

 public function run()
 {
     if (env('DB_DRIVER') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     }
     if (env('DB_DRIVER') == 'mysql') {
         DB::table(config('access.assigned_roles_table'))->truncate();
     } elseif (env('DB_DRIVER') == 'sqlite') {
         DB::statement("DELETE FROM " . config('access.assigned_roles_table'));
     } else {
         //For PostgreSQL or anything else
         DB::statement("TRUNCATE TABLE " . config('access.assigned_roles_table') . " CASCADE");
     }
     //Attach admin role to admin user
     $user_model = config('auth.model');
     $user_model = new $user_model();
     $user_model::first()->attachRole(1);
     //Attach user role to general user
     $user_model = config('auth.model');
     $user_model = new $user_model();
     $user_model::find(2)->attachRole(2);
     if (env('DB_DRIVER') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     }
 }
开发者ID:shiruken1,项目名称:LEIAs,代码行数:25,代码来源:UserRoleSeeder.php

示例6: reset

 /**
  * 重置密钥
  * @param $key
  */
 public static function reset($key)
 {
     $phptime = date("Y-m-d H:i:s.u");
     $k = substr(str_shuffle(md5(microtime())), rand(1, 5), 18);
     DB::table('passports')->where('key', $key)->update(['secret' => $k, 'updated_at' => $phptime]);
     return 1;
 }
开发者ID:RianStudio,项目名称:TouchCapthcaMS,代码行数:11,代码来源:Passport.php

示例7: run

 public function run()
 {
     for ($i = 0; $i < 100; $i++) {
         DB::table('posts_has_tags')->insert(['post_id' => $i + 1, 'tag_id' => rand(1, 2)]);
         DB::table('posts_has_tags')->insert(['post_id' => $i + 1, 'tag_id' => rand(3, 4)]);
     }
 }
开发者ID:thepopix,项目名称:backend,代码行数:7,代码来源:PostHasTagTableSeeder.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('uf')->insert(['idUf' => 11, 'uf' => 'RO']);
     DB::table('uf')->insert(['idUf' => 12, 'uf' => 'AC']);
     DB::table('uf')->insert(['idUf' => 13, 'uf' => 'AM']);
     DB::table('uf')->insert(['idUf' => 14, 'uf' => 'RR']);
     DB::table('uf')->insert(['idUf' => 15, 'uf' => 'PA']);
     DB::table('uf')->insert(['idUf' => 16, 'uf' => 'AP']);
     DB::table('uf')->insert(['idUf' => 17, 'uf' => 'TO']);
     DB::table('uf')->insert(['idUf' => 21, 'uf' => 'MA']);
     DB::table('uf')->insert(['idUf' => 22, 'uf' => 'PI']);
     DB::table('uf')->insert(['idUf' => 23, 'uf' => 'CE']);
     DB::table('uf')->insert(['idUf' => 24, 'uf' => 'RN']);
     DB::table('uf')->insert(['idUf' => 25, 'uf' => 'PB']);
     DB::table('uf')->insert(['idUf' => 26, 'uf' => 'PE']);
     DB::table('uf')->insert(['idUf' => 27, 'uf' => 'AL']);
     DB::table('uf')->insert(['idUf' => 28, 'uf' => 'SE']);
     DB::table('uf')->insert(['idUf' => 29, 'uf' => 'BA']);
     DB::table('uf')->insert(['idUf' => 31, 'uf' => 'MG']);
     DB::table('uf')->insert(['idUf' => 32, 'uf' => 'ES']);
     DB::table('uf')->insert(['idUf' => 33, 'uf' => 'RJ']);
     DB::table('uf')->insert(['idUf' => 35, 'uf' => 'SP']);
     DB::table('uf')->insert(['idUf' => 41, 'uf' => 'PR']);
     DB::table('uf')->insert(['idUf' => 42, 'uf' => 'SC']);
     DB::table('uf')->insert(['idUf' => 43, 'uf' => 'RS']);
     DB::table('uf')->insert(['idUf' => 50, 'uf' => 'MS']);
     DB::table('uf')->insert(['idUf' => 51, 'uf' => 'MT']);
     DB::table('uf')->insert(['idUf' => 52, 'uf' => 'GO']);
     DB::table('uf')->insert(['idUf' => 53, 'uf' => 'DF']);
 }
开发者ID:viniciusbrito,项目名称:sismid,代码行数:35,代码来源:ufSeeder.php

示例9: run

 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 5; $i++) {
         DB::table('tags')->insert(['name' => $faker->unique()->word]);
     }
 }
开发者ID:thepopix,项目名称:backend,代码行数:7,代码来源:TagsTableSeeder.php

示例10: run

 public function run()
 {
     DB::table('roles')->delete();
     Role::create(['abr' => 'PRL', 'role' => 'President of Lending', 'description' => "Responsible for ARM Loan Locations. This primarily includes making sure that (1) Existing ARM Loan Locations adhere to the Location Growth Profiles for loan commitments and EBT, (2) Adding new ARM Loan Locations in accordance with our Growth Strategy, (3) Marketing of ARM Loan Locations, and (4) Personnel growth within each ARM Loan Locations", 'matrix' => 1]);
     Role::create(['abr' => 'COO', 'role' => 'Chief Operating Officer', 'description' => "Responsible for (1) the day-to-day running of the critical departments of ARM, (2) establishing procedures and processes to ensure their smooth functioning, and (3) providing timely operational information and assistance to the CEO", 'matrix' => 1]);
     Role::create(['abr' => 'CEO', 'role' => 'Chief Executive Officer', 'description' => "Top executive responsible for ARM’s overall operations and performance. Serves as the main link between the board of directors (the board) and the ARM's various parts or levels, and is held responsible for ARM’s success or failure. Insures that IT and accounting meets corporate goals. Maintains and implements corporate policy, as established by the board.", 'matrix' => 1]);
     Role::create(['abr' => 'CFO', 'role' => 'Chief Financial Officer', 'matrix' => 1]);
     Role::create(['abr' => 'ABM', 'role' => 'Area Business Manager', 'description' => "For a particular ARM Loan Location(s), the ABM is responsible for (1) meeting the growth objectives of the Location Growth Profile, (2) adherence to ARM policies and procedures, (3) front line for collection of past dues, (3) development of employees, and (4) communication of objectives and opportunities.", 'matrix' => 1]);
     Role::create(['abr' => 'COM', 'role' => 'Corporate Office Manager', 'matrix' => 1]);
     Role::create(['abr' => 'OM', 'role' => 'Office Manager', 'description' => "Responsible for ARM Loan Location operations including: loan closings, loan filings, loan disbursements, office operations, and management of Office Assistant roles and responsibilities.", 'matrix' => 1]);
     Role::create(['abr' => 'OA', 'role' => 'Office Assistant', 'description' => "Responsible for specific ARM Loan Location office operations as they pertain to loan operations and other crop insurance processing.", 'matrix' => 1]);
     Role::create(['abr' => 'LBM', 'role' => 'Loan Business Manager', 'description' => "Responsible for ensuring that ARM Loan Officers and Loan Analysts are (1) trained properly and (2) perform loan analysis and loan management steps consistently. The LBM supports the growth of ARM Loan Locations.", 'matrix' => 1]);
     Role::create(['abr' => 'LO', 'role' => 'Loan Officer', 'description' => "Responsible for (1) structuring agriculture loan deals that serve the customers needs, (2) adhering to ARM policies and procedures, (3) supporting ARM’s Loan Location growth objectives as defined in the Location Growth Profile, (4) Interfacing with office staff to get the job done, (5) selling crop insurance, and (6) using loan experience to develop Loan Analysts", 'matrix' => 1]);
     Role::create(['abr' => 'LA', 'role' => 'Loan Analyst', 'description' => "Responsible for (1) structuring agriculture loan deals that serve the customers needs, (2) adhering to ARM policies and procedures, (3) supporting ARM’s Loan Location growth objectives as defined in the Location Growth Profile, (4) Interfacing with office staff to get the job done.", 'matrix' => 1]);
     Role::create(['abr' => 'LCA', 'role' => 'Loan Compliance Auditor', 'description' => ": Responsible for the quality and consistency of ARM Loans across ARM locations. The LCA serves as the corporate interface with ARM Loan Location ABM’s for loan reviews and loan past due collection.", 'matrix' => 1]);
     Role::create(['abr' => 'HRM', 'role' => 'Human Resources Manager', 'description' => "The human resource manager is directly responsible for the overall administration, coordination and evaluation of the human resource function.", 'matrix' => 1]);
     Role::create(['abr' => 'IBM', 'role' => 'Insurance Business Manager', 'matrix' => 1]);
     Role::create(['abr' => 'IAN', 'role' => 'Insurance Analyst', 'matrix' => 1]);
     Role::create(['abr' => 'CIM', 'role' => 'Corporate Insurance Manager', 'matrix' => 1]);
     Role::create(['abr' => 'IA', 'role' => 'Crop Insurance Agents', 'description' => "Responsible for marketing of crop insurance policies to the customer, adhering to ARM insurance standards, maintenance of customer APH databases, and the obtaining of applications, production reports, acreage reports, and notice of loss claims", 'matrix' => 1]);
     Role::create(['abr' => 'ITT', 'role' => 'IT Technician']);
     Role::create(['abr' => 'SUP', 'role' => 'Other Support']);
     Role::create(['abr' => 'SYS', 'role' => 'System']);
     Role::create(['abr' => 'PRI', 'role' => 'President of Insurance', 'description' => "Responsible for (1) ARM agency growth strategy, (2) insurance agency acquisitions, (3) insurance policy, and (4) ARM umbrella value to agencies.", 'matrix' => 1]);
     Role::create(['abr' => 'CRO', 'role' => 'Chief Risk Officer', 'description' => "The corporate executive tasked with assessing and mitigating significant loan risk, regulatory risk, and technological risks across ARM", 'matrix' => 1]);
     Role::create(['abr' => 'CTR', 'role' => 'Corporate Controller', 'description' => "Top managerial and financial accountant. The controller supervises the accounting department and assists management in interpreting and utilizing managerial accounting information.", 'matrix' => 1]);
     Role::create(['abr' => 'PA', 'role' => 'Principal Agent', 'description' => "Serves as the leader of an ARM Loan or Agency location’s crop insurance business; which includes (1) making sure that policies are represented and processed correctly, (2) development of ARM agents, (3) growth of policy revenue, (4) marketing of additional ARM lines of revenue, and (5) supervision of Insurance Processors and Agents", 'matrix' => 1]);
     Role::create(['abr' => 'IP', 'role' => 'Insurance Processor', 'description' => "Responsible for the support of Principal Agent, Crop Insurance Agents, and all crop insurance operations including: processing of customer insurance applications, production reports, acreage reports, filing notice of loss claims", 'matrix' => 1]);
     Role::create(['id' => 999, 'abr' => 'OPT', 'role' => 'Optional', 'description' => "Committee member", 'matrix' => 0]);
 }
开发者ID:wyrover,项目名称:lenda-api,代码行数:30,代码来源:RolesTableSeeder.php

示例11: update

 public function update($QuestionID)
 {
     if (!AuthController::checkPermission()) {
         return redirect('/');
     }
     $data = Request::capture();
     $count = $data['numAnswer'];
     // delete all old spaces with corresponding answers
     $oldSpaces = Spaces::where('QuestionID', '=', $QuestionID)->get()->toArray();
     foreach ($oldSpaces as $value) {
         SpacesController::destroy($value['id']);
     }
     for ($i = 0; $i < $count; $i++) {
         $rawAnswer = trim(AnswersController::c2s_convert($data['answer' . ($i + 1)]));
         preg_match_all('/([^;]+);/', $rawAnswer, $matches, PREG_PATTERN_ORDER);
         $arrayOfAnswer = $matches[1];
         $SpaceID = DB::table('spaces')->insertGetId(['QuestionID' => $QuestionID, 'created_at' => new \DateTime(), 'updated_at' => new \DateTime()]);
         $true = true;
         foreach ($arrayOfAnswer as $value) {
             $a = new Answers();
             $a->Logical = $true;
             $a->SpaceID = $SpaceID;
             $a->Detail = trim($value);
             $a->save();
             $true = false;
         }
     }
     return redirect(route('user.viewquestion', $QuestionID));
 }
开发者ID:ngocdon0127,项目名称:e-learning,代码行数:29,代码来源:SpacesController.php

示例12: getEmailForPasswordToken

 /**
  * @param $token
  * @return mixed
  * @throws GeneralException
  */
 public function getEmailForPasswordToken($token)
 {
     if ($row = DB::table('password_resets')->where('token', $token)->first()) {
         return $row->email;
     }
     throw new GeneralException(trans('auth.unknown'));
 }
开发者ID:rappasoft,项目名称:laravel-5-boilerplate,代码行数:12,代码来源:UserRepository.php

示例13: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // Clear account table
     DB::table('account')->truncate();
     $this->call('AccountTableSeeder');
 }
开发者ID:maxupunk,项目名称:metin2cms,代码行数:12,代码来源:DatabaseSeeder.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('tasks')->insert(['name' => 'Study Vagrant', 'created_at' => new DateTime("28.11.2015 15:00")]);
     DB::table('tasks')->insert(['name' => 'Study Puppet', 'created_at' => new DateTime("28.11.2015 16:00")]);
     DB::table('tasks')->insert(['name' => 'Combine them together', 'created_at' => new DateTime("28.11.2015 17:00")]);
     DB::table('tasks')->insert(['name' => 'Use it', 'created_at' => new DateTime("28.11.2015 17:30")]);
 }
开发者ID:arkady-emelyanov,项目名称:vagrant-puppet-demo,代码行数:12,代码来源:DatabaseSeeder.php

示例15: purgeOldAvatars

 /**
  * Remove unused avatar files from disk.
  *
  * @return void
  */
 private function purgeOldAvatars()
 {
     // Build up a list of all avatar images
     $avatars = glob(public_path() . '/upload/*/*.*');
     // Remove the public_path() from the path so that they match values in the DB
     array_walk($avatars, function (&$avatar) {
         $avatar = str_replace(public_path(), '', $avatar);
     });
     $all_avatars = collect($avatars);
     // Get all avatars currently assigned
     $current_avatars = DB::table('users')->whereNotNull('avatar')->lists('avatar');
     // Compare the 2 collections get a list of avatars which are no longer assigned
     $orphan_avatars = $all_avatars->diff($current_avatars);
     $this->info('Found ' . $orphan_avatars->count() . ' orphaned avatars');
     // Now loop through the avatars and delete them from storage
     foreach ($orphan_avatars as $avatar) {
         $avatarPath = public_path() . $avatar;
         // Don't delete recently created files as they could be temp files from the uploader
         if (filemtime($avatarPath) > strtotime('-15 minutes')) {
             $this->info('Skipping ' . $avatar);
             continue;
         }
         if (!unlink($avatarPath)) {
             $this->error('Failed to delete ' . $avatar);
         } else {
             $this->info('Deleted ' . $avatar);
         }
     }
 }
开发者ID:piyushpk89,项目名称:deployer,代码行数:34,代码来源:ClearOrphanAvatars.php


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