TableQrcodeJob.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\activity;
  12. use app\services\activity\collage\UserCollageServices;
  13. use app\services\activity\table\TableQrcodeServices;
  14. use crmeb\basic\BaseJobs;
  15. use crmeb\traits\QueueTrait;
  16. use think\facade\Log;
  17. /**
  18. * 营销:桌码
  19. * Class TableQrcodeJob
  20. * @package app\jobs\activity
  21. */
  22. class TableQrcodeJob extends BaseJobs
  23. {
  24. use QueueTrait;
  25. /**
  26. * @param $oid
  27. * @param $orderInfo
  28. * @return bool|void
  29. */
  30. public function updateTableQrcode($oid, $orderInfo)
  31. {
  32. if (!$oid) {
  33. return true;
  34. }
  35. try {
  36. /** @var UserCollageServices $collageServices */
  37. $collageServices = app()->make(UserCollageServices::class);
  38. $TableCode = $collageServices->get($orderInfo['activity_id']);
  39. /** @var TableQrcodeServices $qrcodeService */
  40. $qrcodeService = app()->make(TableQrcodeServices::class);
  41. $qrcodeService->update($TableCode['qrcode_id'], ['is_use' => 0, 'eat_number' => 0, 'order_time' => 0]);
  42. } catch (\Throwable $e) {
  43. Log::error('处理桌码状态失败,失败原因:' . $e->getMessage());
  44. }
  45. return true;
  46. }
  47. }