本文整理汇总了PHP中mc_update函数的典型用法代码示例。如果您正苦于以下问题:PHP mc_update函数的具体用法?PHP mc_update怎么用?PHP mc_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mc_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doMobileResult
public function doMobileResult()
{
global $_GPC, $_W;
if (isset($_GPC['wd_code'])) {
$title = '防伪验真';
$footer_off = 1;
$SecurityCode = $_GPC['wd_code'];
load()->model('mc');
$openid = $this->message['from'];
$logs['openid'] = $openid;
$logs['weid'] = $_W['uniacid'];
$fans = pdo_fetch("SELECT fanid,uid FROM " . tablename('mc_mapping_fans') . " WHERE `openid`='{$openid}' LIMIT 1");
$uid = '0';
if ($fans['uid'] != '0') {
$uid = $fans['uid'];
} else {
$uid = mc_update($uid, array('email' => md5($_W['openid']) . '@012wz.com'));
if (!empty($fans['fanid']) && !empty($uid)) {
pdo_update('mc_mapping_fans', array('uid' => $uid), array('fanid' => $fans['fanid']));
}
}
$logs['code'] = $SecurityCode;
$sql = "SELECT * FROM " . tablename($this->data) . " WHERE code='{$SecurityCode}' LIMIT 1";
$member = pdo_fetch($sql);
$states = 0;
if (!empty($member)) {
if ($member['stime'] <= TIME()) {
$logs['status'] = '0';
$reply = '您查询的防伪码已过期! ';
} else {
$member['num'] = intval($member['num']) + 1;
$data = array('num' => $member['num']);
pdo_update($this->data, $data, array('id' => $member['id']));
$states = 1;
$logs['status'] = '1';
}
if ($member['creditstatus'] == '0') {
mc_credit_update($uid, 'credit1', $member['creditnum'], array('1', '防伪码自动增加积分,积分名称:' . $member['creditname']));
pdo_update($this->data, array('creditstatus' => '1'), array('id' => $member['id']));
}
$logs['createtime'] = time();
pdo_insert('super_securitycode_logs', $logs);
$sql = "SELECT a.*,b.residecity,b.resideprovince FROM " . tablename("super_securitycode_logs") . " as a\r\n\r\n left JOIN ims_mc_mapping_fans as c on a.openid=c.openid\r\nleft join ims_mc_members as b on c.uid=b.uid\r\n WHERE a.code='{$SecurityCode}' and a.status=1 order by a.createtime DESC LIMIT 0," . $member['num'];
$loglist = pdo_fetchall($sql);
include $this->template('index2');
} else {
$reply = '您查询的防伪码不存在,请核对后重试!';
}
} else {
$reply = '您查询的防伪码不存在,请核对后重试!';
}
echo $reply;
exit;
}
示例2: fans_update
function fans_update($user, $fields)
{
global $_W;
load()->model('mc');
$uid = intval($user);
if (empty($uid)) {
$uid = pdo_fetchcolumn("SELECT uid FROM " . tablename('mc_mapping_fans') . " WHERE openid = :openid AND acid = :acid", array(':openid' => $user, ':acid' => $_W['acid']));
if (empty($uid)) {
return false;
}
}
return mc_update($uid, $fields);
}
示例3: doMobileEditfans
public function doMobileEditfans()
{
global $_GPC, $_W;
$rid = intval($_GPC['rid']);
$from_user = authcode(base64_decode($_GPC['from_user']), 'DECODE');
$uniacid = $_W['uniacid'];
//Session_token令牌判断
if (!isset($_GPC['session_token'])) {
$this->Json_encode(array('success' => 1, 'msg' => '非法操作'));
}
if (isset($_GPC['session_token']) && $_GPC['session_token'] != $_SESSION['_token']) {
$this->Json_encode(array('success' => 1, 'msg' => '请等待上次操作生效!不要着急!'));
}
//Session_token令牌判断
$exchange = pdo_fetch("select * FROM " . tablename("stonefish_chailihe_exchange") . " where rid = :rid", array(':rid' => $rid));
//判断是否参与过
$fans = pdo_fetch("select * from " . tablename('stonefish_chailihe_fans') . " where rid = :rid and uniacid = :uniacid and from_user= :from_user", array(':rid' => $rid, ':uniacid' => $uniacid, ':from_user' => $from_user));
$uid = pdo_fetchcolumn("select uid FROM " . tablename('mc_mapping_fans') . " where openid=:openid and uniacid=:uniacid", array(":openid" => $from_user, ":uniacid" => $uniacid));
if (!empty($fans)) {
//读取保存提交的资料
$ziduan = array('realname', 'mobile', 'qq', 'email', 'address', 'gender', 'telephone', 'idcard', 'company', 'occupation', 'position');
foreach ($ziduan as $ziduans) {
if ($exchange['is' . $ziduans]) {
pdo_update('stonefish_chailihe_fans', array($ziduans => $_GPC[$ziduans]), array('id' => $fans['id']));
//是否同步保存FANS表
if ($exchange['isfans'] && $uid) {
if ($ziduans == 'email') {
mc_update($uid, array('email' => $_GPC['email']));
} else {
mc_update($uid, array($ziduans => $_GPC[$ziduans], 'email' => $profile['email']));
}
}
//是否同步保存FANS表
}
}
//读取保存提交的资料
//生成Session_token令牌
$this->Session_token($from_user);
//生成Session_token令牌
$data = array('success' => 1, 'msg' => '资料保存成功!');
} else {
$data = array('success' => 0, 'msg' => '没有查到您的查关资料');
}
//判断是否参与过
$this->json_encode($data);
}
示例4: mc_require
function mc_require($uid, $fields, $pre = '')
{
global $_W, $_GPC;
if (empty($fields) || !is_array($fields)) {
return false;
}
$flipfields = array_flip($fields);
if (in_array('birth', $fields) || in_array('birthyear', $fields) || in_array('birthmonth', $fields) || in_array('birthday', $fields)) {
unset($flipfields['birthyear'], $flipfields['birthmonth'], $flipfields['birthday'], $flipfields['birth']);
$flipfields['birthyear'] = 'birthyear';
$flipfields['birthmonth'] = 'birthmonth';
$flipfields['birthday'] = 'birthday';
}
if (in_array('reside', $fields) || in_array('resideprovince', $fields) || in_array('residecity', $fields) || in_array('residedist', $fields)) {
unset($flipfields['residedist'], $flipfields['resideprovince'], $flipfields['residecity'], $flipfields['reside']);
$flipfields['resideprovince'] = 'resideprovince';
$flipfields['residecity'] = 'residecity';
$flipfields['residedist'] = 'residedist';
}
$fields = array_keys($flipfields);
if (!in_array('uniacid', $fields)) {
$fields[] = 'uniacid';
}
if (!empty($pre)) {
$pre .= '<br/>';
}
if (empty($uid)) {
foreach ($fields as $field) {
$profile[$field] = '';
}
$uniacid = $_W['uniacid'];
} else {
$profile = mc_fetch($uid, $fields);
$uniacid = $profile['uniacid'];
}
$sql = 'SELECT `f`.`field`, `f`.`id` AS `fid`, `mf`.* FROM ' . tablename('profile_fields') . " AS `f` LEFT JOIN " . tablename('mc_member_fields') . " AS `mf` ON `f`.`id` = `mf`.`fieldid` WHERE `uniacid` = :uniacid ORDER BY\r\n\t\t\t`displayorder` DESC";
$system_fields = pdo_fetchall($sql, array(':uniacid' => $_W['uniacid']), 'field');
if (empty($system_fields)) {
$sql = 'SELECT `id`, `field`, `title` FROM ' . tablename('profile_fields');
$system_fields = pdo_fetchall($sql, array(), 'field');
}
$titles = array();
foreach ($system_fields as $field) {
$titles[$field['field']] = $field['title'];
}
$message = '';
$ks = array();
foreach ($profile as $k => $v) {
if (empty($v)) {
$ks[] = $k;
$message .= $system_fields[$k]['title'] . ', ';
}
}
if (!empty($message)) {
$title = '完善资料';
if (checksubmit('submit')) {
if (in_array('resideprovince', $fields)) {
$_GPC['resideprovince'] = $_GPC['reside']['province'];
$_GPC['residecity'] = $_GPC['reside']['city'];
$_GPC['residedist'] = $_GPC['reside']['district'];
}
if (in_array('birthyear', $fields)) {
$_GPC['birthyear'] = $_GPC['birth']['year'];
$_GPC['birthmonth'] = $_GPC['birth']['month'];
$_GPC['birthday'] = $_GPC['birth']['day'];
}
$record = array_elements($fields, $_GPC);
if (isset($record['uniacid'])) {
unset($record['uniacid']);
}
foreach ($record as $field => $value) {
if ($field == 'gender') {
continue;
}
if (empty($value)) {
message('请填写完整所有资料.', referer(), 'error');
}
}
if (empty($record['nickname']) && !empty($_W['fans']['nickname'])) {
$record['nickname'] = $_W['fans']['nickname'];
}
if (empty($record['avatar']) && !empty($_W['fans']['tag']['avatar'])) {
$record['avatar'] = $_W['fans']['tag']['avatar'];
}
$condition = " AND uid != {$uid} ";
if (in_array('email', $fields)) {
$emailexists = pdo_fetchcolumn("SELECT email FROM " . tablename('mc_members') . " WHERE uniacid = :uniacid AND email = :email " . $condition, array(':uniacid' => $_W['uniacid'], ':email' => trim($record['email'])));
if (!empty($emailexists)) {
message('抱歉,您填写的手机号已经被使用,请更新。', 'refresh', 'error');
}
}
if (in_array('mobile', $fields)) {
$mobilexists = pdo_fetchcolumn("SELECT mobile FROM " . tablename('mc_members') . " WHERE uniacid = :uniacid AND mobile = :mobile " . $condition, array(':uniacid' => $_W['uniacid'], ':mobile' => trim($record['mobile'])));
if (!empty($mobilexists)) {
message('抱歉,您填写的手机号已经被使用,请更新。', 'refresh', 'error');
}
}
$insertuid = mc_update($uid, $record);
if (empty($uid)) {
pdo_update('mc_oauth_fans', array('uid' => $insertuid), array('oauth_openid' => $_W['openid']));
//.........这里部分代码省略.........
示例5: tablename
if (empty($profile['email']) || !empty($profile['email']) && substr($profile['email'], -6) == 'we7.cc' && strlen($profile['email']) == 39) {
$profile['email'] = '';
$profile['email_effective'] = 1;
}
}
$sql = 'SELECT `mf`.*, `pf`.`field` FROM ' . tablename('mc_member_fields') . ' AS `mf` JOIN ' . tablename('profile_fields') . " AS `pf`\r\n\t\tON `mf`.`fieldid` = `pf`.`id` WHERE `uniacid` = :uniacid AND `mf`.`available` = :available";
$params = array(':uniacid' => $_W['uniacid'], ':available' => '1');
$mcFields = pdo_fetchall($sql, $params, 'field');
if (checksubmit('submit')) {
if (!empty($_GPC)) {
$_GPC['createtime'] = TIMESTAMP;
foreach ($_GPC as $field => $value) {
if (!isset($value) || in_array($field, array('uid', 'act', 'name', 'token', 'submit', 'session'))) {
unset($_GPC[$field]);
continue;
}
}
if (empty($_GPC['email']) && $profile['email_effective'] == 1) {
unset($_GPC['email']);
}
$_GPC['birthyear'] = $_GPC['birth']['year'];
$_GPC['birthmonth'] = $_GPC['birth']['month'];
$_GPC['birthday'] = $_GPC['birth']['day'];
$_GPC['resideprovince'] = $_GPC['reside']['province'];
$_GPC['residecity'] = $_GPC['reside']['city'];
$_GPC['residedist'] = $_GPC['reside']['district'];
mc_update($_W['member']['uid'], $_GPC);
}
message('更新资料成功!', referer(), 'success');
}
template('mc/profile');
示例6: checkauth
<?php
global $_GPC, $_W;
checkauth();
$rid = intval($_GPC['rid']);
$uid = $_W['member']['uid'];
$realname = $_POST['realname'];
$mobile = $_POST['mobile'];
if (!empty($realname) && !empty($mobile)) {
$info = array('realname' => $realname, 'mobile' => $mobile);
mc_update($uid, $info);
$status = 1;
$url = $this->createMobileUrl('index', array('rid' => $rid));
$tip = '注册成功';
} else {
$status = 0;
$tip = '注册失败';
}
$data = array('msg' => $tip, 'status' => $status, 'url' => $url);
$msg = json_encode($data);
//print_r($_POST['realname']);
die($msg);
示例7: str_replace
$cardsn = str_replace($row, random(strlen($row), 1), $cardsn);
}
}
preg_match('/(\\#+)/', $_GPC['format'], $matchs);
$length = strlen($matchs[1]);
$pos = strpos($_GPC['format'], '#');
$cardsn = str_replace($matchs[1], str_pad($_GPC['snpos']++, $length - strlen($number), '0', STR_PAD_LEFT), $cardsn);
pdo_update('mc_card', array('snpos' => $_GPC['snpos']), array('uniacid' => $_W['uniacid'], 'id' => $_GPC['cardid']));
$record = array('uniacid' => $_W['uniacid'], 'uid' => $_W['member']['uid'], 'cid' => $_GPC['cardid'], 'cardsn' => $cardsn, 'status' => '1', 'createtime' => TIMESTAMP);
$check = mc_check($data);
if (is_error($check)) {
message($check['message'], '', 'error');
}
if (pdo_insert('mc_card_members', $record)) {
if (!empty($data)) {
mc_update($_W['member']['uid'], $data);
}
message('领取会员卡成功.', url('mc/bond/mycard'), 'success');
} else {
message('领取会员卡失败.', referer(), 'error');
}
}
}
if ($do == 'mycard') {
$mcard = pdo_fetch('SELECT * FROM ' . tablename('mc_card_members') . ' WHERE uniacid = :uniacid AND uid = :uid', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['member']['uid']));
if (empty($mcard)) {
header('Location:' . url('mc/bond/card'));
}
if (!empty($mcard['status'])) {
$setting = pdo_fetch('SELECT * FROM ' . tablename('mc_card') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid']));
if (!empty($setting)) {
示例8: doMobileResearch
//.........这里部分代码省略.........
if ($refid && $field && $file['name'] && $field['type'] == 'image') {
$entry = array();
$entry['reid'] = $reid;
$entry['rerid'] = 0;
$entry['refid'] = $refid;
$ret = file_upload($file);
if (!$ret['success']) {
message('上传图片失败, 请稍后重试.');
}
$entry['data'] = trim($ret['path']);
$datas[] = $entry;
}
}
}
}
// 兼容会员居住地字段
if (!empty($_GPC['reside'])) {
if (in_array('reside', $binds)) {
$update['resideprovince'] = $_GPC['reside']['province'];
$update['residecity'] = $_GPC['reside']['city'];
$update['residedist'] = $_GPC['reside']['district'];
}
foreach ($_GPC['reside'] as $key => $value) {
$resideData = array('reid' => $reside['reid']);
$resideData['rerid'] = 0;
$resideData['refid'] = $reside['refid'];
$resideData['data'] = $value;
$datas[] = $resideData;
}
}
// 更新关联会员资料
if (!empty($update)) {
load()->model('mc');
mc_update($_W['member']['uid'], $update);
}
if (empty($datas)) {
message('非法访问.', '', 'error');
}
if (pdo_insert('research_rows', $row) != 1) {
message('保存失败.');
}
$rerid = pdo_insertid();
if (empty($rerid)) {
message('保存失败.');
}
foreach ($datas as &$r) {
$r['rerid'] = $rerid;
pdo_insert('research_data', $r);
}
if (empty($activity['starttime'])) {
$record = array();
$record['starttime'] = TIMESTAMP;
pdo_update('research', $record, array('reid' => $reid));
}
if (!empty($datas)) {
$image = $body = '';
foreach ($datas as $row) {
if (substr($row['data'], 0, 6) != 'images') {
$body .= '<h4>' . $fields[$row['refid']]['title'] . ':' . $row['data'] . '</h4>';
} else {
$image .= '<p>' . $fields[$row['refid']]['title'] . ': <img src="' . tomedia($row['data']) . '" /></p>';
}
}
// 发送邮件提醒
if (!empty($activity['noticeemail'])) {
load()->func('communication');
示例9: doMobilesettel
public function doMobilesettel()
{
global $_GPC, $_W;
$rid = intval($_GPC['rid']);
$fansID = $_W['member']['uid'];
$from_user = $_W['fans']['from_user'];
$fans = pdo_fetch("select id from " . tablename('stonefish_bigwheel_fans') . " where rid = " . $rid . " and fansID=" . $fansID . " and from_user='" . $from_user . "'");
if ($fans == false) {
$data = array('success' => 0, 'msg' => '保存数据错误!');
} else {
//查询规则保存哪些数据
$updata = array();
$reply = pdo_fetch("select isfans,isrealname,ismobile,isqq,isemail,isaddress,isgender,istelephone,isidcard,iscompany,isoccupation,isposition from " . tablename('stonefish_bigwheel_reply') . " where rid = :rid", array(':rid' => $rid));
if ($reply['isrealname']) {
$updata['realname'] = $_GPC['realname'];
}
if ($reply['ismobile']) {
$updata['mobile'] = $_GPC['mobile'];
}
if ($reply['isqq']) {
$updata['qq'] = $_GPC['qq'];
}
if ($reply['isemail']) {
$updata['email'] = $_GPC['email'];
}
if ($reply['isaddress']) {
$updata['address'] = $_GPC['address'];
}
if ($reply['isgender']) {
$updata['gender'] = $_GPC['gender'];
}
if ($reply['istelephone']) {
$updata['telephone'] = $_GPC['telephone'];
}
if ($reply['isidcard']) {
$updata['idcard'] = $_GPC['idcard'];
}
if ($reply['iscompany']) {
$updata['company'] = $_GPC['company'];
}
if ($reply['isoccupation']) {
$updata['occupation'] = $_GPC['occupation'];
}
if ($reply['isposition']) {
$updata['position'] = $_GPC['position'];
}
$temp = pdo_update('stonefish_bigwheel_fans', $updata, array('rid' => $rid, 'fansID' => $fansID));
if ($temp === false) {
$data = array('success' => 0, 'msg' => '保存数据错误!');
} else {
if ($reply['isfans']) {
load()->model('mc');
mc_update($fansID, $updata);
}
$data = array('success' => 1, 'msg' => '成功提交数据');
}
}
echo json_encode($data);
}
示例10: doMobileApply
public function doMobileApply()
{
//这个操作被定义用来呈现 微站个人中心导航
global $_W, $_GPC;
load()->model('mc');
$openid = $_W['fans']['from_user'];
$fans = pdo_fetch("SELECT fanid,uid FROM " . tablename('mc_mapping_fans') . " WHERE `openid`='{$openid}' LIMIT 1");
$uid = '0';
if ($fans['uid'] != '0') {
$uid = $fans['uid'];
} else {
$uid = mc_update($uid, array('email' => md5($_W['openid']) . '@012wz.com'));
if (!empty($fans['fanid']) && !empty($uid)) {
pdo_update('mc_mapping_fans', array('uid' => $uid), array('fanid' => $fans['fanid']));
}
}
$minnum = isset($this->module['config']['out_limit']) ? $this->module['config']['out_limit'] : '100.00';
$credit_type = isset($this->module['config']['credit_type']) ? $this->module['config']['credit_type'] : 'credit1';
$yue = mc_credit_fetch($uid);
$ff_log = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `uid`='{$uid}'");
$profile = mc_fetch($uid);
if (checksubmit('submit')) {
if ($_GPC['type'] == '1' && empty($_GPC['alipay'])) {
message('参数错误,请返回修改');
}
if ($_GPC['type'] == '2' && empty($_GPC['cardid'])) {
message('参数错误,请返回修改');
}
$remark['1']['user'] = $_GPC['realname'];
$remark['1']['time'] = time();
$remark['1']['reason'] = '';
$data = array('uniacid' => $_W['uniacid'], 'uid' => $uid, 'realname' => $_GPC['realname'], 'qq' => $_GPC['qq'], 'type' => intval($_GPC['type']), 'alipay' => $_GPC['alipay'], 'cardid' => $_GPC['cardid'], 'cardfrom' => $_GPC['cardfrom'], 'cardname' => $_GPC['cardname'], 'credit2' => $_GPC['credit2'], 'mobile' => $_GPC['mobile'], 'createtime' => time(), 'status' => '1', 'remark' => iserializer($remark));
pdo_insert('hx_subscribe_apply', $data);
mc_credit_update($uid, $credit_type, '-' . $_GPC['mobile'], array('1', '申请提现'));
message('提现成功', $this->createMobileUrl('myapply'), 'success');
}
include $this->template('apply');
}
示例11: doMobileSurvey
public function doMobileSurvey()
{
checkauth();
global $_W, $_GPC;
$sid = intval($_GPC['id']);
$sql = 'SELECT * FROM ' . tablename('survey') . ' WHERE `weid`=:weid AND `sid`=:sid';
$params = array();
$params[':weid'] = $_W['uniacid'];
$params[':sid'] = $sid;
$activity = pdo_fetch($sql, $params);
$activity['content'] = htmlspecialchars_decode($activity['content']);
$title = $activity['title'];
//分享处理
$_share_img = $_W['attachurl'] . $activity['thumb'];
if ($activity['status'] != '1') {
message('当前调研活动已经停止.');
}
if (!$activity) {
message('非法访问.');
}
if ($activity['starttime'] > TIMESTAMP) {
message('当前调研活动还未开始!');
}
if ($activity['endtime'] < TIMESTAMP) {
message('当前调研活动已经结束!');
}
$sql = 'SELECT * FROM ' . tablename('survey_fields') . ' WHERE `sid`=:sid ORDER BY `displayorder` ASC,sfid ASC';
$params = array();
$params[':sid'] = $sid;
$ds = pdo_fetchall($sql, $params);
if (!$ds) {
message('非法访问.');
}
$pertotal = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('survey_rows') . " WHERE sid = :sid AND openid = :openid", array(':sid' => $sid, ':openid' => $_W['fans']['from_user']));
if ($pertotal >= $activity['pertotal']) {
$pererror = 1;
}
$user = mc_fetch($_W['fans']['from_user'], array('realname', 'mobile'));
if (empty($user['realname']) || empty($user['mobile'])) {
$userinfo = 0;
}
if (checksubmit()) {
if ($pertotal >= $activity['pertotal']) {
message('抱歉!每人只能提交' . $activity['pertotal'] . "次!", referer(), 'error');
}
//更新粉丝的手机号和姓名
if ($userinfo == '0') {
mc_update($_W['fans']['from_user'], array('realname' => trim($_GPC['username']), 'mobile' => trim($_GPC['telephone'])));
}
$row = array();
$row['sid'] = $sid;
$row['openid'] = $_W['fans']['from_user'];
$row['suggest'] = trim($_GPC['suggest']);
$row['createtime'] = TIMESTAMP;
$datas = array();
$fields = array();
foreach ($ds as $r) {
$fields[$r['sfid']] = $r;
}
foreach ($_GPC as $key => $value) {
if (strexists($key, 'field_')) {
$sfid = intval(str_replace('field_', '', $key));
$field = $fields[$sfid];
if ($sfid && $field) {
if (in_array($field['type'], array('textarea', 'radio'))) {
$entry = array();
$entry['sid'] = $sid;
$entry['srid'] = 0;
$entry['sfid'] = $sfid;
$entry['createtime'] = TIMESTAMP;
$entry['data'] = strval($value);
$datas[] = $entry;
}
if (in_array($field['type'], array('checkbox'))) {
$value = explode("||", $value);
if (!is_array($value)) {
continue;
}
foreach ($value as $k => $v) {
$entry['sid'] = $sid;
$entry['srid'] = 0;
$entry['sfid'] = $sfid;
$entry['createtime'] = TIMESTAMP;
$entry['data'] = strval($v);
$datas[] = $entry;
}
}
}
}
}
if (empty($datas)) {
message('非法访问.', '', 'error');
}
if (pdo_insert('survey_rows', $row) != 1) {
message('保存失败.');
}
$srid = pdo_insertid();
if (empty($srid)) {
message('保存失败.');
}
//.........这里部分代码省略.........
示例12: doMobilesettel
public function doMobilesettel()
{
global $_GPC, $_W;
$id = intval($_GPC['id']);
$fansID = $_W['member']['uid'];
$from_user = $_W['fans']['from_user'];
$fans = pdo_fetch("SELECT id FROM " . tablename($this->tablefans) . " WHERE rid = " . $id . " and fansID=" . $fansID . " and from_user='" . $from_user . "'");
if ($fans == false) {
$data = array('success' => 0, 'msg' => '保存数据错误!');
} else {
$temp = pdo_update($this->tablefans, array('tel' => $_GPC['tel']), array('rid' => $id, 'fansID' => $fansID));
if ($temp === false) {
$data = array('success' => 0, 'msg' => '保存数据错误!');
} else {
load()->model('mc');
mc_update($fansID, array('mobile' => $_GPC['tel']));
$data = array('success' => 1, 'msg' => '成功提交数据');
}
}
echo json_encode($data);
}
示例13: doMobileInfo
public function doMobileInfo()
{
global $_W, $_GPC;
$openid = $this->getOpenid();
$rule = pdo_fetch('select * from ' . tablename($this->modulename . "_rule") . " where rid='{$_GPC['rid']}'");
$player = pdo_fetch('select * from ' . tablename($this->modulename . '_player') . " where rid='{$rule['rid']}' and openid='{$openid}'");
if ($_GPC['op'] == 'user') {
$nl = trim($_GPC['nl']);
$nz = trim($_GPC['zn']);
if (empty($nl)) {
$nl = '牛郎';
}
if (empty($nz)) {
$nz = '织女';
}
$data = array('myname' => $nl, 'hname' => $nz);
if (pdo_update($this->modulename . '_player', $data, array('id' => $player['id'])) === false) {
die("0");
}
die("1");
} else {
if (!empty($_GPC['mobile']) && !preg_match("/^1[34578]\\d{9}\$/", $_GPC['mobile'])) {
message('请填写正确的手机号码');
}
if (empty($player)) {
$player = $this->createPlayer($rule);
}
$data = array('realname' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'qq' => $_GPC['qq'], 'email' => $_GPC['email'], 'address' => $_GPC['address']);
if (pdo_update($this->modulename . '_player', $data, array('id' => $player['id'])) === false) {
message('保存个人信息失败!');
}
if ($rule['isfans']) {
//更新信息到系统会员表
load()->model('mc');
$mc = array();
if (!empty($data['realname'])) {
$mc['realname'] = $data['realname'];
}
if (!empty($data['mobile'])) {
$mc['mobile'] = $data['mobile'];
}
if (!empty($data['qq'])) {
$mc['qq'] = $data['qq'];
}
if (!empty($data['email'])) {
$mc['email'] = $data['email'];
}
if (!empty($data['address'])) {
$mc['address'] = $data['address'];
}
mc_update($player['openid'], $mc);
}
message('保存个人信息成功!', $this->createMobileUrl('index', array('rid' => $rule['rid'])));
}
}
示例14: intval
<?php
$award_id = intval($_GPC['award_id']);
if (!empty($_GPC['award_id'])) {
$follow = pdo_fetch("select uid from " . tablename('mc_mapping_fans') . " uniacid = " . $weid . " and openid = '" . $_W['openid'] . "'");
$fans = mc_search($follow['uid'], array('credit1'));
$award_info = pdo_fetch("SELECT * FROM " . tablename('weilive_list') . " WHERE award_id = {$award_id} AND weid = '{$weid}'");
if ($fans['credit1'] >= $award_info['credit_cost'] && $award_info['amount'] > 0) {
$data = array('amount' => $award_info['amount'] - 1);
pdo_update('weilive_list', $data, array('weid' => $weid, 'award_id' => $award_id));
$data = array('weid' => $weid, 'from_user' => $_W['fans']['from_user'], 'award_id' => $award_id, 'createtime' => TIMESTAMP);
pdo_insert('weilive_request', $data);
$data = array('realname' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'credit1' => $fans['credit1'] - $award_info['credit_cost'], 'residedist' => $_GPC['residedist']);
mc_update($follow['uid'], $data);
// navigate to user profile page
message('积分兑换成功!', create_url('mobile/module/mycredit', array('weid' => $weid, 'name' => 'hcweilive', 'do' => 'mycredit', 'op' => 'display')), 'success');
} else {
message('积分不足或商品已经兑空,请重新选择商品!<br>当前商品所需积分:' . $award_info['credit_cost'] . '<br>您的积分:' . $fans['credit1'] . '. 商品剩余数量:' . $award_info['amount'] . '<br><br>小提示:<br>每日签到,在线订票,宾馆预订可以赚取积分', create_url('mobile/module/award', array('weid' => $weid, 'name' => 'hcweilive')), 'error');
}
} else {
message('请选择要兑换的商品!', create_url('mobile/module/award', array('weid' => $weid, 'name' => 'hcweilive')), 'error');
}
示例15: Mobile_UpdateMember
function Mobile_UpdateMember($theThis, $uniacid, $uid, $data)
{
global $_W, $_GPC;
$rd = new ReturnData("");
load()->model('mc');
if (!mc_update($uid, $data)) {
$rd->setMsg("更新个人信息失败");
$rd->setCode(200);
}
return $rd;
}