ClearMerchantStoreJob.php 582 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace ln\jobs;
  3. use app\common\repositories\store\product\ProductRepository;
  4. use ln\interfaces\JobInterface;
  5. use think\facade\Log;
  6. class ClearMerchantStoreJob implements JobInterface
  7. {
  8. public function fire($job, $data)
  9. {
  10. try{
  11. app()->make(ProductRepository::class)->clearMerchantProduct($data['mer_id']);
  12. }catch (\Exception $e){
  13. Log::info('商户ID:'.$data['mer_id'].'清除出错');
  14. }
  15. $job->delete();
  16. }
  17. public function failed($data)
  18. {
  19. // TODO: Implement failed() method.
  20. }
  21. }