當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Province::where方法代碼示例

本文整理匯總了PHP中Province::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Province::where方法的具體用法?PHP Province::where怎麽用?PHP Province::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Province的用法示例。


在下文中一共展示了Province::where方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: province

 public function province()
 {
     $result = Province::where('PAK_ID', Input::get('id'))->select('PROVINCE_ID', 'PROVINCE_NAME')->get();
     $dropdown = '<option value=""></option>';
     foreach ($result as $result) {
         $dropdown .= '<option value="' . $result->PROVINCE_ID . '">' . $result->PROVINCE_NAME . '</option>';
     }
     return Response::make($dropdown);
 }
開發者ID:terkmods,項目名稱:CBT,代碼行數:9,代碼來源:BaseController.php

示例2: updatePosition

 function updatePosition()
 {
     $positionList = $this->input->post('positionList');
     $idList = $this->input->post('idList');
     $locations = new Province();
     for ($i = 0; $i < count($idList); $i++) {
         $locations->where("id", $idList[$i]);
         $locations->get();
         $locations->position = $positionList[$i];
         $locations->save();
         $locations->clear();
     }
     redirect("admin/locations/listAll/");
 }
開發者ID:lxthien,項目名稱:batdongsan,代碼行數:14,代碼來源:locations.php

示例3: upload_pharmaceuticals_domains

 public function upload_pharmaceuticals_domains()
 {
     $pharmacist_domain_class = new PharmacistDomain();
     $input = Input::All();
     $header = array_shift($input);
     //retrieve header row
     $success = true;
     if (!$this->checkHeader($header, $pharmacist_domain_class->columns())) {
         $success = false;
         $response = "Cabeceras del Excel no coincide con la base de datos.\n                    No se procederá a modificar la base de datos.";
     }
     DB::table($pharmacist_domain_class->getTableName())->delete();
     foreach ($input as $row) {
         try {
             $row = $this->readRow($row, $header);
             $province = Province::where("description", "=", $row["province"])->first();
             $pharmacist_domain = new PharmacistDomain(array("domain" => $row["domain"], "province" => $province->description, "province_id" => $province->id));
             $pharmacist_domain->save();
         } catch (Exception $ex) {
             $success = false;
             $response = "Ha habido algún problema cargando el Excel en la base de datos." . "\n" . $ex->getMessage();
         }
     }
     if ($success) {
         $response = "Se ha cargado correctamente el Excel en la base de datos.";
     }
     return Response::json(array("success" => $success, "response" => $response));
 }
開發者ID:polo070770,項目名稱:TFG,代碼行數:28,代碼來源:DomainController.php


注:本文中的Province::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。