CityDeliveryController.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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\controller\api\v1;
  12. use app\Request;
  13. use app\services\order\StoreDeliveryOrderServices;
  14. use \think\facade\Log;
  15. /**
  16. * 同城配送相关回调
  17. * Class CityDeliveryController
  18. * @package app\controller\api\v1
  19. */
  20. class CityDeliveryController
  21. {
  22. /**
  23. * @return bool
  24. */
  25. public function notify(Request $request)
  26. {
  27. try {
  28. $params = $request->param();
  29. /** @var StoreDeliveryOrderServices $storeDeliveryOrderServices */
  30. $storeDeliveryOrderServices = app()->make(StoreDeliveryOrderServices::class);
  31. $storeDeliveryOrderServices->notify($params);
  32. return true;
  33. } catch (\Throwable $e) {
  34. Log::info('同城配送订单回调失败:' . var_export([$e->getMessage(), $e->getFile() . ':' . $e->getLine()], true));
  35. return false;
  36. }
  37. }
  38. }