Files
journal/application/api/job/imgFile.php
wangjinlei 9f27e8e054 1
2022-11-25 11:00:09 +08:00

42 lines
1006 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace app\api\job;
use think\queue\Job;
class imgFile {
//put your code here
public function fire(Job $job, $data) {
$this->send($data);
$job->delete();
// if($res){
// $job->delete();
// }else{
// if($job->attempts()>3){
// // 第1种处理方式重新发布任务,该任务延迟10秒后再执行
// //$job->release(10);
// // 第2种处理方式原任务的基础上1分钟执行一次并增加尝试次数
// //$job->failed();
// // 第3种处理方式删除任务
// $job->delete();
// }
// }
}
/**
* 保存图片逻辑
* @param type $data
*/
public function send($data){
$res = file_put_contents($data['mubiao'], file_get_contents($data['yum']));
if($res){
return true;
}else{
return false;
}
}
}