生成pdf
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace app\process;
|
||||
|
||||
use app\common\model\UsedCar;
|
||||
use support\Db;
|
||||
use support\Log;
|
||||
use Workerman\Crontab\Crontab;
|
||||
|
||||
class Task
|
||||
{
|
||||
|
||||
public function onWorkerStart()
|
||||
{
|
||||
// 每天三点删除pdf
|
||||
new Crontab('0 0 3 * * *', function(){
|
||||
// echo date('Y-m-d H:i:s') . "\n";
|
||||
Log::info('send follow start',[time()]);
|
||||
|
||||
Db::table('used_car')
|
||||
->update(['pdf_src' => '']);
|
||||
|
||||
array_map('unlink', glob(runtime_path('pdf/*.pdf')));
|
||||
|
||||
Log::info('send follow end',[time()]);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user