Skip to content

Commit 12759d4

Browse files
authored
Merge pull request #12 from kbblank/master
增加“配置设备与其他公众账号门店的关联关系”接口
2 parents 8b1fcd1 + 2aff9e9 commit 12759d4

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

Wechat/WechatDevice.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function applyShakeAroundDevice($data) {
5050
return false;
5151
}
5252

53-
/**
53+
/**
5454
* 查询设备ID申请审核状态
5555
* @param int $apply_id
5656
* @return bool|array
@@ -154,6 +154,31 @@ public function bindLocationShakeAroundDevice($device_id, $poi_id, $uuid = '', $
154154
}
155155
return false;
156156
}
157+
158+
/**
159+
* 配置设备与其他公众账号门店的关联关系
160+
* @param type $device_identifier 设备信息
161+
* @param type $poi_id 待关联的门店ID
162+
* @param type $poi_appid 目标微信appid
163+
* @return boolean
164+
*/
165+
public function bindLocationOtherShakeAroundDevice($device_identifier,$poi_id,$poi_appid) {
166+
if (!$this->access_token && !$this->getAccessToken()) {
167+
return false;
168+
}
169+
$data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id,"type"=>2,"poi_appid"=>$poi_appid);
170+
$result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data));
171+
if ($result) {
172+
$json = json_decode($result, true);
173+
if (!$json || !empty($json['errcode'])) {
174+
$this->errCode = $json['errcode'];
175+
$this->errMsg = $json['errmsg'];
176+
return $this->checkRetry(__FUNCTION__, func_get_args());
177+
}
178+
return $json; //这个可以更改为返回true
179+
}
180+
return false;
181+
}
157182

158183
/**
159184
* 配置设备与页面的关联关系

0 commit comments

Comments
 (0)