Client   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 66
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getByIds() 0 8 1
A get() 0 9 1
A getIds() 0 9 1
1
<?php
2
3
namespace CloudyCity\UCMarketingSDK\Order;
4
5
use CloudyCity\UCMarketingSDK\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 根据订单id获取订单.
11
     *
12
     * @param array $orderIds
13
     *
14
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
15
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
16
     * @throws \GuzzleHttp\Exception\GuzzleException
17
     *
18
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
19
     */
20
    public function getByIds(array $orderIds)
21
    {
22
        $params = [
23
            'orderIds' => $orderIds,
24
        ];
25
26
        return $this->httpPostJson('goodsorder/getOrderByOrderId', $params);
27
    }
28
29
    /**
30
     * 获取指定日期内的订单.
31
     *
32
     * @param string $startDate
33
     * @param string $endDate
34
     *
35
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
36
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
37
     * @throws \GuzzleHttp\Exception\GuzzleException
38
     *
39
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
40
     */
41
    public function get($startDate, $endDate)
42
    {
43
        $params = [
44
            'startDate' => $startDate,
45
            'endDate'   => $endDate,
46
        ];
47
48
        return $this->httpPostJson('goodsorder/getAllOrder', $params);
49
    }
50
51
    /**
52
     * 获取指定日期内的订单Id.
53
     *
54
     * @param string $startDate
55
     * @param string $endDate
56
     *
57
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\ApiException
58
     * @throws \CloudyCity\UCMarketingSDK\Kernel\Exceptions\InvalidArgumentException
59
     * @throws \GuzzleHttp\Exception\GuzzleException
60
     *
61
     * @return array|\Doctrine\Common\Collections\ArrayCollection|object|\Psr\Http\Message\ResponseInterface|string
62
     */
63
    public function getIds($startDate, $endDate)
64
    {
65
        $params = [
66
            'startDate' => $startDate,
67
            'endDate'   => $endDate,
68
        ];
69
70
        return $this->httpPostJson('goodsorder/getAllOrderId', $params);
71
    }
72
}
73