正在显示
2 个修改的文件
包含
7 行增加
和
2 行删除
| @@ -113,7 +113,10 @@ class Client implements ClientInterface | @@ -113,7 +113,10 @@ class Client implements ClientInterface | ||
| 113 | ] + $pathQueryArray; | 113 | ] + $pathQueryArray; |
| 114 | $data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret')); | 114 | $data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret')); |
| 115 | $response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [ | 115 | $response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [ |
| 116 | - $key => $data | 116 | + $key => $data, |
| 117 | + RequestOptions::HEADERS => [ | ||
| 118 | + 'Content-Type' => 'application/json;charset=UTF-8', | ||
| 119 | + ] | ||
| 117 | ]); | 120 | ]); |
| 118 | 121 | ||
| 119 | return new Response($response); | 122 | return new Response($response); |
| @@ -310,7 +310,9 @@ class OrdersB2cAddRequest extends Request | @@ -310,7 +310,9 @@ class OrdersB2cAddRequest extends Request | ||
| 310 | */ | 310 | */ |
| 311 | public function appendOrderGoods($goods_id, $good_name, $price, $num, $dec_total, $deliveryItemId) | 311 | public function appendOrderGoods($goods_id, $good_name, $price, $num, $dec_total, $deliveryItemId) |
| 312 | { | 312 | { |
| 313 | - $item = ['index' => count($this->order_goods) + 1] + get_defined_vars(); | 313 | + $item = ['index' => count($this->order_goods) + 1] + array_filter(get_defined_vars(), function ($v) { |
| 314 | + return !(is_null($v) || $v === ''); | ||
| 315 | + }); | ||
| 314 | 316 | ||
| 315 | return parent::append('order_goods', count($this->order_goods), $item); | 317 | return parent::append('order_goods', count($this->order_goods), $item); |
| 316 | } | 318 | } |
-
请 注册 或 登录 后发表评论