mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
update transaction export
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Booking;
|
||||
use App\Models\Company;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Wallet;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
@@ -59,11 +60,20 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping
|
||||
6 => 'EXPIRED'
|
||||
];
|
||||
|
||||
$booking = $transaction->type === 1 ? $transaction->owner : $transaction->owner->owner;
|
||||
$booking = null;
|
||||
|
||||
if($transaction->owner_type === Booking::class){
|
||||
$booking = $transaction->owner;
|
||||
}
|
||||
|
||||
if($transaction->owner_type === Transaction::class){
|
||||
$booking = $transaction->owner->owner;
|
||||
}
|
||||
|
||||
|
||||
return [
|
||||
($booking instanceof Booking) ? $booking->company->reference : '',
|
||||
($booking instanceof Booking) ? $booking->marking : '',
|
||||
$booking ? $booking->company->reference : '',
|
||||
$booking ? $booking->marking : '',
|
||||
$transaction->bill_no,
|
||||
$transaction->owner_id,
|
||||
$transaction->owner_type,
|
||||
|
||||
Reference in New Issue
Block a user