feat: Implement mail campaign feature with CRUD operations and email sending capabilities
This commit is contained in:
@@ -54,12 +54,25 @@ class OrderRepository extends BaseRepository implements OrderRepositoryInterface
|
||||
$model = $model->where("invoice_id", $data['invoice_id']);
|
||||
}
|
||||
}
|
||||
if (isset($data['status']) && ! empty($data['status']) && $data['status'] != 'full') {
|
||||
$model = $model->where("status", match ($data['status']) {
|
||||
if (isset($data['status']) && $data['status'] !== '' && $data['status'] !== null && $data['status'] != 'full') {
|
||||
$status = match ($data['status']) {
|
||||
'active' => 1,
|
||||
'pending' => 0,
|
||||
'processing' => 3,
|
||||
'cancel' => 2,
|
||||
default => $data['status'],
|
||||
};
|
||||
$model = $model->where("status", $status);
|
||||
}
|
||||
|
||||
if (isset($data['filter']) && $data['filter'] !== '') {
|
||||
$search = $data['filter'];
|
||||
$model = $model->where(function ($query) use ($search) {
|
||||
$query->where('order_num', 'like', "%{$search}%")
|
||||
->orWhereHas('customer', function ($query) use ($search) {
|
||||
$query->where('fullname', 'like', "%{$search}%")
|
||||
->orWhere('email', 'like', "%{$search}%");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user