本文整理汇总了PHP中fans_update函数的典型用法代码示例。如果您正苦于以下问题:PHP fans_update函数的具体用法?PHP fans_update怎么用?PHP fans_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fans_update函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doMobileMregister
public function doMobileMregister()
{
global $_GPC, $_W;
$fid = intval($_GPC['fid']);
$flight_setting = pdo_fetch("SELECT * FROM " . tablename('fighting_setting') . " WHERE rid = '{$fid}' LIMIT 1");
if (empty($flight_setting)) {
message('非法访问,请重新发送消息进入页面!');
}
$fromuser = $_W['fans']['from_user'];
if (empty($fromuser)) {
$fromuser = $_GPC['openid'];
}
$data = array('nickname' => $_GPC['nickname'], 'mobile' => $_GPC['mobile']);
if (empty($data['nickname'])) {
return $this->fightJson(-1, '请填写您的昵称!');
exit;
}
if (empty($data['mobile'])) {
return $this->fightJson(-1, '请填写您的手机号码!');
exit;
}
fans_update($fromuser, array('nickname' => $_GPC['nickname'], 'mobile' => $_GPC['mobile']));
$p = pdo_fetch("SELECT * FROM " . tablename('fighting_user') . " WHERE openid='" . $fromuser . "' AND fid=" . $fid);
$insert1 = array('weid' => $_W['uniacid'], 'fid' => $fid, 'openid' => $fromuser, 'nickname' => $_GPC['nickname'], 'mobile' => $_GPC['mobile']);
if (!empty($p['id'])) {
$insert1['id'] = $p['id'];
pdo_update('fighting_user', $insert1, array('id' => $p['id']));
} else {
$add = pdo_insert('fighting_user', $insert1);
}
return $this->fightJson(1, '');
exit;
}
开发者ID:eduNeusoft,项目名称:weixin,代码行数:33,代码来源:site.php
示例2: respond
public function respond()
{
global $_W;
$rid = $this->rule;
$sql = "SELECT * FROM " . tablename('signin_reply') . " WHERE `rid`=:rid LIMIT 1";
$row = pdo_fetch($sql, array(':rid' => $rid));
if (empty($row['id'])) {
return array();
}
$now = time();
$start_time = $this->module['config']['start_time'];
$start_time = strtotime($start_time);
$end_time = $this->module['config']['end_time'];
$end_time = strtotime($end_time);
$date = date('Y-m-d');
$date = strtotime($date);
$times = $this->module['config']['times'];
$credit = $this->module['config']['credit'];
$limit = $this->module['config']['rank'];
$message = $this->message;
$from = $message['from'];
$todaytotal = pdo_fetchall("SELECT * FROM " . tablename('signin_record') . " WHERE `time` >= :date ", array(':date' => $date));
$totalnum = count($todaytotal);
$userrank = $totalnum + 1;
$todaysignin = pdo_fetchall("SELECT * FROM " . tablename('signin_record') . " WHERE `from_user` = :from_user and `time` >= :date ", array(':from_user' => $from, ':date' => $date));
$signinednum = count($todaysignin);
$signinnum = $signinednum + 1;
$profile = fans_search($from);
if (!empty($profile['realname'])) {
if ($now >= $start_time && $now <= $end_time) {
if ($signinednum < $times) {
$insert = array('id' => null, 'weid' => $_W['weid'], 'from_user' => $from, 'name' => $profile['realname'], 'time' => $now, 'rank' => $userrank);
pdo_insert('signin_record', $insert);
$data = array('credit1' => $credit + $profile['credit1']);
fans_update($from, $data);
$top = "SELECT * FROM " . tablename('signin_record') . " WHERE `time` >= :date order by rank asc limit {$limit}";
$rs = pdo_fetchall($top, array(':date' => $date));
$value = array();
foreach ($rs as $value) {
$record .= 'NO.' . $value['rank'] . ' ' . $value['name'] . ' ' . date('H:i', $value['time']) . "\n";
}
$nowcredite = fans_search($from);
return $this->respText('这是您今天第' . $signinnum . '次签到' . "\n\n" . '排名第' . $userrank . "\n\n" . '本次获取' . $credit . '个积分' . "\n\n" . '累计拥有' . $nowcredite['credit1'] . '个积分' . "\n\n" . '今日签到排行榜:' . "\n\n" . $record);
} else {
$top = "SELECT * FROM " . tablename('signin_record') . " WHERE `from_user` = :from_user and `time` >= :date order by rank asc limit 10";
$rs = pdo_fetchall($top, array(':from_user' => $from, ':date' => $date));
$value = array();
foreach ($rs as $value) {
$record .= 'NO.' . $value['rank'] . ' ' . date('m-d H:i:s', $value['time']) . "\n";
}
return $this->respText($row['overnum'] . "\n\n" . '您的签到记录为' . "\n" . $record);
}
} else {
return $this->respText($row['overtime']);
}
} else {
return $this->respNews(array('Title' => "请先登记", 'Description' => "点击进入登记", 'PicUrl' => "", 'Url' => $this->createMobileUrl('register')));
}
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:59,代码来源:processor.php
示例3: receive
public function receive()
{
$type = $this->message['type'];
//这里定义此模块进行消息订阅时的, 消息到达以后的具体处理过程, 请查看微擎文档来编写你的代码
//退订
if ($this->message['event'] == 'unsubscribe') {
pdo_update('fans', array('follow' => 0, 'createtime' => TIMESTAMP), array('from_user' => $this->message['fromusername'], 'weid' => $GLOBALS['_W']['weid']));
} else {
fans_update($this->message['fromusername'], array('weid' => $GLOBALS['_W']['weid'], 'follow' => 1, 'from_user' => $this->message['fromusername'], 'createtime' => TIMESTAMP));
}
}
开发者ID:yunsite,项目名称:my-we7,代码行数:11,代码来源:receiver.php
示例4: doMobileRegister
public function doMobileRegister()
{
global $_GPC, $_W;
if (!empty($_GPC['submit'])) {
if (empty($_W['fans']['from_user'])) {
message('非法访问,请重新发送消息进入砸蛋页面!');
}
$data = array('realname' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'gender' => $_GPC['gender']);
fans_update($_W['fans']['from_user'], $data);
die('<script>location.href = "' . $this->createMobileUrl('success') . '";</script>');
}
include $this->template('register');
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:13,代码来源:site.php
示例5: doMobileIndex
public function doMobileIndex()
{
global $_GPC, $_W;
$from = $_W['fans']['from_user'];
$rid = intval($_GPC['rid']);
$weid = intval($_GPC['weid']);
$date = date('Y-m-d');
$date = strtotime($date);
$now = time();
$profile = fans_search($from);
$sql = "SELECT * FROM " . tablename('exchange_reply') . " WHERE `rid`=:rid";
$row = pdo_fetch($sql, array(':rid' => $rid));
$row['picture'] = $_W['attachurl'] . trim($row['picture'], '/');
$title = $row['title'];
//$newcredit = $profile['credit1'] - $row['price'];
$numax = floor($profile['credit1'] / $row['price']);
$exchanged = pdo_fetchall("SELECT sum(nums) as enum FROM " . tablename('exchange_record') . " WHERE rid = :rid ", array(':rid' => $rid));
$userexchangeinfo = pdo_fetchall("SELECT nums, cprice, time FROM " . tablename('exchange_record') . " WHERE rid = :rid AND openid = :openid ", array(':rid' => $rid, ':openid' => $from));
$usertodayexchang = pdo_fetchall("SELECT * FROM " . tablename('exchange_record') . " WHERE rid = :rid AND openid = :openid AND `time` >= :date ", array(':rid' => $rid, ':openid' => $from, ':date' => $date));
$usertodaynum = count($usertodayexchang);
$allowexchange = $row['amount'] - $exchanged['0']['enum'];
if ($numax >= 1) {
for ($i = 1; $i <= $numax; $i++) {
$n = $i;
$nn[] = $n;
}
}
if (!empty($_GPC['submit'])) {
if ($usertodaynum >= $row['times']) {
message('每天只能兑换' . $row['times'] . '次哟~~', 'refresh', 'error');
}
if ($_GPC['nums'] <= $allowexchange) {
$data = array('realname' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'credit1' => $profile['credit1'] - $_GPC['cprice']);
fans_update($from, $data);
$insert = array('weid' => $weid, 'rid' => $rid, 'openid' => $from, 'name' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'nums' => $_GPC['nums'], 'cprice' => $_GPC['cprice'], 'time' => $now);
if (pdo_insert('exchange_record', $insert)) {
$id = pdo_insertid();
}
} else {
die('<script>location.href = "' . $this->createMobileUrl('error', array('rid' => $_GPC['rid'], 'id' => $id)) . '";</script>');
}
die('<script>location.href = "' . $this->createMobileUrl('success', array('rid' => $_GPC['rid'], 'id' => $id)) . '";</script>');
}
include $this->template('index');
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:45,代码来源:site.php
示例6: receive
public function receive()
{
global $_W, $_GPC;
$type = $this->message['type'];
//这里定义此模块进行消息订阅时的, 消息到达以后的具体处理过程, 请查看WORMWOOD文档来编写你的代码
$set = $this->module['config'];
if (!isset($set['guanzhupp'])) {
$set['guanzhupp'] = '0';
}
if (!isset($set['huoyuepp'])) {
$set['huoyuepp'] = '0';
}
if ($set['guanzhupp'] != '0' || $set['huoyuepp'] != '0') {
$openid = $this->message['fromusername'];
$atype = 'weixin';
$account_token = "account_{$atype}_token";
$account_code = "account_weixin_code";
$token = $account_token($_W['account']);
$url = sprintf("https://api.weixin.qq.com/cgi-bin/user/info?access_token=%s&openid=%s&lang=zh_CN", $token, $openid);
$content = ihttp_get($url);
$dat = $content['content'];
$re = @json_decode($dat, true);
$dataoi['openid'] = $openid;
$content3 = ihttp_post(sprintf("https://api.weixin.qq.com/cgi-bin/groups/getid?access_token=%s", $token), json_encode($dataoi));
$groupid = @json_decode($content3['content'], true);
}
//退订
if ($this->message['event'] == 'unsubscribe') {
pdo_update('fans', array('follow' => 0, 'createtime' => TIMESTAMP), array('from_user' => $this->message['fromusername'], 'weid' => $GLOBALS['_W']['weid']));
} elseif ($this->message['event'] == 'subscribe' && $set['guanzhupp'] == '0') {
fans_update($this->message['fromusername'], array('weid' => $GLOBALS['_W']['weid'], 'follow' => 1, 'from_user' => $this->message['fromusername'], 'createtime' => TIMESTAMP));
} elseif ($set['huoyuepp'] == '0') {
fans_update($this->message['fromusername'], array('weid' => $GLOBALS['_W']['weid'], 'follow' => 1, 'from_user' => $this->message['fromusername'], 'createtime' => TIMESTAMP));
} else {
fans_update($this->message['fromusername'], array('weid' => $GLOBALS['_W']['weid'], 'follow' => 1, 'from_user' => $this->message['fromusername'], 'nickname' => $re['nickname'], 'gender' => $re['sex'], 'groupid' => $groupid['groupid'], 'residecity' => $re['city'], 'resideprovince' => $re['province'], 'nationality' => $re['country'], 'avatar' => $re['headimgurl'], 'createtime' => TIMESTAMP));
}
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:37,代码来源:receiver.php
示例7: fans_update
fans_update($from_user, array('nickname' => $mynickname));
}
if ($reply['isrealname']) {
fans_update($from_user, array('realname' => $realname));
}
if ($reply['ismobile']) {
fans_update($from_user, array('mobile' => $mobile));
}
if ($reply['isqqhao']) {
fans_update($from_user, array('qq' => $qqhao));
}
if ($reply['isemail']) {
fans_update($from_user, array('email' => $email));
}
if ($reply['isaddress']) {
fans_update($from_user, array('address' => $address));
}
}
if ($_W['account']['level'] == 4) {
$this->sendMobileRegMsg($from_user, $rid, $uniacid);
}
if ($reply['tpsh'] == 1) {
$msg = '恭喜你报名成功,现在进入审核';
} else {
$msg = '恭喜你报名成功!';
}
$linkurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('tuser', array('rid' => $rid, 'tfrom_user' => $from_user));
$fmdata = array("success" => 1, "msg" => $msg, "linkurl" => $linkurl);
echo json_encode($fmdata);
exit;
}
开发者ID:eduNeusoft,项目名称:weixin,代码行数:31,代码来源:treg.php
示例8: doMobileXoauth
public function doMobileXoauth()
{
global $_W, $_GPC;
$uniacid = $_W['uniacid'];
//当前公众号ID
//用户不授权返回提示说明
if ($_GPC['code'] == "authdeny") {
exit;
}
//高级接口取未关注用户Openid
if (isset($_GPC['code'])) {
//第二步:获得到了OpenID
$appid = $_W['account']['key'];
$secret = $_W['account']['secret'];
$serverapp = $_W['account']['level'];
if ($serverapp == 2) {
if (empty($appid) || empty($secret)) {
return;
}
}
$state = $_GPC['state'];
//1为关注用户, 0为未关注用户
//查询活动时间
$code = $_GPC['code'];
$oauth2_code = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" . $appid . "&secret=" . $secret . "&code=" . $code . "&grant_type=authorization_code";
$content = ihttp_get($oauth2_code);
$token = @json_decode($content['content'], true);
if (empty($token) || !is_array($token) || empty($token['access_token']) || empty($token['openid'])) {
echo '<h1>获取微信公众号授权' . $code . '失败[无法取得token以及openid], 请稍后重试! 公众平台返回原始数据为: <br />' . $content['meta'] . '<h1>';
exit;
}
$from_user = $token['openid'];
//再次查询是否为关注用户
$profile = fans_search($from_user, array('follow'));
//关注用户直接获取信息
if ($profile['follow'] == 1) {
$state = 1;
}
//未关注用户和关注用户取全局access_token值的方式不一样
if ($state == 1 && $serverapp == 2) {
$access_token = $this->get_weixin_token();
$oauth2_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $access_token . "&openid=" . $from_user . "&lang=zh_CN";
} else {
$access_token = $token['access_token'];
$oauth2_url = "https://api.weixin.qq.com/sns/userinfo?access_token=" . $access_token . "&openid=" . $from_user . "&lang=zh_CN";
}
//使用全局ACCESS_TOKEN获取OpenID的详细信息
$content = ihttp_get($oauth2_url);
$info = @json_decode($content['content'], true);
if (empty($info) || !is_array($info) || empty($info['openid']) || empty($info['nickname'])) {
echo '<h1>获取微信公众号授权失败[无法取得info], 请稍后重试!<h1>';
exit;
}
// if (!empty($info["headimgurl"])) {
//$info['avatar']='resource/attachment/avatar/'.$info["openid"].'.jpg';
//$imgfile=$info['avatar'];
// $this->GrabImage($info['headimgurl'],$imgfile);
//file_write($info['avatar'], $filedata);
// }else{
//$info['headimgurl']='avatar_11.jpg';
//}
if ($serverapp == 2) {
//普通号
$row = array('uniacid' => $_W['uniacid'], 'nickname' => $info["nickname"], 'realname' => $info["nickname"], 'gender' => $info['sex']);
if (!empty($info["country"])) {
$row['country'] = $info["country"];
}
if (!empty($info["province"])) {
$row['province'] = $info["province"];
}
if (!empty($info["city"])) {
$row['city'] = $info["city"];
}
fans_update($from_user, $row);
/*if(!empty($info["headimgurl"])){
pdo_update('fans', array('avatar'=>$info["headimgurl"]), array('from_user' => $from_user));
}*/
}
if ($serverapp != 2 && !empty($from_user)) {
//普通号
$row = array('nickname' => $info["nickname"], 'realname' => $info["nickname"], 'gender' => $info['sex']);
if (!empty($info["country"])) {
$row['country'] = $info["country"];
}
if (!empty($info["province"])) {
$row['province'] = $info["province"];
}
if (!empty($info["city"])) {
$row['city'] = $info["city"];
}
fans_update($from_user, $row);
/*if(!empty($info["headimgurl"])){
pdo_update('fans', array('avatar'=>$info["headimgurl"]), array('from_user' => $from_user));
}*/
}
$oauth_openid = "eso_sale_t150122" . $_W['uniacid'];
setcookie($oauth_openid, $from_user, time() + 3600 * (24 * 5));
// $url=$this->mturl('index',array('id'=>$id));
$url = $_COOKIE["xoauthURL"];
//die('<script>location.href = "'.$url.'";</script>');
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:mygit,代码行数:101,代码来源:site.php
示例9: doWebeditusr
public function doWebeditusr()
{
global $_W, $_GPC;
$id = intval($_GPC['id']);
include_once model('fans');
if (checksubmit('submit')) {
if (!empty($_GPC)) {
$from_user = $_GPC['from'];
foreach ($_GPC as $field => $value) {
if (empty($value) || in_array($field, array('from_user', 'act', 'name', 'token', 'submit'))) {
unset($_GPC[$field]);
continue;
}
}
fans_update($from_user, $_GPC);
}
message('更新资料成功!', referer(), 'success');
}
if (checksubmit('tb')) {
if (!empty($_GPC)) {
$from_user = $_GPC['from'];
} else {
message('请确定OID有填写!', referer(), 'success');
exit;
}
$user = gjgetuserinfo($from_user, $_GPC['gxtou']);
if (!empty($user['from_user']) && is_array($user)) {
pdo_update('fans', $user, array('from_user' => $from_user));
//fans_update($from_user, $user);
//pdo_debug();exit;
}
message('同步资料成功!', referer(), 'success');
}
$profile = fans_search($_GPC['from']);
$form = array('birthday' => array('year' => array(date('Y'), '1914')), 'bloodtype' => array('A', 'B', 'AB', 'O', '其它'), 'education' => array('博士', '硕士', '本科', '专科', '中学', '小学', '其它'), 'constellation' => array('水瓶座', '双鱼座', '白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座'), 'zodiac' => array('鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊', '猴', '鸡', '狗', '猪'));
$gname = $this->doWebGroupdata($member['groupid']);
$groupname = $gname ? '未分组' : $gname['groupname'];
$grouplist = $this->doWebGroupdata();
include $this->template('usr');
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:40,代码来源:site.php
示例10: doMobileuserinfosave
public function doMobileuserinfosave()
{
//分享页面显示。
global $_GPC, $_W;
$weid = $_W['uniacid'];
//当前公众号ID
$rid = $_GPC['rid'];
//当前规则ID
$uid = $_GPC['uid'];
//礼盒ID
$fromuser = authcode(base64_decode($_GPC['fromuser']), 'DECODE');
$page_fromuser = $_GPC['fromuser'];
//活动规则
if (!empty($rid)) {
$reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
}
//同时更新到官方FANS表中
if ($reply['isrealname'] && !empty($_GPC['info-name'])) {
if ($reply['isfans']) {
fans_update($fromuser, array('realname' => $_GPC['info-name']));
}
pdo_update($this->table_list, array('realname' => $_GPC['info-name']), array('from_user' => $fromuser, 'weid' => $weid));
}
if ($reply['ismobile'] && !empty($_GPC['info-tel'])) {
if ($reply['isfans']) {
fans_update($fromuser, array('mobile' => $_GPC['info-tel']));
}
pdo_update($this->table_list, array('mobile' => $_GPC['info-tel']), array('from_user' => $fromuser, 'weid' => $weid));
}
if ($reply['isqq'] && !empty($_GPC['info-qqhao'])) {
if ($reply['isfans']) {
fans_update($fromuser, array('qq' => $_GPC['info-qqhao']));
}
pdo_update($this->table_list, array('qq' => $_GPC['info-qqhao']), array('from_user' => $fromuser, 'weid' => $weid));
}
if ($reply['isemail'] && !empty($_GPC['info-email'])) {
if ($reply['isfans']) {
fans_update($fromuser, array('email' => $_GPC['info-email']));
}
pdo_update($this->table_list, array('email' => $_GPC['info-email']), array('from_user' => $fromuser, 'weid' => $weid));
}
if ($reply['isaddress'] && !empty($_GPC['info-address'])) {
if ($reply['isfans']) {
fans_update($fromuser, array('address' => $_GPC['info-address']));
}
pdo_update($this->table_list, array('address' => $_GPC['info-address']), array('from_user' => $fromuser, 'weid' => $weid));
}
//跳转到自己的礼盒信息处
$mylihe = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('viewlihe', array('rid' => $rid, 'info-prize2' => $uid, 'fromuser' => $page_fromuser), true), 2);
header("location:{$mylihe}");
exit;
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:52,代码来源:site.php
示例11: doMobileYuyue
//.........这里部分代码省略.........
}
if (!empty($ds)) {
foreach ($ds as &$d) {
if ($d['type'] == 'select') {
$d['option'] = explode('|', $d['value']);
}
}
foreach ($ds as $r) {
$fields[$r['fid']] = $r;
}
}
//获取某用户的预约次数
$pertotal = 0;
$pertotal = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('we7car_order_list') . " WHERE sid = :sid AND from_user = :openid AND yytype = :yytype", array(':sid' => $reply['id'], ':openid' => $_W['fans']['from_user'], ':yytype' => $yytype));
if ($pertotal >= $reply['pertotal'] && $reply['pertotal'] != 0) {
$pererror = 1;
}
if ($lid) {
//得到某个订单
$order = pdo_fetch("SELECT * FROM " . tablename('we7car_order_list') . " WHERE `id` = :id AND `yytype` = :yytype LIMIT 1", array(':id' => $lid, ':yytype' => $yytype));
$order['brand_val'] = $order['brand'] . '=' . $order['brand_cn'];
$order['series_val'] = $order['serie'] . '=' . $order['serie_cn'];
$order['type_val'] = $order['type'] . '=' . $order['type_cn'];
$order['dateline'] = $order['dateline'] ? date('Y-m-d', $order['dateline']) : date('Y-m-d');
//初始化车系和车型
$eseries = pdo_fetchall('SELECT id,title FROM ' . tablename('we7car_series') . " WHERE `weid` = :weid AND `bid` = :bid AND `status` = 1 ORDER BY listorder DESC", array(':weid' => $_W['uniacid'], ':bid' => $order['brand']));
$etypes = pdo_fetchall('SELECT id,title FROM ' . tablename('we7car_type') . " WHERE `weid` = :weid AND `sid` = :sid AND `status` = 1 ORDER BY listorder DESC", array(':weid' => $_W['uniacid'], ':sid' => $order['serie']));
if (!empty($ds)) {
//如果有自定义字段
$fieldsdata = pdo_fetchall("SELECT * FROM " . tablename('we7car_order_data') . " WHERE `srid` = :srid ", array(':srid' => $lid));
if ($fieldsdata) {
foreach ($fieldsdata as $fielddata) {
$order['data'][$fielddata['sfid']] = $fielddata['data'];
}
}
}
} else {
$order['dateline'] = date('Y-m-d');
}
if (checksubmit('submit')) {
$sid = intval($reply['id']);
//某条预约的id
if ($pererror == 1 && !$lid) {
message("没人可预约{$reply['pertotal']}次.");
}
if (!$sid) {
message('预约信息获取失败.');
}
//更新粉丝的手机号和姓名
if ($userinfo == '0') {
fans_update($_W['fans']['from_user'], array('realname' => trim($_GPC['realname']), 'mobile' => trim($_GPC['tel'])));
}
$barr = explode('=', trim($_GPC['brand']));
$sarr = explode('=', trim($_GPC['serie']));
$tarr = explode('=', trim($_GPC['types']));
$insert = array('sid' => $sid, 'from_user' => $_W['fans']['from_user'], 'username' => trim($_GPC['realname']), 'mobile' => trim($_GPC['tel']), 'dateline' => strtotime($_GPC['dateline']), 'yytype' => intval($_GPC['yytype']), 'brand' => $barr[0], 'brand_cn' => $barr[1], 'serie' => $sarr[0], 'serie_cn' => $sarr[1], 'type' => $tarr[0], 'type_cn' => $tarr[1], 'note' => trim($_GPC['note']), 'createtime' => TIMESTAMP);
foreach ($_GPC as $key => $value) {
if (strexists($key, 'field_')) {
$sfid = intval(str_replace('field_', '', $key));
$field = $fields[$sfid];
if ($sfid && $field) {
$entry = array();
$entry['sid'] = $sid;
$entry['srid'] = 0;
$entry['sfid'] = $sfid;
$entry['createtime'] = TIMESTAMP;
$entry['data'] = strval($value);
$datas[] = $entry;
}
}
}
if (!$lid) {
if (pdo_insert('we7car_order_list', $insert) != 1) {
message('保存失败.');
}
$rid = pdo_insertid();
if (empty($rid)) {
message('保存失败.');
}
if (!empty($datas)) {
foreach ($datas as &$r) {
$r['srid'] = $rid;
pdo_insert('we7car_order_data', $r);
}
}
} else {
if (pdo_update('we7car_order_list', $insert, array('id' => $lid)) != 1) {
message('更新订单失败.');
}
if (!empty($datas)) {
foreach ($datas as &$r) {
$r['srid'] = $lid;
pdo_update('we7car_order_data', $r, array('sfid' => $r['sfid'], 'srid' => $lid));
}
}
}
message('成功', $this->createMobileUrl('mybook', array('yytype' => $insert['yytype'])), 'success');
}
include $this->template('yuyue');
}
开发者ID:nsoff,项目名称:wdlcms,代码行数:101,代码来源:site.php
示例12: setOrderCredit
public function setOrderCredit($orderid, $add = true)
{
$order = pdo_fetch("SELECT * FROM " . tablename('shopping_order') . " WHERE id = :id limit 1", array(':id' => $orderid));
if (empty($order)) {
return;
}
$ordergoods = pdo_fetchall("SELECT goodsid, total FROM " . tablename('shopping_order_goods') . " WHERE orderid = '{$orderid}'", array(), 'goodsid');
if (!empty($ordergoods)) {
$goods = pdo_fetchall("SELECT id, title, thumb, marketprice, unit, total,credit FROM " . tablename('shopping_goods') . " WHERE id IN ('" . implode("','", array_keys($ordergoods)) . "')");
}
//增加积分
if (!empty($goods)) {
$credits = 0;
foreach ($goods as $g) {
$credits += $g['credit'];
}
$fans = fans_search($order['from_user'], array("credit1"));
if (!empty($fans)) {
if ($add) {
$new_credit = $credits + $fans['credit1'];
} else {
$new_credit = $fans['credit1'] - $credits;
if ($new_credit <= 0) {
$new_credit = 0;
}
}
fans_update($order['from_user'], array("credit1" => $new_credit));
}
}
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:30,代码来源:site.php
示例13: doMobileOrder
//.........这里部分代码省略.........
$pricefield = $isauto == 1 ? "cprice" : "mprice";
$params = array(":weid" => $weid, ":hotelid" => $hid);
$r_sql = "SELECT roomdate, num, status, " . $pricefield . " as m_price FROM " . tablename('hotel2_room_price');
$r_sql .= " WHERE 1 = 1";
$r_sql .= " AND roomid = " . $id;
$r_sql .= " AND weid = :weid";
$r_sql .= " AND hotelid = :hotelid";
$r_sql .= " AND roomdate >=" . $btime . " AND roomdate <" . $etime;
$price_list = pdo_fetchall($r_sql, $params);
$this_price = $old_price = $room['roomprice'];
$totalprice = $old_price * $days;
if ($price_list) {
//价格表中存在
$check_date = array();
foreach ($price_list as $k => $v) {
$new_price = $v['m_price'];
$roomdate = $v['roomdate'];
if ($v['status'] == 0 || $v['num'] == 0) {
$has = 0;
} else {
if ($new_price && $roomdate) {
if (!in_array($roomdate, $check_date)) {
$check_date[] = $roomdate;
if ($old_price != $new_price) {
$totalprice = $totalprice - $old_price + $new_price;
}
}
}
}
}
$this_price = round($totalprice / $days);
}
//print_r($this_price);exit;
if ($is_submit) {
$from_user = $this->_from_user;
$name = $_GPC['uname'];
$contact_name = $_GPC['contact_name'];
$mobile = $_GPC['mobile'];
if (empty($name)) {
die(json_encode(array("result" => 0, "error" => "入住人不能为空!")));
}
if (empty($contact_name)) {
die(json_encode(array("result" => 0, "error" => "联系人不能为空!")));
}
if (empty($mobile)) {
die(json_encode(array("result" => 0, "error" => "手机号不能为空!")));
}
if ($_GPC['nums'] > $max_room) {
die(json_encode(array("result" => 0, "error" => "您的预定数量超过最大限制!")));
}
$data = array('realname' => $name, 'mobile' => $mobile);
fans_update($from_user, $data);
pdo_update("hotel2_member", $data, array("from_user" => $from_user));
$insert = array('weid' => $weid, 'ordersn' => date('md') . sprintf("%04d", $_W['fans']['id']) . random(4, 1), 'hotelid' => $hid, 'openid' => $from_user, 'roomid' => $id, 'memberid' => $memberid, 'name' => $name, 'contact_name' => $contact_name, 'mobile' => $mobile, 'btime' => $search_array['btime'], 'etime' => $search_array['etime'], 'day' => $search_array['day'], 'style' => $room['title'], 'nums' => intval($_GPC['nums']), 'oprice' => $room['oprice'], 'cprice' => $room['cprice'], 'mprice' => $room['mprice'], 'time' => time(), 'paytype' => $_GPC['paytype']);
$insert[$pricefield] = $this_price;
$insert['sum_price'] = $totalprice * $insert['nums'];
// $is_repeat = check_orderinfo($insert);
// if ($is_repeat == 1){
// die(json_encode(array("result" => 0, "error" => "您已经预定成功,请不要重复提交")));
// }
pdo_insert('hotel2_order', $insert);
$order_id = pdo_insertid();
//如果有接受订单的邮件,
if (!empty($reply['mail'])) {
$subject = "微信公共帐号 [" . $_W['account']['name'] . "] 微酒店订单提醒.";
$body = "您后台有一个预定订单: <br/><br/>";
$body .= "预定酒店: " . $reply['title'] . "<br/>";
$body .= "预定房型: " . $room['title'] . "<br/>";
$body .= "预定数量: " . $insert['nums'] . "<br/>";
$body .= "预定价格: " . $insert['sum_price'] . "<br/>";
$body .= "预定人: " . $insert['name'] . "<br/>";
$body .= "预定电话: " . $insert['mobile'] . "<br/>";
$body .= "到店时间: " . $bdate . "<br/>";
$body .= "离店时间: " . $edate . "<br/><br/>";
//$body .= "到店时间: " . $_GPC['btime'] . "<br/>";
//$body .= "离店时间: " . $_GPC['btime'] . "<br/><br/>";
$body .= "请您到管理后台仔细查看. <a href='" . $_W['siteroot'] . create_url('member/login') . "' target='_blank'>立即登录后台</a>";
$result = ihttp_email($reply['mail'], $subject, $body);
}
//$url = $this->createMobileUrl('index');
$url = $this->createMobileUrl('orderdetail', array('id' => $order_id));
die(json_encode(array("result" => 1, "url" => $url)));
} else {
$price = $totalprice;
$member = array();
$member['from_user'] = $this->_from_user;
$record = hotel_member_single($member);
if ($record) {
$realname = $record['realname'];
$mobile = $record['mobile'];
} else {
$fans = pdo_fetch("SELECT id, realname, mobile FROM " . tablename('fans') . " WHERE from_user = :from_user limit 1", array(':from_user' => $this->_from_user));
if (!empty($fans)) {
$realname = $fans['realname'];
$mobile = $fans['mobile'];
}
}
include $this->template('order');
}
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:101,代码来源:site.php
示例14: doMobileFeedback
public function doMobileFeedback()
{
global $_GPC, $_W;
$storeid = intval($_GPC['storeid']);
$nickname = trim($_GPC['nick']);
$content = trim($_GPC['content']);
$fromuser = trim($_GPC['fromuser']);
if (isset($_COOKIE[$this->_auth2_openid])) {
$fromuser = $_COOKIE[$this->_auth2_openid];
}
if (isset($_COOKIE[$this->_auth2_nickname])) {
$nickname = $_COOKIE[$this->_auth2_nickname];
}
$result = array('status' => 0, 'msg' => '留言失败,请稍后重试...');
$data = array('weid' => $_W['uniacid'], 'storeid' => $storeid, 'from_user' => $fromuser, 'nickname' => $nickname, 'content' => $content, 'dateline' => TIMESTAMP);
$setting = pdo_fetch("SELECT * FROM " . tablename($this->modulename . '_setting') . " WHERE weid = :weid ", array(':weid' => $_W['uniacid']));
if (!empty($setting)) {
if ($setting['feedback_check_enable'] == 1) {
$data['status'] = 0;
} else {
$data['status'] = 1;
}
} else {
$data['status'] = 1;
}
if (empty($data['from_user'])) {
$result['msg'] = '会话已过期,请从微信界面重新发送关键字进入.';
die(json_encode($result));
}
if (empty($data['nickname'])) {
$result['msg'] = '请输入昵称.';
die(json_encode($result));
}
if (empty($data['content'])) {
$result['msg'] = '请输入留言内容.';
die(json_encode($result));
}
$rowcount = pdo_insert('weisrc_businesscenter_feedback', $data);
if ($rowcount > 0) {
fans_update($data['from_user'], array('nickname' => $nickname));
$result['status'] = 1;
$result['msg'] = '操作成功!';
}
echo json_encode($result);
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:45,代码来源:site.php
示例15: doMobileScoreSubmit
public function doMobileScoreSubmit()
{
global $_W, $_GPC;
// 检查人数是否超过上限
$this->checkAuth();
$this->checkPaperState();
$usermark = $this->calcUserMark($_GPC['choice']);
$scoreRecord = array('from_user' => $_W['fans']['from_user'], 'paper_id' => $_GPC['paper_id'], 'paper_title' => $_GPC['paper_title'], 'choice_ids' => iserializer($_GPC['answer']), 'user_choices' => iserializer($_GPC['choice']), 'usermark' => $usermark, 'createtime' => time(), 'weid' => $_W['weid']);
pdo_insert($this->table_score, $scoreRecord);
// URL自动获取逻辑参考~/weixin/source/controller/site/nav.ctrl.php +145
$paper = $this->getPaper($_GPC['paper_id']);
if ($paper['redirect_cond'] <= $usermark) {
if ($paper['credit_award'] > 0) {
$msg = "本卷得分{$usermark}分<br> 获得{$paper['credit_award']}积分的奖励。";
$fans = fans_search($_W['fans']['from_user'], array('credit1'));
fans_update($_W['fans']['from_user'], array('credit1' => $fans['credit1'] + $paper['credit_award']));
} else {
$msg = "本卷得分{$usermark}分";
}
} else {
message("您的得分是{$usermark},没有达到{$paper['redirect_cond']}分的及格线。将自动跳转到试题解析页面...", $this->createMobileUrl('MyPaper'), 'error');
}
include $this->template('result');
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:24,代码来源:site.php
示例16: doMobileReady
public function doMobileReady()
{
global $_GPC, $_W;
$this->check_member();
$id = intval($_GPC['id']);
if (empty($id)) {
exit;
}
$weid = $_W['weid'];
$member_info = $this->getMemberInfo();
$paper_info = $this->getPaperInfo($id);
//print_r($paper_info);exit;
if (checksubmit()) {
$username = trim($_GPC['username']);
$mobile = trim($_GPC['mobile']);
$email = trim($_GPC['email']);
$data = array();
$data['realname'] = $username;
$data['mobile'] = $mobile;
fans_update($this->_from_user, $data);
//更新用户信息
$array = array();
$array['username'] = $username;
$array['mobile'] = $mobile;
$array['email'] = $email;
$params = array();
$params['from_user'] = $this->_from_user;
$params['weid'] = $weid;
pdo_update('ewei_exam_member', $array, $params);
//更新考试人数记录
$this->updatePaperMemberNum($id, 1);
//插入学员考试记录
$data = array();
$data['weid'] = $weid;
$data['paperid'] = $id;
$data['memberid'] = $member_info['id'];
$data['times'] = 0;
$data['countdown'] = $paper_info['times'] * 60;
$data['score'] = 0;
$data['did'] = 0;
$data['createtime'] = time();
pdo_insert('ewei_exam_paper_member_record', $data);
$recordid = pdo_insertid();
$url = $this->createMobileUrl('start', array('paperid' => $id, 'recordid' => $recordid, 'page' => 1));
die(json_encode(array("result" => 1, "url" => $url)));
} else {
//更新访问人数记录
$fans = fans_search($_W['fans']['from_user'], array('nickname', 'email', 'mobile'));
$this->updatePaperMemberNum($id, 0);
include $this->template('ready');
}
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:52,代码来源:site.php
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1291|2022-08-30
-
惰性删除惰性删除策略对CPU 时间来说是最友好的:程序只会在取出键时才对键进行过期检
阅读:554|2022-07-18
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1204|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:1001|2022-11-06
-
The bin-collect package in PyPI before v0.1 included a code execution backdoor i
阅读:597|2022-07-29
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1401|2022-08-18
-
yuxtech/ShiJihuai-complex: 史济怀复变函数LaTeX重排
阅读:870|2022-08-12
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:518|2022-08-16
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:669|2022-11-06
-
A vulnerability, which was classified as critical, has been found in Itech Freel
阅读:682|2022-07-29
|
请发表评论