本文整理汇总了PHP中Batches::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Batches::where方法的具体用法?PHP Batches::where怎么用?PHP Batches::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Batches
的用法示例。
在下文中一共展示了Batches::where方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBatcheSchedulesbyCourseandClassID
static function getBatcheSchedulesbyCourseandClassID($batchId)
{
$batch = Batches::where('id', "=", $batchId)->get();
$batchSchedules = BatchSchedule::where("batch_id", "=", $batchId)->get();
$calenderData = array();
$i = 0;
$calenderData['gotoDate'] = $batch['0']->start_date;
foreach ($batchSchedules as $batchSchedule) {
/*
*
title: 'Birthday Party',
start: new Date(y, m, d+1, 19, 0),
end: new Date(y, m, d+1, 22, 30),
allDay: false,
[id] => 1
[batch_id] => 8
[franchisee_id] => 1
[schedule_date] => 2015-11-03
[start_time] => 15:00:00
[end_time] => 16:00:00
[created_by] => 2
[updated_by] =>
[created_at] => 2015-11-07 20:54:12
[updated_at] => 2015-11-07 20:54:12
*/
$calenderData['event'][$i]['title'] = $batch['0']->batch_name;
$calenderData['event'][$i]['id'] = $batch['0']->id;
$calenderData['event'][$i]['start'] = $batchSchedule->schedule_date . ' ' . $batchSchedule->start_time;
$calenderData['event'][$i]['end'] = $batchSchedule->schedule_date . ' ' . $batchSchedule->end_time;
$calenderData['event'][$i]['allDay'] = 'false';
$calenderData['event'][$i]['className'] = 'info';
$i++;
}
return $calenderData;
}
示例2: deleteBatchById
static function deleteBatchById($batchId)
{
return Batches::where('id', '=', $batchId)->delete();
}
示例3: getBatchID
static function getBatchID($courseId, $classId, $startYear, $startMonth, $seasonId)
{
if (Batches::count()) {
$batchCount = Batches::where("class_id", "=", $classId)->where('season_id', '=', $seasonId)->count() + 1;
} else {
$batchCount = 1;
}
if ($batchCount < 10) {
$batchCount = str_pad($batchCount, 2, '0', STR_PAD_LEFT);
}
$courseSlug = Courses::select("slug")->where("id", "=", $courseId)->get();
$classSlug = Classes::select("slug")->where("id", "=", $classId)->get();
$yearSlug = date("Y", strtotime($startYear));
$monthSlug = date("M", strtotime($startYear));
$batchSlug = $courseSlug['0']->slug . '-' . $classSlug['0']->slug . '-' . strtoupper($monthSlug) . '-' . $yearSlug . '-' . $batchCount;
//print_r($classSlug['0']->slug);
return $batchSlug;
}
示例4: enrollKid
public function enrollKid()
{
$inputs = Input::all();
$batch_data = Batches::find($inputs['batchCbx']);
$eachClassCost = $batch_data->class_amount;
//return Response::json(array('status'=>$inputs));
//$inputs['discountPercentage']=$inputs['discountP'];
$studentClasses['classId'] = $inputs['eligibleClassesCbx'];
$studentClasses['batchId'] = $inputs['batchCbx'];
$studentClasses['studentId'] = $inputs['studentId'];
$season_data = Seasons::find($inputs['SeasonsCbx']);
//$inputs['enrollmentEndDate']=$season_data->end_date;
//$studentClasses['enrollment_start_date'] = date('Y-m-d', strtotime($inputs['enrollmentStartDate']));
//return Response::json(array('status'=>'working'));
//$studentClasses['enrollment_end_date'] = date('Y-m-d', strtotime($inputs['enrollmentEndDate']));
$studentClasses['selected_sessions'] = $inputs['selectedSessions'];
$studentClasses['seasonId'] = $inputs['SeasonsCbx'];
//for proper enrollment start date and end date
$end = Carbon::now();
$start = Carbon::now();
$start->year = date('Y', strtotime($inputs['enrollmentStartDate']));
$start->month = date('m', strtotime($inputs['enrollmentStartDate']));
$start->day = date('d', strtotime($inputs['enrollmentStartDate']));
$end->year = date('Y', strtotime($inputs['enrollmentEndDate']));
$end->month = date('m', strtotime($inputs['enrollmentEndDate']));
$end->day = date('d', strtotime($inputs['enrollmentEndDate']));
$batch_data = BatchSchedule::where('batch_id', '=', $inputs['batchCbx'])->where('schedule_date', '>=', $start->toDateString())->where('schedule_date', '<=', $end->toDateString())->where('holiday', '!=', 1)->orderBy('id')->get();
$studentClasses['enrollment_start_date'] = $batch_data[0]['schedule_date'];
$studentClasses['enrollment_end_date'] = $batch_data[count($batch_data) - 1]['schedule_date'];
//Batch Start date
$BatchDetails = Batches::where('id', '=', $inputs['batchCbx'])->first();
$reminderStartDate = $BatchDetails->start_date;
$enrollment = StudentClasses::addStudentClass($studentClasses);
$paymentDuesInput['student_id'] = $inputs['studentId'];
$paymentDuesInput['customer_id'] = $inputs['customerId'];
$paymentDuesInput['batch_id'] = $inputs['batchCbx'];
$paymentDuesInput['class_id'] = $inputs['eligibleClassesCbx'];
$paymentDuesInput['selected_sessions'] = $inputs['selectedSessions'];
$paymentDuesInput['seasonId'] = $inputs['SeasonsCbx'];
$paymentDuesInput['each_class_cost'] = $eachClassCost;
$order['customer_id'] = $inputs['customerId'];
$order['student_id'] = $inputs['studentId'];
$order['seasonId'] = $inputs['SeasonsCbx'];
$order['student_classes_id'] = $enrollment->id;
$order['payment_mode'] = $inputs['paymentTypeRadio'];
$order['payment_for'] = "enrollment";
$order['card_last_digit'] = $inputs['card4digits'];
$order['card_type'] = $inputs['cardType'];
$order['bank_name'] = $inputs['bankName'];
$order['cheque_number'] = $inputs['chequeNumber'];
//$order['each_class_cost'] =$eachClassCost;
if (isset($inputs['membershipType'])) {
$order['membershipType'] = $inputs['membershipType'];
}
$paydue_id;
if ($inputs['paymentOptionsRadio'] == 'singlepay') {
// for starting and end date of enrollment
$enddate = Carbon::now();
$startdate = Carbon::now();
$startdate->year = date('Y', strtotime($inputs['enrollmentStartDate']));
$startdate->month = date('m', strtotime($inputs['enrollmentStartDate']));
$startdate->day = date('d', strtotime($inputs['enrollmentStartDate']));
$enddate->year = date('Y', strtotime($inputs['enrollmentEndDate']));
$enddate->month = date('m', strtotime($inputs['enrollmentEndDate']));
$enddate->day = date('d', strtotime($inputs['enrollmentEndDate']));
$batch_data = BatchSchedule::where('batch_id', '=', $inputs['batchCbx'])->where('schedule_date', '>=', $startdate->toDateString())->where('schedule_date', '<=', $enddate->toDateString())->where('holiday', '!=', 1)->orderBy('id')->get();
$paymentDuesInput['start_order_date'] = $batch_data[0]['schedule_date'];
$paymentDuesInput['end_order_date'] = $batch_data[count($batch_data) - 1]['schedule_date'];
$paymentDuesInput['payment_due_amount'] = $inputs['singlePayAmount'];
$paymentDuesInput['payment_type'] = $inputs['paymentOptionsRadio'];
$paymentDuesInput['payment_status'] = "paid";
$paymentDuesInput['discount_applied'] = $inputs['discountPercentage'];
$paymentDuesInput['student_class_id'] = $enrollment->id;
$paymentDuesInput['selected_order_sessions'] = $inputs['selectedSessions'];
//$paymentDuesInput['start_order_date']=$studentClasses['enrollment_start_date'];
//$paymentDuesInput['end_order_date']=$studentClasses['enrollment_end_date'];
$paymentDuesInput['discount_amount'] = $inputs['discountPercentage'] / 100 * $inputs['singlePayAmount'];
$order['amount'] = $inputs['singlePayAmount'];
if ($inputs['CustomerType'] == 'OldCustomer') {
$paymentDuesInput['created_at'] = date('Y-m-d H:i:s', strtotime($inputs['OrderDate']));
$order['created_at'] = $paymentDuesInput['created_at'];
}
$paymentDuesResult = PaymentDues::createPaymentDues($paymentDuesInput);
$order['payment_dues_id'] = $paymentDuesResult->id;
$order['order_status'] = "completed";
if ($inputs['selectedSessions'] > 8) {
// creating followup for the single pay
$presentDate = Carbon::now();
$startdate = Carbon::now();
$startdate->year = date('Y', strtotime($inputs['enrollmentStartDate']));
$startdate->month = date('m', strtotime($inputs['enrollmentStartDate']));
$startdate->day = date('d', strtotime($inputs['enrollmentStartDate']));
$batch_schedule_data = BatchSchedule::where('batch_id', '=', $inputs['batchCbx'])->where('schedule_date', '>=', $startdate->toDateString())->where('holiday', '!=', 1)->orderBy('id')->get();
$session_number = (int) ($inputs['selectedSessions'] / 2);
$reminder_date = $batch_schedule_data[$session_number]['schedule_date'];
$customer_log_data['customer_id'] = $paymentDuesResult->customer_id;
$customer_log_data['student_id'] = $paymentDuesResult->student_id;
$customer_log_data['franchisee_id'] = Session::get('franchiseId');
$customer_log_data['followup_type'] = 'PAYMENT';
$customer_log_data['followup_status'] = 'REMINDER_CALL';
//.........这里部分代码省略.........
示例5: printOrder
public function printOrder($orderid)
{
$id = Crypt::decrypt($orderid);
$orders = Orders::with('Customers', 'Students', 'StudentClasses')->where('id', '=', $id)->get();
$orders = $orders['0'];
$paymentDues = PaymentDues::where('id', '=', $orders->payment_dues_id)->get();
$batchDetails = Batches::where('id', '=', $orders->StudentClasses->batch_id)->get();
$class = Classes::where('id', '=', $orders->StudentClasses->class_id)->where('franchisee_id', '=', Session::get('franchiseId'))->first();
$customerMembership = CustomerMembership::getCustomerMembership($orders->customer_id);
/* echo "<pre>";
print_r($paymentDues);
exit(); */
$data = compact('orders', 'class', 'paymentDues', 'batchDetails', 'customerMembership');
//$data = compact('orders','class');
return View::make('pages.orders.printorder', $data);
}
示例6: function
$inputs = Input::all();
$id = $inputs['id'];
$countryCode = $inputs['countryCode'];
$cities = Cities::getCities($id, $countryCode);
return Response::json($cities);
});
Route::get('logout', "VaultController@logout");
});
Route::get('/test', function () {
$base_price_no = Batches::find(130)->classes()->select('base_price_no')->get();
$base_price_no = $base_price_no[0]['base_price_no'];
echo $base_price_no;
die;
var_dump(ClassBasePrice::where('base_price_no', '=', Batches::find(130)->classes()->base_price_no)->select('base_price')->get());
$classes_count = StudentClasses::where('student_id', '=', 88)->where('status', '=', 'enrolled')->distinct('class_id')->count();
var_dump($classes_count);
exit;
echo PaymentMaster::max('payment_no');
exit;
echo Batches::where('id', '=', '2')->select('class_amount')->get();
exit;
$data = IntroVisit::join('students', 'student_id', '=', 'students.id')->where('introvisit.customer_id', '=', '44')->get();
var_dump($data);
exit;
// 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]['membership']= CustomerMembership::where('customer_id','=',$birthday_data[$i]['customer_id'])->count();
//
// }
});
示例7: editbatchByBatchId
public function editbatchByBatchId()
{
$inputs = Input::all();
$timeString = '2000-3-5 ' . $inputs['batchEndTime'];
$timestamp = strtotime($timeString);
$endTime24Hours = date('H:i:s', $timestamp);
$timeString = '2000-3-5 ' . $inputs['batchStartTime'];
$timestamp = strtotime($timeString);
$startTime24Hours = date('H:i:s', $timestamp);
$data = Batches::where('id', '=', $inputs['batch_id'])->update(array('lead_instructor' => $inputs['l_instructor_id'], 'location_id' => $inputs['location_id'], 'class_amount' => $inputs['class_cost'], 'preferred_time' => $startTime24Hours, 'preferred_end_time' => $endTime24Hours));
return Response::json(array('status' => 'success', 'data' => $data));
}