uncancelled
This commit is contained in:
parent
96d82f942e
commit
3fc93b725b
@ -208,7 +208,7 @@ class FlowPoolController extends Controller
|
||||
'company_id' => $flowPool->company_id,
|
||||
'package_id' => $package_ids,
|
||||
'unit_price' => 0,
|
||||
'card_status' => 2,
|
||||
'uncancelled' => 1,
|
||||
];
|
||||
|
||||
$cards = $repository->skipCache()->select([
|
||||
|
@ -218,6 +218,13 @@ trait OrderCardConcern
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($conditions['uncancelled'])) {
|
||||
$date = isset($conditions['month']) ? Carbon::parse($conditions['month'])->copy()->startOfMonth() : date('Y-m-d H:i:s');
|
||||
$this->model = $this->model->whereHas('card', function ($relation) use ($date) {
|
||||
$relation->whereNull('cancelled_at')->orWhere('cancelled_at', "<", $date);
|
||||
});
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class FlowPoolService extends Service
|
||||
'company_id' => $company_ids,
|
||||
'package_id' => $package_ids,
|
||||
'unit_price' => 0,
|
||||
'card_status' => 2,
|
||||
'uncancelled' => 1,
|
||||
];
|
||||
|
||||
$cards = app(OrderCardPartitionRepository::class)->skipCache()->select([
|
||||
@ -455,7 +455,7 @@ class FlowPoolService extends Service
|
||||
'company_id' => $flowPool->company_id,
|
||||
'package_id' => array_keys($settings),
|
||||
'unit_price' => 0,
|
||||
'card_status' => 2,
|
||||
'uncancelled' => 1,
|
||||
];
|
||||
|
||||
$cards = app(OrderCardPartitionRepository::class)->skipCache()->selectRaw('distinct sim as sim, package_id')->withConditions($cardConditions)->get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user