fix account statement mapping issue

This commit is contained in:
JiaSheng
2023-09-14 14:59:02 +08:00
parent fbf097eb62
commit c55a8e7af9
2 changed files with 22 additions and 2 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class PaymentMethodNotIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereNotIn('payment_method', $value);
}
}
@@ -26,7 +26,7 @@ class MappableTransactionResource extends JsonResource
$reference = $this->owner->owner->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
}
if($this->type === TransactionType::PAYMENT && $this->owner !== Wallet::class){
if($this->type === TransactionType::PAYMENT && $this->owner_type !== Wallet::class){
$reference = $this->owner->owner->owner->reference;
}
@@ -34,7 +34,7 @@ class MappableTransactionResource extends JsonResource
'status' => 'success',
'system' => 'SHIPPING_PORTAL',
'type' => $this->type,
'owner_type' => $this->owner_type,
'owner_type' => Transaction::class,
'owner_id'=> $this->id,
'owner_reference'=> $reference,
];