增加 自动关闭工单
This commit is contained in:
parent
98757339a3
commit
0e0c2923db
@ -7,6 +7,7 @@
|
|||||||
use App\Console\Commands\SuspendUserAllHosts;
|
use App\Console\Commands\SuspendUserAllHosts;
|
||||||
use App\Console\Commands\UnbanUser;
|
use App\Console\Commands\UnbanUser;
|
||||||
use App\Console\Commands\UserAddBalance;
|
use App\Console\Commands\UserAddBalance;
|
||||||
|
use App\Jobs\AutoCloseWorkOrder;
|
||||||
use App\Jobs\CheckAndChargeBalance;
|
use App\Jobs\CheckAndChargeBalance;
|
||||||
use App\Jobs\HostCost;
|
use App\Jobs\HostCost;
|
||||||
use App\Jobs\ClearTasks;
|
use App\Jobs\ClearTasks;
|
||||||
@ -53,5 +54,7 @@ protected function schedule(Schedule $schedule)
|
|||||||
$schedule->job(new DeleteHost())->hourly();
|
$schedule->job(new DeleteHost())->hourly();
|
||||||
|
|
||||||
$schedule->job(new CheckAndChargeBalance())->hourly();
|
$schedule->job(new CheckAndChargeBalance())->hourly();
|
||||||
|
|
||||||
|
$schedule->job(new AutoCloseWorkOrder())->everyFiveMinutes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
app/Jobs/AutoCloseWorkOrder.php
Normal file
29
app/Jobs/AutoCloseWorkOrder.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use App\Models\WorkOrder\WorkOrder;
|
||||||
|
|
||||||
|
class AutoCloseWorkOrder extends Job
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new job instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the job.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
// closed replied after 1 days
|
||||||
|
WorkOrder::where('status', 'replied')->where('updated_at', '<=', now()->subDays(1))->update(['status' => 'closed']);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user