| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace wechat\models;
- use Yii;
- class GroupApi extends BaseApi
- {
- public $apiUrl = 'group';
- /**
- * @param array $data
- * @return array
- */
- public function getList($data)
- {
- $result = $this->post($this->apiUrl . '/list', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
-
- /**
- * @param array $data
- * @return array
- */
- public function getCurrentGroup($data)
- {
- $result = $this->post($this->apiUrl . '/get-current-group', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
-
- /**
- * @param array $data
- * @return array
- */
- public function save($data)
- {
- $result = $this->post($this->apiUrl . '/save', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
-
- /**
- * @param array $data
- * @return array
- */
- public function getGroupById($data)
- {
- $result = $this->post($this->apiUrl . '/get-group-by-id', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
-
- /**
- * @param array $data
- * @return array
- */
- public function deleteGroup($data)
- {
- $result = $this->post($this->apiUrl . '/delete', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], $result['message']);
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
- }
|