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


PHP Unit::where方法代码示例

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


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

示例1: foreach

 function index_delete()
 {
     $models = json_decode($this->delete('models'));
     foreach ($models as $key => $value) {
         $obj = new Unit(null, $this->entity);
         $obj->where("id", $value->id)->get();
         $data["results"][] = array("data" => $value, "status" => $obj->delete());
     }
     //Response data
     $this->response($data, 200);
 }
开发者ID:nicarayz,项目名称:linabiz,代码行数:11,代码来源:units.php

示例2: searchUnits

 public function searchUnits()
 {
     if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin")) {
         $view = View::make('Settings.Employees.settings_units');
         $input = Input::all();
         $keyword = !empty(trim($input["keyword"])) ? trim($input["keyword"]) : "";
         $units = Unit::where("id", "=", $keyword)->orWhere("name", "LIKE", "%{$keyword}%")->orderBy("name")->paginate(25);
         $view->units = $units;
         $view->nav = "system";
         $view->tab = "units";
         $view->search = true;
         Input::flash();
         return $view;
     } else {
         return Redirect::to("/");
     }
 }
开发者ID:johndavedecena,项目名称:vault,代码行数:17,代码来源:SettingsController.php

示例3: getSap

 public function getSap($type, $no_sap)
 {
     $link = $this->link_dokumen($type, $no_sap);
     $dokumen_with_pr = $link['dok_pr'];
     $dokumen_with_po = $link['dok_po'];
     $no_pr = $link['no_pr'];
     $no_po = $link['no_po'];
     $actifity_all = Actifity::all();
     $sub_jenis_all = Sub_jenis_dokumen::all();
     $unit_po = Unit::where('id', '=', 22)->orWhere('id', '=', 23)->orWhere('id', '=', 19)->orWhere('id', 25)->orWhere('id', 20)->get();
     return view('dokumen.sap', compact('no_pr', 'no_po', 'dokumen', 'actifity_all', 'sub_jenis_all', 'dokumen_with_pr', 'dokumen_with_po', 'actifity_list', 'unit_po'));
 }
开发者ID:wandriputra,项目名称:Arsip-Proyek-Integrate-with-SAP,代码行数:12,代码来源:dokumenController.php

示例4: processImport


//.........这里部分代码省略.........
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "Manager ID should be numeric." . "<br/>";
                 }
                 if (is_numeric($r->manager) && !Manager::find($r->manager)) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
                     $rowHasError = true;
                     //This will only matter if no errors has been found above.
                     $rowsWithErrors[$rowIndex] = $rowIndex;
                     //This will only matter if no errors has been found above.
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "Invalid manager ID." . "<br/>";
                 }
                 if (empty(trim($r->nsnid)) && !in_array(strtolower($r->status), array("academy", "ojt", "contractual", "graduate", "obsolete"))) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
                     $rowHasError = true;
                     //This will only matter if no errors has been found above.
                     $rowsWithErrors[$rowIndex] = $rowIndex;
                     //This will only matter if no errors has been found above.
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "The NSN ID is required." . "<br/>";
                 }
                 if (!empty($r->nsnid) && !is_numeric(trim($r->nsnid)) && !in_array($r->status, array("academy", "ojt", "contractual", "graduate", "obsolete"))) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
                     $rowHasError = true;
                     //This will only matter if no errors has been found above.
                     $rowsWithErrors[$rowIndex] = $rowIndex;
                     //This will only matter if no errors has been found above.
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "The NSN ID should be numeric." . "<br/>";
                 }
                 if (!empty($r->nsnid) && Employee::where("nsn_id", "=", $r->nsnid)->first()) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
                     $rowHasError = true;
                     //This will only matter if no errors has been found above.
                     $rowsWithErrors[$rowIndex] = $rowIndex;
                     //This will only matter if no errors has been found above.
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "NSN ID already exists." . "<br/>";
                 }
                 if (!empty($r->email) && !filter_var(trim($r->email), FILTER_VALIDATE_EMAIL)) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
                     $rowHasError = true;
                     //This will only matter if no errors has been found above.
                     $rowsWithErrors[$rowIndex] = $rowIndex;
                     //This will only matter if no errors has been found above.
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "Invalid e-mail address." . "<br/>";
                 }
                 if (is_numeric($r->businessline) && !BusinessLine::find($r->businessline)) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
                     $rowHasError = true;
                     //This will only matter if no errors has been found above.
                     $rowsWithErrors[$rowIndex] = $rowIndex;
                     //This will only matter if no errors has been found above.
                     $errorCount += 1;
                     $error[$rowIndex][$errorCount] = $errorCount . ". " . "Invalid Business Line ID." . "<br/>";
                 }
                 if (is_numeric($r->unit) && !Unit::find($r->unit)) {
                     $hasError = true;
                     //This will only matter if no errors has been found above.
开发者ID:johndavedecena,项目名称:vault,代码行数:67,代码来源:EmployeeController.php

示例5: filterUnits

 public function filterUnits()
 {
     if ($this->hasAccess('admin')) {
         $units = Unit::lists('name', 'id');
     } elseif ($this->hasAccess('authorize')) {
         $units = Unit::where('role_id', '=', $this->role_id)->lists('name', 'id');
     } elseif ($this->hasAccess('request')) {
         $units = Unit::where('id', '=', $this->unit_id)->lists('name', 'id');
     }
     return $units;
 }
开发者ID:amcfarlane1251,项目名称:lcnsMgmt,代码行数:11,代码来源:User.php


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