mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
show group-transaction-with-completed-payments
This commit is contained in:
@@ -84,4 +84,12 @@ class Group extends Model implements Documentable, Transactionable
|
|||||||
{
|
{
|
||||||
return $this->BelongsTo(Currency::class, 'original_currency_id', 'id');
|
return $this->BelongsTo(Currency::class, 'original_currency_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return hasOne
|
||||||
|
*/
|
||||||
|
public function payment()
|
||||||
|
{
|
||||||
|
return $this->hasOne(Transaction::class, 'payment_reference', 'reference');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ use Carbon\Carbon;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Crypt;
|
use Illuminate\Support\Facades\Crypt;
|
||||||
use App\Models\Container;
|
use App\Models\Container;
|
||||||
|
use App\Models\Group;
|
||||||
use App\Models\Transaction;
|
use App\Models\Transaction;
|
||||||
use App\Models\Wallet;
|
use App\Models\Wallet;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -1315,3 +1316,14 @@ Route::get('/show-all-extra-payments', function () {
|
|||||||
Route::get('/segments', function (Request $request) {
|
Route::get('/segments', function (Request $request) {
|
||||||
return view('pages.segments.index');
|
return view('pages.segments.index');
|
||||||
})->name('segments');
|
})->name('segments');
|
||||||
|
|
||||||
|
Route::get('/group-transaction-with-completed-payments', function () {
|
||||||
|
$groups = Group::whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||||
|
->whereHas('payment', function ($query) {
|
||||||
|
$query->whereIn('status', [2, 3]);
|
||||||
|
})->get();
|
||||||
|
|
||||||
|
foreach ($groups as $group) {
|
||||||
|
dump($group->groupTransactions->first()->transaction->owner->owner->reference);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user