SynchStocksJob.php 625 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\jobs\store;
  3. use app\services\product\branch\StoreBranchProductServices;
  4. use crmeb\basic\BaseJobs;
  5. use crmeb\traits\QueueTrait;
  6. /**
  7. * 门店同步库存队列
  8. * Class SynchStocksJob
  9. * @package app\jobs\store
  10. */
  11. class SynchStocksJob extends BaseJobs
  12. {
  13. use QueueTrait;
  14. public function doJob($ids, $storeId)
  15. {
  16. try {
  17. /** @var StoreBranchProductServices $services */
  18. $services = app()->make(StoreBranchProductServices::class);
  19. $services->synchStocks($ids, (int)$storeId);
  20. } catch (\Throwable $e) {
  21. }
  22. return true;
  23. }
  24. }