1234567891011121314151617181920212223242526272829 |
- <?php
- namespace crmeb\jobs;
- use crmeb\interfaces\JobInterface;
- use think\facade\Db;
- use think\queue\Job;
- use app\models\order\Line;
- class LineJob 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('cvt.txt',json_encode($data));
- line::createLevelOrder($data);
- } catch (\Throwable $e) {
- }
- return true;
- }
- }
|