Crm.php 935 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Tool\MayouTool\Crm;
  3. use Tool\MayouTool\Bean\Crm\TaobaoBatchSendParamBean;
  4. use Tool\MayouTool\Exception\CrmException;
  5. use Tool\MayouTool\HttpCurl;
  6. class Crm
  7. {
  8. /**
  9. * 淘宝批量发货接口
  10. * @param $data
  11. */
  12. public static function taobaoBatchSend(TaobaoBatchSendParamBean $taobaoBatchSendParamBean)
  13. {
  14. $url = "v1/taobao/batchSendProduct";
  15. $params = [
  16. "orderNumber"=>$taobaoBatchSendParamBean->getOrderNumber(),
  17. "sellerNick"=>$taobaoBatchSendParamBean->getSellerNick(),
  18. "expressNumber"=>$taobaoBatchSendParamBean->getExpressNumber(),
  19. "expressCode"=>$taobaoBatchSendParamBean->getExpressCode()
  20. ];
  21. $res = HttpCurl::postCurl(env("CRM_URL").$url,$params,[],false);
  22. if(isset($res["status"])&&$res["status"]){
  23. return $res["data"];
  24. }
  25. throw new CrmException("请求失败");
  26. }
  27. }