@@ -17,6 +17,7 @@ class WechatDevice extends Common {
1717 const SHAKEAROUND_DEVICE_UPDATE = '/shakearound/device/update? ' ; //编辑设备信息
1818 const SHAKEAROUND_DEVICE_SEARCH = '/shakearound/device/search? ' ; //查询设备列表
1919 const SHAKEAROUND_DEVICE_BINDLOCATION = '/shakearound/device/bindlocation? ' ; //配置设备与门店ID的关系
20+ const SHAKEAROUND_DEVICE_BINDLOCATION_OTHER = '/shakearound/device/bindlocation? ' ; //配置设备与其他公众账号门店的关联关系
2021 const SHAKEAROUND_DEVICE_BINDPAGE = '/shakearound/device/bindpage? ' ; //配置设备与页面的绑定关系
2122 const SHAKEAROUND_MATERIAL_ADD = '/shakearound/material/add? ' ; //上传摇一摇图片素材
2223 const SHAKEAROUND_PAGE_ADD = '/shakearound/page/add? ' ; //增加页面
@@ -50,7 +51,7 @@ public function applyShakeAroundDevice($data) {
5051 return false ;
5152 }
5253
53- /**
54+ /**
5455 * 查询设备ID申请审核状态
5556 * @param int $apply_id
5657 * @return bool|array
@@ -154,6 +155,31 @@ public function bindLocationShakeAroundDevice($device_id, $poi_id, $uuid = '', $
154155 }
155156 return false ;
156157 }
158+
159+ /**
160+ * 配置设备与其他公众账号门店的关联关系
161+ * @param type $device_identifier 设备信息
162+ * @param type $poi_id 待关联的门店ID
163+ * @param type $poi_appid 目标微信appid
164+ * @return boolean
165+ */
166+ public function bindLocationOtherShakeAroundDevice ($ device_identifier ,$ poi_id ,$ poi_appid ) {
167+ if (!$ this ->access_token && !$ this ->getAccessToken ()) {
168+ return false ;
169+ }
170+ $ data = array ('device_identifier ' => $ device_identifier , 'poi_id ' => $ poi_id ,"type " =>2 ,"poi_appid " =>$ poi_appid );
171+ $ result = Tools::httpPost (self ::API_BASE_URL_PREFIX . self ::SHAKEAROUND_DEVICE_BINDLOCATION_OTHER . "access_token= {$ this ->access_token }" , Tools::json_encode ($ data ));
172+ if ($ result ) {
173+ $ json = json_decode ($ result , true );
174+ if (!$ json || !empty ($ json ['errcode ' ])) {
175+ $ this ->errCode = $ json ['errcode ' ];
176+ $ this ->errMsg = $ json ['errmsg ' ];
177+ return $ this ->checkRetry (__FUNCTION__ , func_get_args ());
178+ }
179+ return $ json ; //这个可以更改为返回true
180+ }
181+ return false ;
182+ }
157183
158184 /**
159185 * 配置设备与页面的关联关系
0 commit comments