本文整理汇总了PHP中Self::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Self::find方法的具体用法?PHP Self::find怎么用?PHP Self::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Self
的用法示例。
在下文中一共展示了Self::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sel_detail
public function sel_detail($user_id)
{
$query = Self::find()->select('*')->from('fin_detail')->where(['user_id' => $user_id]);
$pages = new Pagination(['defaultPageSize' => 5, 'totalCount' => $query->count()]);
$detail = $query->offset($pages->offset)->limit($pages->limit)->Asarray()->all();
return ['detail' => $detail, 'pages' => $pages];
}
示例2: getOrder
public function getOrder($user_id)
{
$query = Self::find()->select('*')->from('fin_order as order')->leftjoin('fin_student as student', 'order.user_id = student.user_id')->where(['order.merchant_id' => $user_id]);
$pages = new Pagination(['defaultPageSize' => 5, 'totalCount' => $query->count()]);
$order = $query->offset($pages->offset)->limit($pages->limit)->Asarray()->all();
return ['order' => $order, 'pages' => $pages];
}
示例3: getDefault
static function getDefault($payment_types)
{
$def = Self::find($payment_types, 'payment_type_is_default', 1);
if (isset($def)) {
return $def;
} else {
return $payment_types[0];
}
}
示例4: formAction
public static function formAction($inputs, $modelId)
{
if (null == $modelId) {
$form = new self();
$form->i18n_title = i18n::add($inputs['title'], 'title');
$form->i18n_description = i18n::add($inputs['description'], 'description');
} else {
$form = Self::find($modelId);
i18n::change($form->i18n_title, $inputs['title']);
i18n::change($form->i18n_description, $inputs['description']);
}
//var_dump($inputs); die;
$form->finish_on = $inputs['finish_on'];
$form->type = $inputs['type'];
$form->save();
if (null == $modelId) {
return Redirect::route('admin.form.show', $form->id)->with('success', Lang::get('forms.create.success'));
} else {
return Redirect::route('admin.form.show', $form->id)->with('success', Lang::get('forms.update.success'));
}
}
示例5: getTypes
public function getTypes()
{
return Self::find()->select('type_id,type_name')->asArray()->all();
}
示例6: checkPhone
public function checkPhone($uid, $phone)
{
return Self::find()->select('user_phone')->where(['user_id' => $uid, 'user_phone' => $phone])->Asarray()->One();
}
示例7: getParentList
public function getParentList($region_id)
{
return Self::find()->where(['pid' => $region_id])->asArray()->all();
}
示例8: payment
public function payment($merchant_id, $discount_id, $user_id)
{
//echo $merchant_id;die;
$merchant = Self::find()->select('merchant.merchant_id, merchant.merchant_name')->from('fin_merchant as merchant')->where(['merchant.merchant_id' => $merchant_id])->Asarray()->one();
//优惠信息
$model1 = new Discount();
$discount = $model1::find()->select('discount.discount_id, discount.discount_type, discount.discount_explain')->from('fin_discount as discount')->where(['discount.discount_id' => $discount_id])->asArray()->one();
//学生信息
$model2 = new User();
$user = $model2::find()->select('student.student_id, student.student_balance, student.student_pay_pwd')->from('fin_user as user')->leftjoin('fin_student as student', 'user.user_id=student.user_id')->where(['user.user_id' => $user_id])->Asarray()->one();
return ['merchant' => $merchant, 'discount' => $discount, 'user' => $user];
}
示例9: getPartJob
public function getPartJob()
{
return Self::find()->select('partjob_id,type_name,partjob_name, partjob_job_starttime, partjob_job_endtime, partjob_wages,partjob_set_method,partjob_is_model')->from('fin_partjob as p')->leftjoin('fin_type as t', 'p.type_id=t.type_id')->leftjoin('fin_user as u', 'p.user_id=u.user_id')->where(['p.user_id' => 1, 'u.user_type' => 1])->Asarray()->all();
}
示例10: getDefault
static function getDefault($delivery_types)
{
return Self::find($delivery_types, 'delivery_type_is_default', 1);
}
示例11: getFamilyMembersById
public function getFamilyMembersById()
{
return Self::find()->where(['family_id' => $this->id])->all();
}
示例12: getLibelleTypeSemaine
public static function getLibelleTypeSemaine($ligne)
{
return Self::find($ligne)->libelleTypeSemaine;
}
示例13: destroy
public static function destroy($id)
{
Self::find($id)->delete();
return redirect('results');
}
示例14: 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;
}
示例15: updateReservationDetail
/**
* Updates the reservation details stored in DB.
*
* @access public
* @param array $arrData
* @return array
* @since 1.0.0
*/
public static function updateReservationDetail($arrData)
{
//array to hold response
$arrResponse = array();
$date = date_create($arrData['reservationTime']);
$arrData['reservationTime'] = date_format($date, "h:i A");
//Read and hold the last reservation details
$lastReservationDetail = self::getLastReservationDetail($arrData);
$queryResult = Self::where('id', $arrData['reservationID'])->whereIn('reservation_status', array('new', 'edited'))->first();
if ($queryResult) {
$reservation = Self::find($arrData['reservationID']);
//initializing the data
$reservation->reservation_status = 'edited';
$reservation->reservation_date = $arrData['reservationDate'];
$reservation->reservation_time = $arrData['reservationTime'];
$reservation->no_of_persons = $arrData['partySize'];
$reservation->vendor_location_id = $arrData['vendorLocationID'];
$reservation->guest_name = $arrData['guestName'];
$reservation->guest_email = $arrData['guestEmail'];
$reservation->guest_phone = $arrData['phone'];
$reservation->reservation_type = $arrData['reservationType'];
//setting up the variables that may be present
if (isset($arrData['specialRequest'])) {
$reservation->special_request = $arrData['specialRequest'];
}
if (isset($arrData['giftCardID'])) {
$reservation->giftcard_id = $arrData['giftCardID'];
}
if (isset($arrData['addedBy'])) {
$reservation->added_by = $arrData['addedBy'];
}
//setting up the value of the location id as per type
if ($arrData['reservationType'] == 'alacarte') {
$reservation->vendor_location_id = $arrData['vendorLocationID'];
$reservation->product_vendor_location_id = 0;
} else {
if ($arrData['reservationType'] == 'experience') {
$reservation->vendor_location_id = 0;
$reservation->product_vendor_location_id = $arrData['vendorLocationID'];
//----------------------------------------------------------------------
$arrResult = self::readProductIdAndVendorLocation($arrData['vendorLocationID']);
$reservation->vendor_location_id = $arrResult->vendor_location_id;
$reservation->product_id = $arrResult->product_id;
//-----------------------------------------------------------------------
if (array_key_exists('addon', $arrData) && !empty($arrData['addon'])) {
//self::updateReservationAddonDetails($arrData['reservationID'],$arrData['addon']);
//Reading value for addon
$count = $arrData['addon'];
if ($count == "") {
$arrData['addon'] = array();
}
// echo "<pre>"; print_r($dataPost);
$addonsText = '';
foreach ($arrData['addon'] as $key => $value) {
if ($value['qty'] > 0) {
//echo "prod id = ".$prod_id." , qty = ".$qty;
$prod_id = $value['prod_id'];
$addonsDetails = DB::select("SELECT attribute_value from product_attributes_text where product_id = {$prod_id} and product_attribute_id = 17");
//echo "<pre>"; print_r($addonsDetails);
$addonsText .= $addonsDetails[0]->attribute_value . " (" . $value['qty'] . ") , ";
}
}
/* foreach($arrData['addon'] as $prod_id => $qty) {
if($qty > 0){
//echo "prod id = ".$prod_id." , qty = ".$qty;
$addonsDetails = DB::select("SELECT attribute_value from product_attributes_text where product_id = $prod_id and product_attribute_id = 17");
//echo "<pre>"; print_r($addonsDetails);
$addonsText .= $addonsDetails[0]->attribute_value." (".$qty.") , ";
}
}
*/
$finalAddontext = isset($addonsText) && $addonsText != "" ? "Addons: " . $addonsText : " ";
$special_request = isset($arrData['specialRequest']) && !empty($arrData['specialRequest']) ? "Spl Req: " . $arrData['specialRequest'] : "";
$arrData['addons_special_request'] = $finalAddontext . " " . $special_request;
//---------------------------------------------------------------------------
} else {
$finalAddontext = " ";
$special_request = isset($arrData['specialRequest']) && !empty($arrData['specialRequest']) ? "Spl Req: " . $arrData['specialRequest'] : "";
$arrData['addons_special_request'] = $finalAddontext . " " . $special_request;
}
}
}
#saving the information into the DB
$savedData = $reservation->save();
//Added on 28.5.15
$resultData = Self::where('id', $arrData['reservationID'])->select('reservation_type', 'product_vendor_location_id', 'vendor_location_id')->first();
//print_r($resultData['product_vendor_location_id']);
//print_r($resultData['vendor_location_id']);
//die();
$zohoMailStatus = Self::sendZohoMailupdate($arrData, $lastReservationDetail);
//.........这里部分代码省略.........