StoreFinanceJob.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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\store;
  12. use app\services\store\finance\StoreFinanceFlowServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 门店资金流水记录
  18. * Class StoreFinanceJob
  19. * @package app\jobs
  20. */
  21. class StoreFinanceJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * 门店流水
  26. * @param array $order
  27. * @param int $type
  28. * @param int $price
  29. * @return bool
  30. */
  31. public function doJob(array $order, int $type, $price = 0)
  32. {
  33. try {
  34. /** @var StoreFinanceFlowServices $storeFinanceFlowServices */
  35. $storeFinanceFlowServices = app()->make(StoreFinanceFlowServices::class);
  36. $storeFinanceFlowServices->setFinance($order, $type, $price);
  37. } catch (\Throwable $e) {
  38. Log::error('记录流水失败:' . $e->getMessage());
  39. }
  40. return true;
  41. }
  42. }