CityDeliveryJob.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\jobs\order;
  12. use app\services\order\StoreDeliveryOrderServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 同城配送
  18. * Class CityDeliveryJob
  19. * @package app\jobs
  20. */
  21. class CityDeliveryJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * 同步创建、更新达达门店信息
  26. * @param $id
  27. * @param $is_new
  28. * @return bool
  29. */
  30. public function syncCityShop($id, $is_new)
  31. {
  32. try {
  33. /** @var StoreDeliveryOrderServices $deliveryOrderServices */
  34. $deliveryOrderServices = app()->make(StoreDeliveryOrderServices::class);
  35. $deliveryOrderServices->syncCityShop((int)$id);
  36. } catch (\Throwable $e) {
  37. Log::error('同步创建同城配送达达门店失败,原因:'. $e->getMessage());
  38. }
  39. return true;
  40. }
  41. }