本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例6: getIdByLogin
public static function getIdByLogin($login)
{
return Self::where('loginClient', '=', $login)->lists('idClient')[0];
}
示例7: group
/**
* @return Relationship
*/
public function group()
{
return Self::where('MAR_PEZ', $this->MAR_PEZ)->where('FLG_REC', 3)->get();
}
示例8: findLibelleSens
public static function findLibelleSens($ligne, $sens)
{
return Self::where('numero', '=', $ligne)->where('sens', '=', $sens)->lists('libelleLigne')[0];
}
示例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;
}
示例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];
}
示例11: getMenuLinks
public static function getMenuLinks($idSubmenu)
{
return Self::where('submenu', '=', $idSubmenu)->get();
}
示例12: staffShowable
/**
*Get the showable news for foundation
*/
protected static function staffShowable()
{
return Self::where('level', self::$levels['staff'])->get();
}