Code Duplication    Length = 14-17 lines in 4 locations

src/API/GroupsApi.php 1 location

@@ 149-162 (lines=14) @@
146
     *
147
     * @return bool. 注:其中批量移动时,其中有一个用户的id是错的,那么其他的也不会移动,若用户已经在目标组里那么返回值也是true
148
     */
149
    public function MoveUserlistGroup($openid_list, $to_groupid)
150
    {
151
        if (!is_array($openid_list)) {
152
            $this->setError('参数必须为一个数组');
153
154
            return false;
155
        }
156
157
        $queryStr = ['openid_list' => $openid_list, 'to_groupid' => $to_groupid];
158
159
        $res = $this->_post('members/batchupdate', $queryStr);
160
161
        return $res;
162
    }
163
}
164

src/API/MaterialApi.php 1 location

@@ 47-60 (lines=14) @@
44
     *
45
     * @return string.  成功返回mediaid
46
     */
47
    public function addNews($info)
48
    {
49
        if (!is_array($info)) {
50
            $this->setError('参数错误');
51
52
            return false;
53
        }
54
55
        $data = ['articles' => $info];
56
57
        $res = $this->_post('add_news', $data);
58
59
        return $res;
60
    }
61
62
    /**
63
     *  新增永久素材.

src/API/TagsApi.php 2 locations

@@ 114-130 (lines=17) @@
111
     *
112
     * @return array|bool
113
     */
114
    public function setUsersTag($tagid, array $openid_list)
115
    {
116
        if (!is_array($openid_list)) {
117
            $this->setError('参数必须为一个数组');
118
119
            return false;
120
        }
121
122
        $queryStr = [
123
            'openid_list' => $openid_list,
124
            'tagid'       => $tagid,
125
        ];
126
127
        $res = $this->_post('members/batchtagging', $queryStr);
128
129
        return $res;
130
    }
131
132
    /**
133
     * 批量为用户取消标签
@@ 143-159 (lines=17) @@
140
     *
141
     * @return array|bool
142
     */
143
    public function unsetUsersTag($tagid, array $openid_list)
144
    {
145
        if (!is_array($openid_list)) {
146
            $this->setError('参数必须为一个数组');
147
148
            return false;
149
        }
150
151
        $queryStr = [
152
            'openid_list' => $openid_list,
153
            'tagid'       => $tagid,
154
        ];
155
156
        $res = $this->_post('members/batchuntagging', $queryStr);
157
158
        return $res;
159
    }
160
161
    /**
162
     * 获取用户身上的标签列表