update(['pdf_src' => '']); array_map('unlink', glob(runtime_path('pdf/*.pdf'))); array_map('unlink', glob(public_path('pdf/*.pdf'))); Log::info('send follow end',[time()]); }); // 每三个小时自动归档 new Crontab('0 25 */3 * * *', function(){ Db::table('used_car') ->where('status', 1) ->where('created_at', '<', time() - (86400*15)) ->update(['status' => 3]); }); if (getenv('ENVIRONMENT') === 'master') { // 每三个小时自动归档 new Crontab('0 0 3 * * *', function(){ $sites = WordpressSite::where('status', 1) ->get(); foreach ($sites as $site) { $used_car_id = WordpressUsedCar::where('wp_site_id', $site['id']) ->where('status', 1) ->max('used_car_id'); $used_cars = Db::table('used_car') ->where('id', '>', $used_car_id) ->get(); foreach ($used_cars as $car) { WordpressSiteService::createProduct($site['site_url'], $car['id']); } } }); } } }