mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
fix up group transactions bulk purchase orders
This commit is contained in:
@@ -21,6 +21,13 @@ class GroupResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
dd($this->transactions()->whereHasMorph('owner', [Transaction::class], function($query){
|
||||
return $query->whereHas('booking', function($query){
|
||||
return $query->whereHas('transactions', function($query){
|
||||
return $query->where('type', TransactionType::PURCHASE_ORDER)->where('status', '=', ApprovalStatus::APPROVED);
|
||||
});
|
||||
});
|
||||
})->get());
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
|
||||
Reference in New Issue
Block a user