<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Schedule; use Illuminate\Support\Facades\Log; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\TimeUtil; use ModStart\Data\AbstractDataStorage; use ModStart\Data\DataManager; use Module\Vendor\Provider\Schedule\AbstractScheduleBiz; class DataTempCleanScheduleBiz extends AbstractScheduleBiz { public function cron() { return $this->cronEveryHour(); } public function title() { return 'data_temp 文件自动清理'; } public function run() { $ZArCf = ModelUtil::model('data_temp')->where('created_at', '<', date('Y-m-d H:i:s', time() - TimeUtil::PERIOD_DAY))->limit(100)->get(array('category', 'path'))->toArray(); foreach ($ZArCf as $lLaeU) { goto pYoHQ; pYoHQ: $REzBr = AbstractDataStorage::DATA_TEMP . '/' . $lLaeU['category'] . '/' . $lLaeU['path']; goto xXgud; L5t4d: Log::info('Vendor.DataTempCleanScheduleBiz - ' . $REzBr . ' deleted'); goto RDzpA; xXgud: try { DataManager::deleteDataTempByPath($REzBr); } catch (\Exception $qoTNG) { print_r($qoTNG->getMessage()); die('asdf'); } goto L5t4d; RDzpA: } } }