问题描述
- 帮我分析一下这个代码
-
帮我分析一下这个代码,为什么输入正确密码,在ios上提示成功,在安卓却提示失败,但又要执行数据写入呢?
public function doMobileduijiangaward() {
//关健词触发页面显示。
global $_GPC,$_W;
$weid = $_W['weid'];//当前公众号ID$rid = $_GPC['rid'];
$shouquan = $_GPC['shouquan'];
$from_user_oauth2 = $_COOKIE["user_oauth2_openid"];
$page_from_user_oauth2 = base64_encode(authcode($_COOKIE["user_oauth2_openid"], 'ENCODE'));
$this->checkoauth2($rid,$from_user_oauth2);//查询是否有cookie信息
$giftid = $_GPC['giftid'];
$pass = $_GPC['awardpass'];//兑奖密码
//if($shouquan==base64_encode($_SERVER ['HTTP_HOST'].'anquan_ma_grabgifts')){
$userinfo = pdo_fetch('SELECT * FROM '.tablename($this->table_list).' WHERE from_user=:from_user', array(':from_user' => $from_user_oauth2));
$gift = pdo_fetch('SELECT awardpass,total,total_winning FROM '.tablename($this->table_gift).' WHERE id=:id', array(':id' => $giftid));
$czpw = pdo_fetch("SELECT * FROM ".tablename('stonefish_grabgifts_pw')."WHERE dpassword = :dpassword", array(':dpassword' => $pass));
if(!empty($gift)){
if(!empty($czpw)){if($userinfo['grabgifts']!=''){
pdo_update($this->table_list,array('grabgifts' => $userinfo['grabgifts'].$giftid.'|', 'dname' => $userinfo['dname'].$czpw['dname'].'|', 'dpassword' => $userinfo['dpassword'].$czpw['dpassword'].'|'),array('id' => $userinfo['id']));}else{
pdo_update($this->table_list,array('grabgifts' => '|'.$giftid.'|', 'dname' => '|'.$czpw['dname'].'|', 'dpassword' => '|'.$czpw['dpassword'].'|'),array('id' => $userinfo['id']));
}
//增加中奖数量
pdo_update($this->table_gift,array('total_winning' => $gift['total_winning']+1),array('id' => $giftid));
message('恭喜,兑奖成功!', ''.$_W['siteroot'].$this->createMobileUrl('lingjiang', array('rid' => $rid)).'', 'success');
exit;
}else{
message('抱歉,密码不正确!', ''.$_W['siteroot'].$this->createMobileUrl('lingjiang', array('rid' => $rid)).'', 'error');
exit;
}
}else{
message('抱歉,信息出错,请联系管理员!', referer(), 'error');
}
// }