LogisticsTaskController.php 646 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace addons\WangDianTong\console\controllers;
  3. use addons\WangDianTong\common\service\LogisticsSyncQueryService;
  4. use common\helpers\FormatHelper;
  5. use yii\console\Controller;
  6. use yii\console\ExitCode;
  7. class LogisticsTaskController extends Controller
  8. {
  9. /**
  10. * 同步发货订单
  11. * @return int
  12. */
  13. public function actionSync(): int
  14. {
  15. try {
  16. // 执行
  17. (new LogisticsSyncQueryService())->sync();
  18. return ExitCode::OK;
  19. } catch (\Exception $e) {
  20. FormatHelper::exception($e, __CLASS__);
  21. return ExitCode::UNSPECIFIED_ERROR;
  22. }
  23. }
  24. }