AutoCommentOrderJob.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\StoreOrderCommentServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 自动执行默认好评
  18. * Class AutoCommentOrderJob
  19. * @package app\jobs\order
  20. */
  21. class AutoCommentOrderJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * @return string
  26. */
  27. protected static function queueName()
  28. {
  29. return 'CRMEB_PRO_TASK';
  30. }
  31. /**
  32. * @param $where
  33. * @param $page
  34. * @param $limit
  35. * @return bool
  36. */
  37. public function doJob($where, $page, $limit)
  38. {
  39. try {
  40. /** @var StoreOrderCommentServices $service */
  41. $service = app()->make(StoreOrderCommentServices::class);
  42. return $service->runAutoCommentOrder($where, $page, $limit);
  43. } catch (\Throwable $e) {
  44. Log::error('自动默认好评,失败原因:[' . class_basename($this) . ']' . $e->getMessage());
  45. }
  46. }
  47. }