2015-11-05 23:37:04 +01:00
|
|
|
<?php namespace App\Ninja\Repositories;
|
|
|
|
|
|
|
|
use DB;
|
|
|
|
|
|
|
|
class AccountGatewayRepository extends BaseRepository
|
|
|
|
{
|
|
|
|
public function getClassName()
|
|
|
|
{
|
|
|
|
return 'App\Models\AccountGateway';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function find($accountId)
|
|
|
|
{
|
2016-05-14 23:23:20 +02:00
|
|
|
$query = DB::table('account_gateways')
|
2015-11-05 23:37:04 +01:00
|
|
|
->join('gateways', 'gateways.id', '=', 'account_gateways.gateway_id')
|
2016-05-14 23:23:20 +02:00
|
|
|
->where('account_gateways.account_id', '=', $accountId);
|
|
|
|
|
|
|
|
if (!\Session::get('show_trash:gateway')) {
|
|
|
|
$query->where('account_gateways.deleted_at', '=', null);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $query->select('account_gateways.id', 'account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at', 'account_gateways.gateway_id');
|
2015-11-05 23:37:04 +01:00
|
|
|
}
|
|
|
|
}
|