Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04594afae6 | ||
|
|
1a8016ae13 |
3 changed files with 12 additions and 2 deletions
|
|
@ -6,13 +6,21 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method static self new()
|
* @method static self new()
|
||||||
|
* Nouveau ticket
|
||||||
* @method static self estimateTodo()
|
* @method static self estimateTodo()
|
||||||
|
* Devis à faire.
|
||||||
* @method static self takenInAccount()
|
* @method static self takenInAccount()
|
||||||
|
* Nouveau ticket à été pris en charge
|
||||||
* @method static self waiting()
|
* @method static self waiting()
|
||||||
|
* On attend que le client réponde dans le ticket
|
||||||
* @method static self waitingValidation()
|
* @method static self waitingValidation()
|
||||||
|
* On attend que le client valide l'estimation
|
||||||
* @method static self recette()
|
* @method static self recette()
|
||||||
|
* Est mis en recette
|
||||||
* @method static self production()
|
* @method static self production()
|
||||||
|
* Est mis en production
|
||||||
* @method static self archived()
|
* @method static self archived()
|
||||||
|
* Ticket fermé
|
||||||
*/
|
*/
|
||||||
class TicketStatus extends BaseEnumRoutable
|
class TicketStatus extends BaseEnumRoutable
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ class AutoCloseOldTickets
|
||||||
$message = 'En l\'absence d\'activitée depuis 15 jours ce ticket est automatiquement clos et archivé.';
|
$message = 'En l\'absence d\'activitée depuis 15 jours ce ticket est automatiquement clos et archivé.';
|
||||||
$tickets = Ticket::where(function ($q) {
|
$tickets = Ticket::where(function ($q) {
|
||||||
$q->where('status', TicketStatus::production())
|
$q->where('status', TicketStatus::production())
|
||||||
->orWhere('status', TicketStatus::processed());
|
->orWhere('status', TicketStatus::waitingValidation())
|
||||||
|
->orWhere('status', TicketStatus::waiting());
|
||||||
})->whereDate('updated_at', '<=', Carbon::now()->subDays($limitDays))
|
})->whereDate('updated_at', '<=', Carbon::now()->subDays($limitDays))
|
||||||
->whereDoesntHave('messages', function ($q) use ($limitDays) {
|
->whereDoesntHave('messages', function ($q) use ($limitDays) {
|
||||||
$q->whereDate('updated_at', '>', Carbon::now()->subDays($limitDays));
|
$q->whereDate('updated_at', '>', Carbon::now()->subDays($limitDays));
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ class WarnBeforeAutoCloseTicket
|
||||||
$messageToUser = 'En l\'absence d\'activitée, ou de réponse de votre part ce ticket sera automatiquement clos et archivé dans %s jours.';
|
$messageToUser = 'En l\'absence d\'activitée, ou de réponse de votre part ce ticket sera automatiquement clos et archivé dans %s jours.';
|
||||||
$tickets = Ticket::where(function ($q) {
|
$tickets = Ticket::where(function ($q) {
|
||||||
$q->where('status', TicketStatus::production())
|
$q->where('status', TicketStatus::production())
|
||||||
->orWhere('status', TicketStatus::processed());
|
->orWhere('status', TicketStatus::waitingValidation())
|
||||||
|
->orWhere('status', TicketStatus::waiting());
|
||||||
})->whereDate('updated_at', '<=', Carbon::now()->subDays($warningDays))
|
})->whereDate('updated_at', '<=', Carbon::now()->subDays($warningDays))
|
||||||
->whereDoesntHave('messages', function ($q) use ($warningDays) {
|
->whereDoesntHave('messages', function ($q) use ($warningDays) {
|
||||||
$q->whereDate('updated_at', '>', Carbon::now()->subDays($warningDays));
|
$q->whereDate('updated_at', '>', Carbon::now()->subDays($warningDays));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue