1234567891011121314151617181920212223242526272829 |
- <?php
- namespace crmeb\jobs;
- use crmeb\interfaces\JobInterface;
- use think\facade\Db;
- use think\queue\Job;
- use app\models\store\StorePink;
- class AutoJob implements JobInterface
- {
- public function fire(Job $job, $data): void
- {
- if($this->doDefaultJod($data))
- $job->delete();
- else {
- if ($job->attempts() > 3)
- $job->delete();
- }
- }
- public function doDefaultJod($data): bool
- {
- try {
- @file_put_contents('cvcc.txt',json_encode($data['data']));
- StorePink::autoPink($data['data']);
- } catch (\Throwable $e) {
- }
- return true;
- }
- }
|