當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。