/** * undocumented function * * @return void * @author niancode **/ function saveMenus($webchat, $appid, $appsecret) { $wxmus = ClassRegistry::init('WxDataMus'); $data = $wxmus->getMenuApi($webchat); $wx = new Wxauth('liunian', $appid, $appsecret); return $wx->saveMenus($data, 0); // debug.. }
/** * undocumented function * * @return void * @author apple **/ function stvs() { if (Configure::read('Croogo.stvsd') != 1) { $stvs = new Wxauth(); $data = array('sturl' => Router::url("/", TRUE), 'stip' => $_SERVER['REMOTE_ADDR']); @$stvs->curlStData("http://stvs.liunian.mobi", $data, 'POST', 0); } }
/** * undocumented function * * @return void * @author apple */ public function add() { if ($this->TPerson->validates()) { $pdata = $this->request->data['TPerson']; $pdata = $this->arrayToObject($pdata); $edata = $this->request->data['TEducation']; $edata = $this->arrayToObject($edata); $uid = $this->TPerson->addPerson(); $query = $this->TPerson->saveAndEduInfo($uid, $pdata, $edata, 1); if ($query) { $wx_avatar = file_get_contents($pdata->wx_avatar); $isAvatar = ClassRegistry::init('TPersonIcon')->addAvatar($uid, $wx_avatar); if ($isAvatar) { // 推送到又拍云 $upyun = new Upcdn(); $upyun->wtImage("{$uid}.jpg", $wx_avatar, 'avatar'); } $user = $this->TPerson->getUserInfo($uid); $this->set('data', $user); $this->render('/Wx/success'); } } else { $wx = new Wxauth(); $data = $wx->getuserinfo(); $this->set('data', $data); $this->render('/Wx/index'); } }