// +---------------------------------------------------------------------- namespace crmeb\jobs; use app\common\repositories\store\coupon\StoreCouponRepository; use app\common\repositories\store\coupon\StoreCouponUserRepository; use app\common\repositories\system\CacheRepository; use app\common\repositories\user\UserRepository; use crmeb\interfaces\JobInterface; use think\facade\Cache; use think\facade\Log; use think\facade\Queue; class SendSvipCouponJob implements JobInterface { public function fire($job, $type) { $moth = date('Y-m-d',time()); $meka = app()->make(StoreCouponRepository::class); try { $couponIds = $meka->sendSvipCoupon(); } catch (\Exception $e) { Log::INFO('发送付费会员优惠券失败:'.$moth); }; $job->delete(); } public function failed($data) { // TODO: Implement failed() method. } }