本文整理汇总了PHP中Students::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Students::where方法的具体用法?PHP Students::where怎么用?PHP Students::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Students
的用法示例。
在下文中一共展示了Students::where方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStudentId
static function getStudentId($id)
{
return Students::where('id', '=', $id)->get();
}
示例2: getStudentsByCustomerid
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public static function getStudentsByCustomerid()
{
$inputs = Input::all();
$students_data = Students::where('customer_id', '=', $inputs['customer_id'])->get();
if ($students_data) {
return Response::json(array('status' => 'success', 'student_data' => $students_data));
} else {
return Response::json(array('status' => 'failure'));
}
}
示例3: 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));
}
示例4: discount
static function discount($studentId, $customerId)
{
/* return StudentClasses::where('student_id', '=', $studentId)
->where('class_id', '=', $classid)
->first(); */
$isEligibleforTwenty = "NO";
$isEligibleforFifty = "NO";
$Students = Students::where("customer_id", "=", $customerId)->where("id", '<>', $studentId)->get();
$enrolledStudent = 0;
foreach ($Students as $student) {
$enrolledStudent = StudentClasses::where('student_id', '=', $student->id)->count();
}
if ($enrolledStudent > 0) {
$isCurrentStudentEnrolled = StudentClasses::where('student_id', '=', $studentId)->count();
if ($isCurrentStudentEnrolled == 0) {
$isEligibleforTwenty = "YES";
}
}
$isCurrentStudentEnrolled = StudentClasses::where('student_id', '=', $studentId)->count();
if ($isCurrentStudentEnrolled > 0) {
$isEligibleforFifty = "YES";
}
return array("eligibleForTwenty" => $isEligibleforTwenty, "eligibleForFifty" => $isEligibleforFifty);
}
示例5: details
public function details($id)
{
if (Auth::check()) {
$currentPage = "CUSTOMERS_LIST";
$mainMenu = "CUSTOMERS_MAIN";
$inputs = Input::all();
if (isset($inputs['customerName'])) {
if (Customers::addCustomers($inputs)) {
Session::flash('msg', "Customer added successfully.");
} else {
Session::flash('warning', "Customer, Course Could not be added at the moment.");
}
}
$customer = Customers::getCustomersById($id);
$students = Students::getStudentByCustomer($id);
$comments = Comments::getCommentByCustomerId($id);
$provinces = Provinces::getProvinces("IN");
$kidsSelect = Students::getStudentsForSelectBox($id);
$membershipTypes = MembershipTypes::getMembershipTypesForSelectBox();
$birthdays = BirthdayParties::getBirthdaysByCustomer($id);
//return $customer;
//Membership
if (isset($inputs['membershipTypesMembersDiv'])) {
/* echo '<pre>';
print_r($inputs);
echo '</pre>';
exit(); */
if ($inputs['membershipTypesMembersDiv'] != "") {
$membershipInput['customer_id'] = $id;
$membershipInput['membership_type_id'] = $inputs['membershipTypesMembersDiv'];
CustomerMembership::addMembership($membershipInput);
$order['customer_id'] = $id;
$order['payment_for'] = "membership";
$order['payment_dues_id'] = '';
$order['payment_mode'] = $inputs['paymentTypeRadio'];
$order['card_last_digit'] = $inputs['card4digits'];
$order['card_type'] = $inputs['cardType'];
$order['bank_name'] = $inputs['bankName'];
$order['cheque_number'] = $inputs['chequeNumber'];
$order['amount'] = $inputs['membershipPrice'];
$order['order_status'] = "completed";
Orders::createOrder($order);
}
}
//$customerMembership = "";
/* echo '<pre>';
print_r($customer);
echo '</pre>';
exit(); */
$presentDate = Carbon::now();
$membershipStartDate = Carbon::now();
$membershipEndDate = Carbon::now();
$customerMembershipId = '';
if (isset($customer->CustomerMembership['0'])) {
$select = count($customer->CustomerMembership) - 1;
$membershipStartDate = $membershipStartDate->createFromFormat('Y-m-d', $customer->CustomerMembership[$select]->membership_start_date);
$membershipEndDate = $membershipEndDate->createFromFormat('Y-m-d', $customer->CustomerMembership[$select]->membership_end_date);
if ($membershipStartDate->lte($presentDate) && $membershipEndDate->gte($presentDate)) {
$customerMembershipId = $customer->CustomerMembership[$select]->membership_type_id;
}
}
if (isset($customerMembershipId)) {
$customerMembership = MembershipTypes::getMembershipTypeByID($customerMembershipId);
}
$membershipTypesAll = MembershipTypes::getMembershipTypes();
$birthdaypaiddata = Orders::getBirthdayfulldata($id);
for ($i = 0; $i < count($birthdaypaiddata); $i++) {
$studentData = Students::getStudentById($birthdaypaiddata[$i]['student_id']);
$birthdaypaiddata[$i]['student_name'] = $studentData[0]['student_name'];
$birthdaypaiddata[$i]['student_date_of_birth'] = $studentData[0]['student_date_of_birth'];
$birthdayData = BirthdayParties::getBirthdaybyId($birthdaypaiddata[$i]['birthday_id']);
$birthdaypaiddata[$i]['birthday_party_date'] = $birthdayData[0]['birthday_party_date'];
$birthdaypaiddata[$i]['tax_amount'] = $birthdaypaiddata[0]['tax_amount'];
$user_data = User::getUsersByUserId($birthdaypaiddata[$i]['created_by']);
$birthdaypaiddata[$i]['name'] = $user_data[0]['first_name'] . $user_data[0]['last_name'];
$birthdaypaiddata[$i]['encrypted_id'] = Crypt::encrypt($birthdaypaiddata[$i]['id']);
}
$birthdayDuedata = PaymentDues::getPaymentpendingfulldata($id);
for ($i = 0; $i < count($birthdayDuedata); $i++) {
$studentData = Students::getStudentById($birthdayDuedata[$i]['student_id']);
$birthdayDuedata[$i]['student_name'] = $studentData[0]['student_name'];
$user_data = User::getUsersByUserId($birthdayDuedata[$i]['created_by']);
$birthdayDuedata[$i]['name'] = $user_data[0]['first_name'] . $user_data[0]['last_name'];
$birthdayData = BirthdayParties::getBirthdaybyId($birthdayDuedata[$i]['birthday_id']);
$birthdayDuedata[$i]['birthday_party_date'] = $birthdayData[0]['birthday_party_date'];
}
//followup_data
$iv_data = IntroVisit::where('customer_id', '=', $id)->get();
for ($i = 0; $i < count($iv_data); $i++) {
$comments_data = Comments::where('introvisit_id', '=', $iv_data[$i]['id'])->orderBy('id', 'DESC')->first();
$iv_data[$i]['comment_data'] = $comments_data;
$student = Students::find($iv_data[$i]['student_id']);
$iv_data[$i]['student_name'] = $student['student_name'];
$iv_data[$i]['iv_date'] = date("Y-m-d", strtotime($iv_data[$i]['iv_date']));
}
$birthday_data = BirthdayParties::where('customer_id', '=', $id)->get();
for ($i = 0; $i < count($birthday_data); $i++) {
$birthday_comments = Comments::where('birthday_id', '=', $birthday_data[$i]['id'])->orderBy('id', 'DESC')->first();
$birthday_data[$i]['comment_data'] = $birthday_comments;
$student_data = Students::find($birthday_data[$i]['student_id']);
//.........这里部分代码省略.........
示例6: 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();
//.........这里部分代码省略.........