Completed
Pull Request — master (#1565)
by milkmeowo
03:58
created

DataCubeClient::userBehavior()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the overtrue/wechat.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EasyWeChat\Work\ExternalContact;
13
14
use EasyWeChat\Kernel\BaseClient;
15
16
/**
17
 * Class DataCubeClient.
18
 *
19
 * @author milkmeowo <[email protected]>
20
 */
21
class DataCubeClient extends BaseClient
22
{
23
    /**
24
     * 获取员工行为数据.
25
     *
26
     * @see https://work.weixin.qq.com/api/doc#90000/90135/91580
27
     *
28
     * @param array  $userIds
29
     * @param string $from
30
     * @param string $to
31
     *
32
     * @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
33
     *
34
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
35
     */
36 1
    public function userBehavior(array $userIds, string $from, string $to)
37
    {
38
        $params = [
39 1
            'userid' => $userIds,
40 1
            'start_time' => $from,
41 1
            'end_time' => $to,
42
        ];
43
44 1
        return $this->httpPostJson('cgi-bin/externalcontact/get_user_behavior_data', $params);
45
    }
46
}
47