/** * [设备解绑] * @return [type] [description] */ public function unbindAction() { $uid = $this->di['providerInfo'][$this->_sanReq['appid']]['u_id']; //查看宝贝和厂商的关系 $this->_oauthrity($uid, $this->_sanReq['baby_id']); if ($this->devices->delDevice(Common::authcode(base64_decode($this->_sanReq['shoe_code']), 'DECODE', $this->di['providerInfo'][$this->_sanReq['appid']]['encode_key']), $this->_sanReq['baby_id'], $uid) === 1) { $this->_showMsg(self::SUCCESS); } else { $this->_showMsg(self::FAILED_UNBIND, $this->di['flagmsg'][self::FAILED_UNBIND]); } }
/** * [获取宝贝所有的设备信息] * @param [type] $babyId [description] * @return [type] [description] */ public function getInfoByBabyId($babyId, $key) { $devInfo = $this->devices->getInfoByBabyId($babyId); if (!empty($devInfo)) { foreach ($devInfo as $k => $val) { $devInfo[$k]['shoe_code'] = base64_encode(Common::authcode($val['dev_uuid'], 'ENCODE', $key)); unset($devInfo[$k]['dev_uuid']); } } return $devInfo; }