本文整理汇总了PHP中Gateway::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Gateway::where方法的具体用法?PHP Gateway::where怎么用?PHP Gateway::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gateway
的用法示例。
在下文中一共展示了Gateway::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
/**
* Display a listing of the resource.
*
* @return Response
*/
public function getIndex()
{
if (Request::segment(2) == 'search') {
$input = Session::get('search') && !Input::get('search_category') ? Session::get('search') : Input::only(array('search_category', 'search_keyword'));
switch ($input['search_category']) {
case '0':
return Redirect::to('gateway');
break;
case 'owner':
$gateways = Gateway::whereHas('user', function ($q) {
$q->where('username', 'LIKE', '%' . Input::get('search_keyword') . '%');
})->get();
break;
default:
if (Auth::user()->status == 2) {
$gateways = Gateway::where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
} else {
$gateways = Gateway::where('user_id', Auth::user()->id)->where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
}
break;
}
Session::set('search', $input);
} else {
Session::remove('search');
$input = array('search_category' => '', 'search_keyword' => '');
$gateways = Auth::user()->status == 2 ? Gateway::all() : Gateway::where('user_id', Auth::user()->id)->get();
}
return View::make('gateway.index')->with('gateways', $gateways)->with('selected', $input);
}
示例2: run
public function run()
{
Eloquent::unguard();
$gateways = [array('name' => 'BeanStream', 'provider' => 'BeanStream', 'payment_library_id' => 2), array('name' => 'Psigate', 'provider' => 'Psigate', 'payment_library_id' => 2)];
$updateProviders = array(0 => 'AuthorizeNet_AIM', 4 => 'PayPal_Pro', 5 => 'TwoCheckout');
foreach ($gateways as $gateway) {
Gateway::create($gateway);
}
Gateway::whereIn('provider', $updateProviders)->update(array('recommended' => 1));
Gateway::where('provider', '=', 'AuthorizeNet_AIM')->update(array('sort_order' => 5, 'site_url' => 'http://reseller.authorize.net/application/?id=5560364'));
//Gateway::where('provider', '=', 'BeanStream')->update(array('sort_order' => 10, 'site_url' => 'http://www.beanstream.com/'));
//Gateway::where('provider', '=', 'FirstData_Connect')->update(array('sort_order' => 20, 'site_url' => 'https://www.firstdata.com/'));
Gateway::where('provider', '=', 'PayPal_Pro')->update(array('sort_order' => 25, 'site_url' => 'https://www.paypal.com/'));
Gateway::where('provider', '=', 'TwoCheckout')->update(array('sort_order' => 30, 'site_url' => 'https://www.2checkout.com/referral?r=2c37ac2298'));
}
示例3: postGatewaylist
public function postGatewaylist()
{
$token = Input::only('token');
$user_id = $this->_getUserId($token['token']);
$gateways = [];
$status = 0;
if ($user_id) {
$status = $this->_getUserStatus($user_id);
if ($status == 3) {
$gateways = Gateway::where('user_id', $user_id)->get();
$error = array(0, "");
} elseif ($status == 2) {
$gateways = Gateway::all();
$error = array(0, "");
}
} else {
$error = array(403, "Invalid Token");
}
return View::make('api.gateway')->with('gateways', $gateways)->with('error', $error)->with('status', $status);
}