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


PHP Customers::where方法代码示例

本文整理汇总了PHP中Customers::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::where方法的具体用法?PHP Customers::where怎么用?PHP Customers::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Customers的用法示例。


在下文中一共展示了Customers::where方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: filter

 public static function filter($input, $limit = 24)
 {
     return Customers::where(function ($query) use($input) {
         if (array_key_exists('name', $input) && strlen($input['name'])) {
             $query->where('name', 'LIKE', "%" . $input['name'] . "%");
         }
         if (array_key_exists('address', $input) && strlen($input['address'])) {
             $query->where('address', 'LIKE', "%" . $input['address'] . "%");
         }
         if (array_key_exists('contact', $input) && strlen($input['contact'])) {
             $query->where('contact', 'LIKE', "%" . $input['contact'] . "%");
         }
     })->orderBy('name', 'asc')->paginate($limit);
 }
开发者ID:nurulimamnotes,项目名称:point-of-sale,代码行数:14,代码来源:Customers.php

示例2: getNonMembersList

 public function getNonMembersList()
 {
     if (Auth::check()) {
         $currentPage = "PROSPECTUS_LIST";
         $mainMenu = "CUSTOMERS_MAIN";
         //$customer_members=  CustomerMembership::count();
         if (CustomerMembership::count()) {
             $customers = Customers::getAllCustomerNonMembersByFranchiseeId(Session::get('franchiseId'));
         } else {
             $customers = Customers::where('franchisee_id', '=', Session::get('franchiseId'))->get();
         }
         $provinces = Provinces::getProvinces("IN");
         $viewData = array('customers', 'currentPage', 'mainMenu', 'provinces');
         return View::make('pages.customers.prospectuslist', compact($viewData));
     } else {
         return Redirect::to("/");
     }
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:18,代码来源:CustomersController.php

示例3: getCustomerCount

 static function getCustomerCount()
 {
     return Customers::where('franchisee_id', '=', Session::get('franchiseId'))->count();
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:4,代码来源:Customers.php

示例4: printBdayOrder

 public function printBdayOrder($oid)
 {
     $orderid = Crypt::decrypt($oid);
     $order_data = Orders::where('orders.id', '=', $orderid)->get();
     $customer_data = Customers::where('id', '=', $order_data[0]['customer_id'])->get();
     $birthday_data = BirthdayParties::where('id', '=', $order_data[0]['birthday_id'])->get();
     $student_data = Students::where('id', '=', $order_data[0]['student_id'])->get();
     $order_data = $order_data[0];
     if (isset($order_data['payment_dues_id'])) {
         $payment_due_data = PaymentDues::where('id', '=', $order_data['payment_dues_id'])->get();
         $payment_due_data = $payment_due_data[0];
         if (isset($payment_due_data->membership_id)) {
             $membershipData = CustomerMembership::find($payment_due_data->membership_id);
             $membershipTypeData = MembershipTypes::getMembershipTypeByID($membershipData->membership_type_id);
             $payment_due_data->description = $membershipTypeData->description;
         }
     }
     $customer_data = $customer_data[0];
     $birthday_data = $birthday_data[0];
     $student_data = $student_data[0];
     $data = array('order_data', 'customer_data', 'birthday_data', 'student_data', 'payment_due_data');
     // print_r($data);
     return View::make('pages.orders.bdayprintorder', compact($data));
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:24,代码来源:PaymentsController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::check()) {
         $currentPage = "";
         $mainMenu = "DASHBOARD";
         //customers or Inquiries
         $todaysCustomerReg = Customers::getCustomertodaysRegCount();
         $customerCount = Customers::getCustomerCount();
         //Members or Family Members
         $todaysMemberReg = CustomerMembership::getMembertodaysRegCount();
         $membersCount = CustomerMembership::getMemberCount();
         //Non Members or prospects
         $todaysNonmemberReg = CustomerMembership::getNonMembertodaysRegCount();
         $NonmembersCount = CustomerMembership::getNonMemberCount();
         //Enrolled customers(kids)
         $todaysEnrolledCustomers = StudentClasses::getTodaysEnrolledCustomers();
         $enrolledCustomers = StudentClasses::getEnrolledCustomers();
         //for followups
         $reminderCount = Comments::getReminderCountByFranchiseeId();
         //Introvisit
         $totalIntrovisitCount = IntroVisit::getIntrovistCount();
         $introVisitCount = IntroVisit::getIntrovisitBytoday();
         $allIntrovisits = IntroVisit::getAllActiveIntrovisit();
         for ($i = 0; $i < count($allIntrovisits); $i++) {
             $data = Comments::where('introvisit_id', '=', $allIntrovisits[$i]['id'])->orderBy('id', 'DESC')->first();
             if (isset($data)) {
                 $allIntrovisits[$i]['followup_status'] = $data['followup_status'];
             }
         }
         //for courses
         $totalParentchildCourse = Classes::getallParentchildCourseCount();
         $totalPrekgKindergarten = Classes::getallPrekgKindergartenCount();
         $totalGradeschool = Classes::getallGradeschoolCount();
         $totalCourses = $totalParentchildCourse + $totalPrekgKindergarten + $totalGradeschool;
         //for birthdayparty
         $totalbpartyCount = BirthdayParties::getBpartyCount();
         $todaysbpartycount = BirthdayParties::getBpartyCountBytoday();
         $todaysFollowup = Comments::getAllFollowup();
         $todaysIntrovisit = BatchSchedule::getTodaysIntroVisits();
         $activeRemindersCount = Comments::getAllFollowupActive();
         //get birthday dates
         $startdate = new carbon();
         $startdate->startOfYear();
         $endofyear = new carbon();
         $endofyear = $endofyear->endOfYear();
         $student_id = array();
         $birthday_celebration_data = BirthdayParties::where('created_at', '>=', $startdate->toDateString())->where('created_at', '<=', $endofyear->toDateString())->select('student_id')->get();
         //var_dump($birthday_celebration_data); die();
         for ($i = 0; $i < count($birthday_celebration_data); $i++) {
             $student_id[$i] = $birthday_celebration_data[$i]['student_id'];
         }
         $dat = new carbon();
         $month = $dat->month;
         $presentdate = $dat->day;
         // for rest of the days of month
         $birthday_data = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '>', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
         //  echo $month; die();
         for ($i = 0; $i < count($birthday_data); $i++) {
             $customer_data = Customers::where('id', '=', $birthday_data[$i]['customer_id'])->get();
             $birthday_data[$i]['customer_name'] = $customer_data[0]['customer_name'];
             $birthday_data[$i]['mobile_no'] = $customer_data[0]['mobile_no'];
             $birthday_data[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data[$i]['customer_id'])->count();
         }
         $m = $month;
         $m++;
         while ($m <= 12) {
             $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
             $m++;
         }
         // for starting months
         $m = 1;
         while ($m < $month) {
             $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
             $m++;
         }
         for ($i = 0; $i < count($birthday_data_month); $i++) {
             for ($j = 0; $j < count($birthday_data_month[$i]); $j++) {
                 $customer_data = Customers::where('id', '=', $birthday_data_month[$i][$j]['customer_id'])->get();
                 $birthday_data_month[$i][$j]['customer_name'] = $customer_data[0]['customer_name'];
                 $birthday_data_month[$i][$j]['mobile_no'] = $customer_data[0]['mobile_no'];
                 $birthday_data_month[$i][$j]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data_month[$i][$j]['customer_id'])->count();
             }
         }
         // var_dump($birthday_data_month);exit();
         //for starting days of present month
         $birthday_month_startdays = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '<', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
         for ($i = 0; $i < count($birthday_month_startdays); $i++) {
             $customer_data = Customers::where('id', '=', $birthday_month_startdays[$i]['customer_id'])->get();
             $birthday_month_startdays[$i]['customer_name'] = $customer_data[0]['customer_name'];
             $birthday_month_startdays[$i]['mobile_no'] = $customer_data[0]['mobile_no'];
             $birthday_month_startdays[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_month_startdays[$i]['customer_id'])->count();
         }
         //for birthday celebration this week
         $presentdate = new carbon();
         $weeekdate = new carbon();
//.........这里部分代码省略.........
开发者ID:Headrun-php,项目名称:TLG,代码行数:101,代码来源:DashboardController.php

示例6: addIntroVisit

 public function addIntroVisit()
 {
     $inputs = Input::all();
     $schedule['batchId'] = $inputs['introbatchCbx'];
     $schedule['scheduleDate'] = date('Y-m-d', strtotime($inputs['introVisitTxtBox']));
     $schedule['scheduleType'] = 'introvisit';
     $schedule['customerId'] = $inputs['customerId'];
     $schedule['studentId'] = $inputs['studentIdIntroVisit'];
     $introVisitAdd = BatchSchedule::addIntrovisit($schedule);
     $commentsInput['customerId'] = $inputs['customerId'];
     $commentsInput['commentText'] = $inputs['customerCommentTxtarea'];
     $commentsInput['reminder_type'] = "iv_scheduled";
     $commentsInput['reminderDate'] = date("Y-m-d", strtotime($inputs['introVisitTxtBox']));
     $comments = Comments::addComments($commentsInput);
     $customerObject = Customers::where("id", "=", $inputs['customerId'])->get();
     $customer['customerName'] = $customerObject['0']->customer_name;
     $customer['customerEmail'] = $customerObject['0']->customer_email;
     $customer['introVisitDate'] = date('d M Y', strtotime($inputs['introVisitTxtBox']));
     Mail::send('emails.account.introvisit', $customer, function ($msg) use($customer) {
         $msg->from(Config::get('constants.EMAIL_ID'), Config::get('constants.EMAIL_NAME'));
         $msg->to($customer['customerEmail'], $customer['customerName'])->subject('The Little Gym - Introductory Visit');
     });
     if ($introVisitAdd) {
         return Response::json(array("status" => "success"));
     }
     return Response::json(array("status" => "failed"));
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:27,代码来源:EventsController.php


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