2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Repositories;
|
2015-11-05 23:37:04 +01:00
|
|
|
|
|
|
|
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')
|
2017-03-16 15:03:17 +01:00
|
|
|
->join('accounts', 'accounts.id', '=', 'account_gateways.account_id')
|
2016-11-24 10:22:37 +01:00
|
|
|
->where('account_gateways.account_id', '=', $accountId)
|
|
|
|
->whereNull('account_gateways.deleted_at');
|
2016-05-14 23:23:20 +02:00
|
|
|
|
2017-03-14 14:18:31 +01:00
|
|
|
return $query->select(
|
|
|
|
'account_gateways.id',
|
|
|
|
'account_gateways.public_id',
|
|
|
|
'gateways.name',
|
2017-03-16 21:56:13 +01:00
|
|
|
'gateways.name as gateway',
|
2017-03-14 14:18:31 +01:00
|
|
|
'account_gateways.deleted_at',
|
2017-03-16 15:03:17 +01:00
|
|
|
'account_gateways.gateway_id',
|
2017-03-26 09:37:32 +02:00
|
|
|
'accounts.gateway_fee_enabled');
|
2015-11-05 23:37:04 +01:00
|
|
|
}
|
|
|
|
}
|