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


PHP City::whereRaw方法代码示例

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


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

示例1: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $data = Employee::find($id);
     $province = Province::all();
     $cities = City::all();
     $citmin = City::whereRaw('id = (select min(`id`) from cities)')->get();
     $citmax = City::whereRaw('id = (select max(`id`) from cities)')->get();
     $grade = Grade::all();
     $jabatans = Jabatan::all();
     $pt = array('sd' => 'SD', 'smp' => 'SMP', 'sma' => 'SMA', 'd3' => 'D3', 's1' => 'S1', 'S2' => 'S2');
     $citsel = unserialize($data->id_cities);
     $tls = Teamleader::where('id_users', $data->id)->get();
     $pos = ProjectOfficer::where('id_users', $data->id)->get();
     $adms = Admin::where('id_users', $data->id)->get();
     return view('dropmin/data/edit')->with('data', $data)->with('province', $province)->with('grade', $grade)->with('tls', $tls)->with('pos', $pos)->with('adms', $adms)->with('jabatans', $jabatans)->with('pt', $pt)->with('citsel', $citsel)->with('cities', $cities);
 }
开发者ID:arisros,项目名称:drope.mployee,代码行数:22,代码来源:DataController.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     // Start Check Authorization
     /**
      * 1. FullAccess - 1
      * 2. HRD - 3
      * 3. Creator - 5
      * 4. Handler - 7
      */
     $invalid_auth = 1;
     $authRole = Auth::user()->UserRoles->role;
     if ($authRole == 7 or $authRole == 1 or $authRole == 3) {
         $invalid_auth = 0;
     }
     if ($invalid_auth == 1) {
         Alert::error('Anda tidak memilik akses ini')->persistent('close');
         return redirect('data/list');
     }
     // End Check Authorization
     $data = Employee::find($id);
     $province = Province::all();
     $cities = City::all();
     $citmin = City::whereRaw('id = (select min(`id`) from cities)')->get();
     $citmax = City::whereRaw('id = (select max(`id`) from cities)')->get();
     $grade = Grade::all();
     $jabatans = Jabatan::all();
     $pt = array('sd' => 'SD', 'smp' => 'SMP', 'sma' => 'SMA', 'd3' => 'D3', 's1' => 'S1', 'S2' => 'S2');
     $citsel = unserialize($data->id_cities);
     $tls = Teamleader::where('id_users', $data->id)->get();
     $pos = ProjectOfficer::where('id_users', $data->id)->get();
     $adms = Admin::where('id_users', $data->id)->get();
     return view('dropmin/data/edit')->with('data', $data)->with('province', $province)->with('grade', $grade)->with('tls', $tls)->with('pos', $pos)->with('adms', $adms)->with('jabatans', $jabatans)->with('pt', $pt)->with('citsel', $citsel)->with('cities', $cities);
 }
开发者ID:arisros,项目名称:drope.mployee,代码行数:39,代码来源:DataController.php


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