本文整理汇总了PHP中Walker::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Walker::paginate方法的具体用法?PHP Walker::paginate怎么用?PHP Walker::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Walker
的用法示例。
在下文中一共展示了Walker::paginate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: payment_details
public function payment_details()
{
$braintree_environment = Config::get('app.braintree_environment');
$braintree_merchant_id = Config::get('app.braintree_merchant_id');
$braintree_public_key = Config::get('app.braintree_public_key');
$braintree_private_key = Config::get('app.braintree_private_key');
$braintree_cse = Config::get('app.braintree_cse');
$twillo_account_sid = Config::get('app.twillo_account_sid');
$twillo_auth_token = Config::get('app.twillo_auth_token');
$twillo_number = Config::get('app.twillo_number');
$stripe_publishable_key = Config::get('app.stripe_publishable_key');
$default_payment = Config::get('app.default_payment');
$stripe_secret_key = Config::get('app.stripe_secret_key');
$mail_driver = Config::get('mail.mail_driver');
$email_name = Config::get('mail.from.name');
$email_address = Config::get('mail.from.address');
$mandrill_secret = Config::get('services.mandrill_secret');
$install = array('braintree_environment' => $braintree_environment, 'braintree_merchant_id' => $braintree_merchant_id, 'braintree_public_key' => $braintree_public_key, 'braintree_private_key' => $braintree_private_key, 'braintree_cse' => $braintree_cse, 'twillo_account_sid' => $twillo_account_sid, 'twillo_auth_token' => $twillo_auth_token, 'twillo_number' => $twillo_number, 'stripe_publishable_key' => $stripe_publishable_key, 'stripe_secret_key' => $stripe_secret_key, 'mail_driver' => $mail_driver, 'email_address' => $email_address, 'email_name' => $email_name, 'mandrill_secret' => $mandrill_secret, 'default_payment' => $default_payment);
$start_date = Input::get('start_date');
$end_date = Input::get('end_date');
$submit = Input::get('submit');
$walker_id = Input::get('walker_id');
$owner_id = Input::get('owner_id');
$status = Input::get('status');
$start_time = date("Y-m-d H:i:s", strtotime($start_date));
$end_time = date("Y-m-d H:i:s", strtotime($end_date));
$start_date = date("Y-m-d", strtotime($start_date));
$end_date = date("Y-m-d", strtotime($end_date));
$query = DB::table('request')->leftJoin('owner', 'request.owner_id', '=', 'owner.id')->leftJoin('walker', 'request.confirmed_walker', '=', 'walker.id')->leftJoin('walker_type', 'walker.type', '=', 'walker_type.id');
if (Input::get('start_date') && Input::get('end_date')) {
$query = $query->where('request_start_time', '>=', $start_time)->where('request_start_time', '<=', $end_time);
}
if (Input::get('walker_id') && Input::get('walker_id') != 0) {
$query = $query->where('request.confirmed_walker', '=', $walker_id);
}
if (Input::get('owner_id') && Input::get('owner_id') != 0) {
$query = $query->where('request.owner_id', '=', $owner_id);
}
if (Input::get('status') && Input::get('status') != 0) {
if ($status == 1) {
$query = $query->where('request.is_completed', '=', 1);
} else {
$query = $query->where('request.is_cancelled', '=', 1);
}
} else {
$query = $query->where(function ($que) {
$que->where('request.is_completed', '=', 1)->orWhere('request.is_cancelled', '=', 1);
});
}
/* $walks = $query->select('request.request_start_time', 'walker_type.name as type', 'request.ledger_payment', 'request.card_payment', 'owner.first_name as owner_first_name', 'owner.last_name as owner_last_name', 'walker.first_name as walker_first_name', 'walker.last_name as walker_last_name', 'owner.id as owner_id', 'walker.id as walker_id', 'request.id as id', 'request.created_at as date', 'request.*', 'request.is_walker_arrived', 'request.payment_mode', 'request.is_completed', 'request.is_paid', 'request.is_walker_started', 'request.confirmed_walker'
, 'request.status', 'request.time', 'request.distance', 'request.total', 'request.is_cancelled');
$walks = $walks->paginate(10); */
$walks = $query->select('request.request_start_time', 'walker_type.name as type', 'request.ledger_payment', 'request.card_payment', 'owner.first_name as owner_first_name', 'owner.last_name as owner_last_name', 'walker.first_name as walker_first_name', 'walker.last_name as walker_last_name', 'owner.id as owner_id', 'walker.id as walker_id', 'request.id as id', 'request.created_at as date', 'request.is_started', 'request.is_walker_arrived', 'request.payment_mode', 'request.is_completed', 'request.is_paid', 'request.is_walker_started', 'request.confirmed_walker', 'request.promo_id', 'request.promo_code', 'request.status', 'request.time', 'request.distance', 'request.total', 'request.is_cancelled', 'request.promo_payment');
$walks = $walks->orderBy('id', 'DESC')->paginate(10);
$query = DB::table('request')->leftJoin('owner', 'request.owner_id', '=', 'owner.id')->leftJoin('walker', 'request.confirmed_walker', '=', 'walker.id')->leftJoin('walker_type', 'walker.type', '=', 'walker_type.id');
if (Input::get('start_date') && Input::get('end_date')) {
$query = $query->where('request_start_time', '>=', $start_time)->where('request_start_time', '<=', $end_time);
}
if (Input::get('walker_id') && Input::get('walker_id') != 0) {
$query = $query->where('request.confirmed_walker', '=', $walker_id);
}
if (Input::get('owner_id') && Input::get('owner_id') != 0) {
$query = $query->where('request.owner_id', '=', $owner_id);
}
$completed_rides = $query->where('request.is_completed', 1)->count();
$query = DB::table('request')->leftJoin('owner', 'request.owner_id', '=', 'owner.id')->leftJoin('walker', 'request.confirmed_walker', '=', 'walker.id')->leftJoin('walker_type', 'walker.type', '=', 'walker_type.id');
if (Input::get('start_date') && Input::get('end_date')) {
$query = $query->where('request_start_time', '>=', $start_time)->where('request_start_time', '<=', $end_time);
}
if (Input::get('walker_id') && Input::get('walker_id') != 0) {
$query = $query->where('request.confirmed_walker', '=', $walker_id);
}
if (Input::get('owner_id') && Input::get('owner_id') != 0) {
$query = $query->where('request.owner_id', '=', $owner_id);
}
$cancelled_rides = $query->where('request.is_cancelled', 1)->count();
$query = DB::table('request')->leftJoin('owner', 'request.owner_id', '=', 'owner.id')->leftJoin('walker', 'request.confirmed_walker', '=', 'walker.id')->leftJoin('walker_type', 'walker.type', '=', 'walker_type.id');
if (Input::get('start_date') && Input::get('end_date')) {
$query = $query->where('request_start_time', '>=', $start_time)->where('request_start_time', '<=', $end_time);
}
if (Input::get('walker_id') && Input::get('walker_id') != 0) {
$query = $query->where('request.confirmed_walker', '=', $walker_id);
}
if (Input::get('owner_id') && Input::get('owner_id') != 0) {
$query = $query->where('request.owner_id', '=', $owner_id);
}
$card_payment = $query->where('request.is_completed', 1)->sum('request.card_payment');
$query = DB::table('request')->leftJoin('owner', 'request.owner_id', '=', 'owner.id')->leftJoin('walker', 'request.confirmed_walker', '=', 'walker.id')->leftJoin('walker_type', 'walker.type', '=', 'walker_type.id');
if (Input::get('start_date') && Input::get('end_date')) {
$query = $query->where('request_start_time', '>=', $start_time)->where('request_start_time', '<=', $end_time);
}
if (Input::get('walker_id') && Input::get('walker_id') != 0) {
$query = $query->where('request.confirmed_walker', '=', $walker_id);
}
if (Input::get('owner_id') && Input::get('owner_id') != 0) {
$query = $query->where('request.owner_id', '=', $owner_id);
}
$credit_payment = $query->where('request.is_completed', 1)->sum('request.ledger_payment');
$cash_payment = $query->where('request.payment_mode', 1)->sum('request.total');
if (Input::get('submit') && Input::get('submit') == 'Download_Report') {
//.........这里部分代码省略.........
示例2: walkers
public function walkers()
{
Session::forget('che');
//$query = "SELECT *,(select count(*) from request_meta where walker_id = walker.id and status != 0 ) as total_requests,(select count(*) from request_meta where walker_id = walker.id and status=1) as accepted_requests FROM `walker`";
//$walkers = DB::select(DB::raw($query));
$walkers1 = DB::table('walker')->leftJoin('request_meta', 'walker.id', '=', 'request_meta.walker_id')->where('request_meta.status', '!=', 0)->count();
$walkers2 = DB::table('walker')->leftJoin('request_meta', 'walker.id', '=', 'request_meta.walker_id')->where('request_meta.status', '=', 1)->count();
$walkers = Walker::paginate(10);
return View::make('walkers')->with('title', 'Providers')->with('page', 'walkers')->with('walkers', $walkers)->with('total_requests', $walkers1)->with('accepted_requests', $walkers2);
}