当前位置: 首页>>代码示例>>PHP>>正文


PHP Self::find方法代码示例

本文整理汇总了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];
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:7,代码来源:Detail.php

示例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];
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:7,代码来源:Order.php

示例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];
     }
 }
开发者ID:lotcz,项目名称:zshop,代码行数:9,代码来源:payment_type.m.php

示例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'));
     }
 }
开发者ID:Metrakit,项目名称:dynamix,代码行数:21,代码来源:Formr.php

示例5: getTypes

 public function getTypes()
 {
     return Self::find()->select('type_id,type_name')->asArray()->all();
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:4,代码来源:Type.php

示例6: checkPhone

 public function checkPhone($uid, $phone)
 {
     return Self::find()->select('user_phone')->where(['user_id' => $uid, 'user_phone' => $phone])->Asarray()->One();
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:4,代码来源:User.php

示例7: getParentList

 public function getParentList($region_id)
 {
     return Self::find()->where(['pid' => $region_id])->asArray()->all();
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:4,代码来源:Region.php

示例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];
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:12,代码来源:Merchant.php

示例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();
 }
开发者ID:wangpengzhen,项目名称:web,代码行数:4,代码来源:Partjob.php

示例10: getDefault

 static function getDefault($delivery_types)
 {
     return Self::find($delivery_types, 'delivery_type_is_default', 1);
 }
开发者ID:lotcz,项目名称:zshop,代码行数:4,代码来源:delivery_type.m.php

示例11: getFamilyMembersById

 public function getFamilyMembersById()
 {
     return Self::find()->where(['family_id' => $this->id])->all();
 }
开发者ID:jcshep,项目名称:FrontRunner,代码行数:4,代码来源:Person.php

示例12: getLibelleTypeSemaine

 public static function getLibelleTypeSemaine($ligne)
 {
     return Self::find($ligne)->libelleTypeSemaine;
 }
开发者ID:Adelinegen,项目名称:Linea,代码行数:4,代码来源:TypeSemaine.php

示例13: destroy

 public static function destroy($id)
 {
     Self::find($id)->delete();
     return redirect('results');
 }
开发者ID:AummyKa,项目名称:laravel_registration,代码行数:5,代码来源:User.php

示例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;
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:25,代码来源:ReservationModel.php

示例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);
//.........这里部分代码省略.........
开发者ID:Charu91,项目名称:Wowtables1,代码行数:101,代码来源:ReservationDetails.php


注:本文中的Self::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。