本文整理汇总了PHP中Illuminate\Support\Facades\DB::RAW方法的典型用法代码示例。如果您正苦于以下问题:PHP DB::RAW方法的具体用法?PHP DB::RAW怎么用?PHP DB::RAW使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\DB
的用法示例。
在下文中一共展示了DB::RAW方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: goalAmount
public function goalAmount()
{
$active_flg = 1;
$goal_general = DB::table('goal_general')->where('uid', Auth::user()->id)->where('flg', $active_flg)->select('goal_general.id', 'uid', 'name', 'where', 'mth_saving', 'duration', 'duration_complete', DB::RAW('1 as goal_type'), 'created_at');
$goal_travel = DB::table('goal_travel')->where('uid', Auth::user()->id)->where('flg', $active_flg)->select('goal_travel.id', 'uid', 'goal_travel.where_to', 'goal_travel.where_to', 'mth_saving', 'duration', 'duration_complete', DB::RAW('2 as goal_type'), 'created_at');
$goal_home = DB::table('goal_home')->where('uid', Auth::user()->id)->where('flg', $active_flg)->select('goal_home.id', 'uid', 'name', 'where', 'mth_saving', 'duration', 'duration_complete', DB::RAW('4 as goal_type'), 'created_at');
$goal = DB::table('goal_car')->join('carbrandname', 'goal_car.brand', '=', 'carbrandname.id')->where('uid', Auth::user()->id)->where('goal_car.flg', $active_flg)->select('goal_car.id', 'uid', 'model as name', 'carbrandname.images as ext', 'mth_saving', 'duration', 'duration_complete', DB::RAW('3 as goal_type'), 'goal_car.created_at')->union($goal_travel)->union($goal_home)->union($goal_general)->get();
}
示例2: Cari
public function Cari()
{
$th = Input::get('tahun');
$data = DB::table('asesment_promosi')->join('lpp_kemenpan_siasik.daf_unit_staf', 'asesment_promosi.unit_staf_id', '=', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id')->select('tgl_selesai', 'asesment_promosi.tgl_selesai', 'lpp_kemenpan_siasik.daf_unit_staf.nama_lengkap', 'asesment_promosi.id', 'asesment_promosi.unit_staf_id', 'asesment_promosi.tgl_awal', 'asesment_promosi.tgl_asesment', 'asesment_promosi.tgl_selesai', 'asesment_promosi.detail')->whereyear('tgl_selesai', '=', $th)->paginate('10');
$tahun = DB::select(DB::RAW(" select year(tgl_selesai) from asesment_promosi\r\n\t\t\t\t\t"));
$breadcrumbs = array(array("Assessment Internal" => "javascript:void(0)"), array("Pengaturan" => ""), array("Jadwal Asessment" => ""));
$this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
$this->layout->content = View::make('career::jadwal/indexasessment', compact('data', 'tahun'));
}
示例3: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sample', function (Blueprint $table) {
$table->string('id', 64)->index();
$table->string("CustomerName", 255);
$table->date("DatePurchase");
$table->double("AmountDue", 8, 2)->default(0);
$table->double("Discount", 8, 2)->default(0);
$table->double("GST", 8, 2)->default(0);
$table->double("TotalPriceBeforeDisc", 8, 2)->default(0);
$table->timestamp("created_at")->default(DB::RAW("now()"));
$table->timestamp("updated_at");
$table->primary('id');
$table->unique('id');
});
}
示例4: KandidatPromote
public function KandidatPromote()
{
$dafunit = DB::table('lpp_kemenpan_siasik.daf_unit_staf')->join('asesment_kelas', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', '=', 'asesment_kelas.unit_staf_id')->select('asesment_kelas.unit_staf_id', 'lpp_kemenpan_siasik.daf_unit_staf.nama_lengkap', 'lpp_kemenpan_siasik.daf_unit_staf.eselon_id')->get();
$ambil = Input::get('cari');
if (empty($ambil)) {
$comment = "<div class='alert alert-danger'><a class='close' data-dismiss='alert'>×</a>Silahkan Anda Memasukkan Jabatan</div>";
//Session::flash('messagess','Silahkan Anda Memasukkan Jabatan');
} else {
$unit = DB::select(DB::RAW("select count(asesment_prasyarat_jabatan.nilai) as nilai, asesment_kelas.id, asesment_tipe.nama_tipe, prestasi_kerja_rekap_penilaian.nilai_kompetensi, prestasi_kerja_rekap_penilaian.nilai_kinerja, lpp_kemenpan_siasik.daf_unit_staf.nama_lengkap\r\n\t\t\t \t,lpp_kemenpan_siasik.master_pegawai.nama, asesment_eselon.jabatan,asesment_kelas.unit_staf_id,lpp_kemenpan_siasik.daf_gol.pangkat,lpp_kemenpan_siasik.daf_gol.golongan\r\n\t\t\t \tfrom asesment_kelas\r\n\t\t\t \tjoin lpp_kemenpan_siasik.daf_unit_staf on lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id = asesment_kelas.unit_staf_id \r\n\t\t\t \tjoin lpp_kemenpan_siasik.daf_gol on lpp_kemenpan_siasik.daf_gol.gol_id = lpp_kemenpan_siasik.daf_unit_staf.eselon_id\r\n\t\t\t\tjoin asesment_eselon on asesment_eselon.id = asesment_kelas.asesment_eselon_id \r\n\t\t\t\tjoin asesment_tipe on asesment_tipe.parent_id = asesment_eselon.asesment_tipe_id\r\n\t\t\t\tleft join asesment_prasyarat_jabatan on asesment_prasyarat_jabatan.asesment_eselon_id = asesment_kelas.asesment_eselon_id\r\n\t\t\t\tjoin asesment_prasyarat on asesment_prasyarat.id = asesment_prasyarat_jabatan.asesment_prasyarat_id \r\n\t\t\t\tjoin prestasi_kerja_rekap_penilaian on prestasi_kerja_rekap_penilaian.id_jabatan = asesment_kelas.unit_staf_id\r\n\t\t\t\tjoin lpp_kemenpan_siasik.master_pegawai on lpp_kemenpan_siasik.master_pegawai.nip = prestasi_kerja_rekap_penilaian.nip \r\n\t\t\t\twhere asesment_kelas.unit_staf_id = '{$ambil}' and prestasi_kerja_rekap_penilaian.nilai_kinerja >= 76 and \r\n\t\t\t\tprestasi_kerja_rekap_penilaian.nilai_kompetensi >= 60"));
foreach ($unit as $un) {
if (empty($un) && empty($un->jabatan)) {
Session::flash('message', 'Maaf Data Eselon Jabatan Belum Ada di Database');
} elseif (isset($un->parent_id) && $un->parent_id == 0) {
Session::flash('message', 'Maaf Data yang Anda Masukkan Eselon 1');
} elseif ($un->nilai_kinerja <= 76 && $un->nilai_kompetensi <= 60) {
Session::flash('message', 'Maaf Nilai Tidak memenuhi');
}
}
}
//endof if $ambil
$breadcrumbs = array(array("Assessment Internal" => "javascript:void(0)"), array("Pengaturan" => ""), array("Kandidat Promosi Jabatan" => ""));
$this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
$this->layout->content = View::make('career::kandidat/kandidatpromote', compact('dafunit', 'unit', 'comment'));
}
示例5: index
public function index()
{
//fungsional
$unit = Input::get('unit');
//manajerial & inti
$unitt = Input::get('unitt');
if (isset($unit)) {
$deputi = DB::table('competency_recap_individuals')->join('competency_dictionaries', 'competency_recap_individuals.competency_dictionary_id', '=', 'competency_dictionaries.id')->join('competency_types', 'competency_dictionaries.type_id', '=', 'competency_types.id')->join('competency_recaps', 'competency_recap_individuals.competency_recap_id', '=', 'competency_recaps.id')->join('asesment_kelas', 'competency_recaps.occupation_id', '=', 'asesment_kelas.unit_staf_id')->select(DB::RAW('round(avg(competency_recap_individuals.gap),2) as gap, count(competency_recaps.user_nip) as nip'), 'competency_dictionaries.type_id', 'competency_types.name', 'competency_dictionaries.title', 'competency_recap_individuals.itj', 'competency_recap_individuals.rcl', 'competency_recap_individuals.ccl', 'competency_dictionaries.id', 'competency_dictionaries.type_id')->where('asesment_kelas.unit', '=', "{$unit}")->orderBy('gap', 'asc')->orderBy('itj', 'desc')->groupBy('competency_dictionaries.id')->paginate(15);
}
if (isset($unit)) {
$deputti = DB::table('competency_recap_individuals')->join('competency_dictionaries', 'competency_recap_individuals.competency_dictionary_id', '=', 'competency_dictionaries.id')->join('competency_types', 'competency_dictionaries.type_id', '=', 'competency_types.id')->join('competency_recaps', 'competency_recap_individuals.competency_recap_id', '=', 'competency_recaps.id')->join('asesment_kelas', 'competency_recaps.occupation_id', '=', 'asesment_kelas.unit_staf_id')->select(DB::RAW('round(avg(competency_recap_individuals.gap),2) as gap, count(competency_recaps.user_nip) as nip'), 'competency_dictionaries.type_id', 'competency_types.name', 'competency_dictionaries.title', 'competency_recap_individuals.itj', 'competency_recap_individuals.rcl', 'competency_recap_individuals.ccl', 'competency_dictionaries.id', 'competency_dictionaries.type_id')->where('asesment_kelas.unit', '=', "{$unitt}")->orderBy('gap', 'asc')->orderBy('itj', 'desc')->groupBy('competency_dictionaries.id')->paginate(15);
}
$kompetensi = DB::table('competency_types')->get();
$diklat = DB::table('diklat_competency')->get();
$combobox = DB::table('diklat_competency')->get();
$rencana = DB::table('diklat_competency')->join('competency_types', 'diklat_competency.id_competency', '=', 'competency_types.id')->get();
//susun perencanaan diklat inti
$agendaf = DB::table('diklat_agenda')->select('diklat_agenda.id', 'competency_types.name', 'diklat_competency.id_competency', 'diklat_competency.nama_kompetensi', 'diklat_agenda.jdwal_mulai', 'diklat_agenda.jdwal_selesai')->join('diklat_competency', 'diklat_agenda.id_diklat_comp', '=', 'diklat_competency.id')->join('competency_types', 'diklat_competency.id_competency', '=', 'competency_types.id')->where('competency_types.id', '=', '1')->paginate(10);
//susun perencanaan diklat fungsional
$agenda = DB::table('diklat_agenda')->select('diklat_agenda.id', 'competency_types.name', 'diklat_competency.id_competency', 'diklat_competency.nama_kompetensi', 'diklat_agenda.jdwal_mulai', 'diklat_agenda.jdwal_selesai')->join('diklat_competency', 'diklat_agenda.id_diklat_comp', '=', 'diklat_competency.id')->join('competency_types', 'diklat_competency.id_competency', '=', 'competency_types.id')->where('competency_types.id', '=', '2')->paginate(10);
$breadcrumbs = array(array('Kompetensi' => ""), array('Perencanaan' => ""));
$this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
$this->layout->content = View::make('competency::adminperencanaan.index', compact('tipe', 'rencana', 'kompetensi', 'deputi', 'deputti', 'diklat', 'agenda', 'agendaf'));
}