StockController.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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\erp;
  12. use app\jobs\product\ProductSyncErp;
  13. use app\Request;
  14. use think\Response;
  15. use \think\facade\Log;
  16. class StockController
  17. {
  18. /**
  19. * 库存回调
  20. * @param Request $request
  21. * @return void
  22. */
  23. public function stockCallback(Request $request)
  24. {
  25. [$datas] = $request->postMore([
  26. ['datas', []]
  27. ], true);
  28. Log::info(['data' => json_encode($datas), 'type' => 'stockCallback']);
  29. if (sys_config('erp_open')) {
  30. ProductSyncErp::dispatchDo('updatePlatformStock', [$datas]);
  31. }
  32. return Response::create(['code' => "0", "msg" => "执行成功"], "json");
  33. }
  34. }