Code Duplication    Length = 14-16 lines in 2 locations

src/API/GroupsApi.php 2 locations

@@ 56-69 (lines=14) @@
53
     *
54
     * @return int.
55
     */
56
    public function getid($openid)
57
    {
58
        if (!$openid) {
59
            $this->setError('参数错误,缺少Openid');
60
61
            return false;
62
        }
63
64
        $queryStr = ['openid' => $openid];
65
66
        $res = $this->_post('getid', $queryStr);
67
68
        return $res;
69
    }
70
71
    /**
72
     *  修改分组名
@@ 102-117 (lines=16) @@
99
     *
100
     * @return bool. 注:删除成功时返回的是 '' ,删除失败时返回的是false,(包括分组ID不是数字或分组ID已经不存在)
101
     */
102
    public function delete($id)
103
    {
104
        if (!is_numeric($id)) {
105
            $this->setError('参数错误,分组ID不是数字');
106
107
            return false;
108
        }
109
110
        $queryStr = [
111
            'group' => ['id' => $id],
112
        ];
113
114
        $res = $this->_post('delete', $queryStr);
115
116
        return $res;
117
    }
118
119
    /**
120
     *  移动用户到指定分组