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


PHP Self::where方法代碼示例

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


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

示例1: findBlogWithResponse

 public function findBlogWithResponse($slug)
 {
     $blogpost = Self::where('slug', '=', $slug)->first()->toArray();
     $response = Response::where('blogs_id', '=', $blogpost['id'])->get()->toArray();
     $backarray = ['blogpost' => $blogpost, 'response' => $response];
     return $backarray;
 }
開發者ID:zwarthoorn,項目名稱:blog,代碼行數:7,代碼來源:Blog.php

示例2: checkBookingTimeRangeLimits

 /**
  * Reads the booking time range limits details based on
  * pass parameters.
  * 
  * @static	true
  * @access	public
  * @param	array 	$arrData
  * @return	array
  * @since	1.0.0
  */
 public static function checkBookingTimeRangeLimits($arrData)
 {
     $queryResult = Self::where('product_vendor_location_id', $arrData['vendorLocationID'])->where('day', $arrData['reservationDay'])->orWhere('date', $arrData['reservationDate'])->get();
     //array to save the details
     $arrData = array();
     foreach ($queryResult as $row) {
         $arrData[] = array('id' => $row->id, 'product_vendor_location_id' => $row->product_vendor_loction_id, 'limit_by' => $row->limit_by, 'day' => $row->day, 'date' => $row->date, 'start_time' => $row->start_time, 'end_time' => $row->end_time, 'max_covers_limit' => $row->max_covers_limit, 'max_tables_limit' => $row->max_tables_limit);
     }
     return $arrData;
 }
開發者ID:Charu91,項目名稱:Wowtables1,代碼行數:20,代碼來源:ProductVendorLocationBookingTimeRangeLimit.php

示例3: del

 /**
  *  刪除設置選項
  *
  *  @param $option_name
  *
  *  @return boolean
  */
 public static function del($option_name)
 {
     $option = Self::where('name', $option_name)->first();
     if (!$option) {
         return false;
     }
     //不存在該設置選項
     $option->delete();
     return true;
 }
開發者ID:GabrielShell,項目名稱:LaravelProjectBasic,代碼行數:17,代碼來源:Option.php

示例4: getLastReservationDetail

 public static function getLastReservationDetail($arrData)
 {
     $queryResult = Self::where('id', $arrData['reservationID'])->whereIn('reservation_status', array('new', 'edited'))->first();
     //check for outlet change
     if ($queryResult->reservation_type == "experience") {
         //-----------------------------------------------------------------------------------------------------
         $arrProductVendorLocationId = DB::table('reservation_details')->where('id', $arrData['reservationID'])->select('product_vendor_location_id')->get();
         $outletOld = self::getExperienceOutlet($arrProductVendorLocationId[0]->product_vendor_location_id);
         $outlet = self::getExperienceOutlet($arrData['vendorLocationID']);
         //--------------------------------------------------------------------------------------------------------
         if ($outletOld->name != $outlet->name) {
             //echo " , outlet changed, send to email";
             $old_reservation_outlet = $outletOld->name;
             $new_reservation_outlet = $outlet->name;
             $arrResponse['reservation_oulet'] = " Old Outlet: " . $old_reservation_outlet . " -> New Outlet: " . $new_reservation_outlet;
         } else {
             $arrResponse['reservation_oulet'] = "";
         }
     } else {
         if ($queryResult->reservation_type == "alacarte") {
             //---------------------------------------------------------------------------------------------------
             $arrVendorLocationID = DB::table('reservation_details')->where('id', $arrData['reservationID'])->select('vendor_location_id')->get();
             $outletOld = self::getAlacarteOutlet($arrVendorLocationID[0]->vendor_location_id);
             $outlet = self::getAlacarteOutlet($arrData['vendorLocationID']);
             //-------------------------------------------------------------------------------------------------------
             if ($outletOld->name != $outlet->name) {
                 //echo " , outlet changed, send to email";
                 $old_reservation_outlet = $outletOld->name;
                 $new_reservation_outlet = $outlet->name;
                 $arrResponse['reservation_oulet'] = " Old Outlet: " . $old_reservation_outlet . " -> New Outlet: " . $new_reservation_outlet;
             } else {
                 $arrResponse['reservation_oulet'] = "";
             }
         }
     }
     //check for party size change
     if ($queryResult->no_of_persons != $arrData['partySize']) {
         //echo " , party size changed, send to email";
         $old_reservation_party_size = $queryResult->no_of_persons;
         $new_reservation_party_size = $arrData['partySize'];
         $arrResponse['reservation_party_size'] = " Old Party Size: " . $old_reservation_party_size . " -> New Party Size: " . $new_reservation_party_size;
     } else {
         $arrResponse['reservation_party_size'] = "";
     }
     //check for date change
     if ($queryResult->reservation_date != $arrData['reservationDate']) {
         $old_reservation_date = $queryResult->reservation_date;
         $new_reservation_date = $arrData['reservationDate'];
         $arrResponse['reservation_date'] = " Old Date: " . $old_reservation_date . " -> New Date: " . $new_reservation_date;
     } else {
         $arrResponse['reservation_date'] = "";
     }
     //check for time change
     if ($arrData['reservationTime'] != $queryResult->reservation_time) {
         $old_reservation_time = $queryResult->reservation_time;
         $new_reservation_time = $arrData['reservationTime'];
         $arrResponse['reservation_time'] = " Old Time: " . $old_reservation_time . " -> New Time: " . $new_reservation_time;
     } else {
         $arrResponse['reservation_time'] = "";
     }
     return $arrResponse;
 }
開發者ID:Charu91,項目名稱:Wowtables1,代碼行數:62,代碼來源:ReservationDetails.php

示例5: findOrCreate_pivotTable

 public static function findOrCreate_pivotTable(Request $request, Table $model, Table $toModel)
 {
     //dd($model->namespace);
     $devis = Devis::find($request->devis_id);
     //$from_field_name = snake_case($model->model).'_id';
     //$to_field_name = snake_case($toModel->model).'_id';
     $models = array($model->model, $toModel->model);
     sort($models);
     $pivotTableName = strtolower($models[0] . '_' . $models[1]);
     $pivotTable = Self::where('devis_id', $devis->id)->where('name', $pivotTableName)->first();
     if (!$pivotTable) {
         $pivotTable = Table::create(['name' => $pivotTableName, 'devis_id' => $devis->id, 'namespace_id' => $model->namespace_id]);
     }
     return $pivotTable;
 }
開發者ID:thibaultvanc,項目名稱:organit,代碼行數:15,代碼來源:Table.php

示例6: getIdByLogin

 public static function getIdByLogin($login)
 {
     return Self::where('loginClient', '=', $login)->lists('idClient')[0];
 }
開發者ID:Adelinegen,項目名稱:Linea,代碼行數:4,代碼來源:Client.php

示例7: group

 /**
  * @return Relationship
  */
 public function group()
 {
     return Self::where('MAR_PEZ', $this->MAR_PEZ)->where('FLG_REC', 3)->get();
 }
開發者ID:system3d,項目名稱:gestor-de-lotes,代碼行數:7,代碼來源:Handle.php

示例8: findLibelleSens

 public static function findLibelleSens($ligne, $sens)
 {
     return Self::where('numero', '=', $ligne)->where('sens', '=', $sens)->lists('libelleLigne')[0];
 }
開發者ID:Adelinegen,項目名稱:Linea,代碼行數:4,代碼來源:Ligne.php

示例9: cancelReservation

 /**
  * Updates the status of the reservation to cancel.
  * 
  * @access  public
  * @static  true
  * @param integer $reservationID
  * @return  array
  * @since 1.0.0
  */
 public static function cancelReservation($reservationID, $reservationType)
 {
     //array to hold response
     $arrResponse = array();
     $queryResult = Self::where('id', $reservationID)->where('reservation_status', '!=', 'cancel')->first()->toArray();
     if ($queryResult) {
         $reservation = Self::find($reservationID);
         $reservation->reservation_status = 'cancel';
         $reservation->save();
         $arrResponse['status'] = 'ok';
     } else {
         $arrResponse['status'] = 'failed';
         $arrResponse['msg'] = 'Sorry. No Such record exists.';
     }
     return $arrResponse;
 }
開發者ID:Charu91,項目名稱:Wowtables1,代碼行數:25,代碼來源:ReservationModel.php

示例10: findNameById

 /**
  * Retourne le nom de l'arrêt grâce à l'ID spécifiée
  */
 public static function findNameById($idArret)
 {
     return Self::where('idArret', '=', $idArret)->lists('nomArret')[0];
 }
開發者ID:Adelinegen,項目名稱:Linea,代碼行數:7,代碼來源:Arret.php

示例11: getMenuLinks

 public static function getMenuLinks($idSubmenu)
 {
     return Self::where('submenu', '=', $idSubmenu)->get();
 }
開發者ID:Adelinegen,項目名稱:Linea,代碼行數:4,代碼來源:Page.php

示例12: staffShowable

 /**
  *Get the showable news for foundation
  */
 protected static function staffShowable()
 {
     return Self::where('level', self::$levels['staff'])->get();
 }
開發者ID:razikallayi,項目名稱:peaceschools,代碼行數:7,代碼來源:News.php


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