当前位置: 首页>>代码示例>>PHP>>正文


PHP mc_fetch函数代码示例

本文整理汇总了PHP中mc_fetch函数的典型用法代码示例。如果您正苦于以下问题:PHP mc_fetch函数的具体用法?PHP mc_fetch怎么用?PHP mc_fetch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mc_fetch函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fans_search

 public static function fans_search($from_user, $fields = array())
 {
     //    $uid = pdo_fetchcolumn("SELECT a.uid FROM "
     //      . tablename('mc_mapping_fans') . " a inner join "
     //      . tablename('mc_members') . " b on a.uid=b.uid "
     //      . " WHERE a.openid='{$from_user}' LIMIT 1");
     //    return fans_search($uid, $fields);
     load()->model('mc');
     $uid = mc_openid2uid($from_user);
     return mc_fetch($uid, $fields);
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:11,代码来源:wechatutil.php

示例2: fans_search

 function fans_search($user, $fields = array())
 {
     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 array();
         }
     }
     return mc_fetch($uid, $fields);
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:13,代码来源:compat.biz.func.php

示例3: formot_content

function formot_content($content = '')
{
    global $_W;
    if (empty($content)) {
        return $content;
    }
    load()->model('mc');
    $user = mc_fetch($_W['member']['uid']);
    $replace = pdo_fetchall("SELECT * FROM " . tablename('abc_replace') . " WHERE uniacid = :uniacid ", array(':uniacid' => $_W['uniacid']));
    //print_r($replace);
    foreach ($replace as $re) {
        $content = str_replace($re['replace'], $user[$re['name']], $content);
    }
    return $content;
}
开发者ID:eduNeusoft,项目名称:weixin,代码行数:15,代码来源:site.php

示例4: doMobileIndex

 public function doMobileIndex()
 {
     global $_W, $_GPC;
     if (empty($_W['fans']['openid'])) {
         message('请先关注公众号再来参加活动吧!');
     }
     $rid = intval($_GPC['rid']);
     $sql = 'SELECT * FROM ' . tablename('weihaom_wb_reply') . ' WHERE `rid` = :rid';
     $params = array(':rid' => $rid);
     $set = pdo_fetch($sql, $params);
     if (empty($set)) {
         message('活动不存在或已经被删除');
     }
     $sql = 'SELECT * FROM ' . tablename('weihaom_wb_user') . ' WHERE `weid` = :weid AND `rid` = :rid AND
             `from_user` = :openid';
     $params[':weid'] = $_W['uniacid'];
     $params[':openid'] = $_W['fans']['openid'];
     $user = pdo_fetch($sql, $params);
     if (intval($_GPC['id'])) {
         $score = intval($_GPC['score']);
         if ($user['score'] < $score) {
             $user['score'] = $score;
             $update = array('score' => $score);
             pdo_update('weihaom_wb_user', $update, array('id' => intval($_GPC['id'])));
         }
         message($user['score'], '', 'ajax');
     }
     if (empty($user)) {
         $result = mc_fetch($_W['member']['uid'], array('nickname'));
         $insert = array('weid' => $_W['uniacid'], 'rid' => $params[':rid'], 'from_user' => $_W['fans']['openid'], 'realname' => $result['nickname'], 'score' => 0);
         pdo_insert('weihaom_wb_user', $insert);
         $user = array('id' => pdo_insertid());
     }
     $realname = $_W['fans']['nickname'];
     $set['description'] = str_replace("\r\n", '', $set['description']);
     include $this->template('index');
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:37,代码来源:site.php

示例5: doMobileLottery

 public function doMobileLottery()
 {
     global $_GPC, $_W;
     checkauth();
     load()->model('mc');
     mc_require($_W['member']['uid'], array('realname', 'mobile'), '需要完善资料后才能砸蛋.');
     $where = ' WHERE `rid` = :rid';
     $params = array(':rid' => intval($_GPC['id']));
     $sql = 'SELECT * FROM ' . tablename('egg_reply') . $where;
     $egg = pdo_fetch($sql, $params);
     if (empty($egg)) {
         message('非法访问,请重新发送消息进入砸蛋页面!');
     }
     if (TIMESTAMP < $egg['starttime']) {
         message('活动还没有开始!');
     }
     if (TIMESTAMP > $egg['endtime']) {
         message('活动已经结束啦!');
     }
     $where .= ' AND `uniacid` = :uniacid AND `uid` = :uid';
     $params[':uniacid'] = $_W['uniacid'];
     $params[':uid'] = $_W['member']['uid'];
     $params[':createtime'] = strtotime(date('Y-m-d'));
     // 当日砸蛋次数
     $sql = 'SELECT COUNT(*) FROM ' . tablename('egg_winner') . $where . ' AND `createtime` > :createtime';
     $total = pdo_fetchcolumn($sql, $params);
     // 会员信息
     $member = mc_fetch($_W['member']['uid'], array('realname', 'mobile'));
     // 我的奖品
     $sql = 'SELECT `award`, `description` FROM ' . tablename('egg_winner') . $where . ' ORDER BY `createtime` DESC';
     unset($params[':createtime']);
     $myAward = pdo_fetchall($sql, $params);
     // 中奖名单
     $sql = 'SELECT `award`, `realname` FROM ' . tablename('egg_winner') . ' AS `w` JOIN ' . tablename('mc_members') . ' AS `m` ON `w`.`uid` = `m`.`uid` WHERE `rid` = :rid ORDER BY `w`.`id` DESC LIMIT 20';
     $otherAward = pdo_fetchall($sql, array(':rid' => $params[':rid']));
     // 分享信息
     $shareTitle = empty($egg['title']) ? '砸蛋抽奖' : $egg['title'];
     $shareDesc = $egg['description'];
     $shareImage = tomedia($egg['picture']);
     include $this->template('lottery');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:41,代码来源:site.php

示例6: doWebSharelist

 public function doWebSharelist()
 {
     global $_GPC, $_W;
     if ($_W['isajax']) {
         $uid = intval($_GPC['uid']);
         $rid = intval($_GPC['rid']);
         //粉丝数据
         $data = pdo_fetch("SELECT id, fansID, realname, mobile, from_user  FROM " . tablename('stonefish_redenvelope_fans') . ' WHERE id = :id AND uniacid = :uniacid', array(':uniacid' => $_W['uniacid'], ':id' => $uid));
         if ($data['fansID']) {
             load()->model('mc');
             $profile = mc_fetch($data['fansID'], array('realname', 'mobile'));
         }
         $share = pdo_fetchall("SELECT * FROM " . tablename('stonefish_redenvelope_data') . "  WHERE rid = :rid and uniacid=:uniacid and fromuser=:fromuser ORDER BY id DESC ", array(':uniacid' => $_W['uniacid'], ':rid' => $rid, ':fromuser' => $data['from_user']));
         include $this->template('sharelist');
         exit;
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:17,代码来源:site.php

示例7: activity_module_card_grant

function activity_module_card_grant($uid, $couponid, $module = '', $remark = '')
{
    global $_W;
    $uid = intval($uid);
    $user = mc_fetch($uid, array('groupid'));
    $groupid = $user['groupid'];
    $couponid = intval($couponid);
    $coupon = pdo_fetch("SELECT * FROM " . tablename('activity_coupon') . " WHERE `couponid` = :couponid LIMIT 1", array(':couponid' => $couponid));
    $pcount = pdo_fetchcolumn("SELECT count(*) FROM " . tablename('activity_coupon_record') . " WHERE `uid` = :uid AND `couponid` = :couponid", array(':couponid' => $couponid, ':uid' => $uid));
    $coupongroup = pdo_fetchall("SELECT groupid FROM " . tablename('activity_coupon_allocation') . " WHERE `couponid` = :couponid", array(':couponid' => $couponid), 'groupid');
    $group = array_keys($coupongroup);
    $couponmodules = pdo_fetchall("SELECT module FROM " . tablename('activity_coupon_modules') . " WHERE `couponid` = :couponid", array(':couponid' => $couponid), 'module');
    $modules = array_keys($couponmodules);
    if (empty($coupon)) {
        return error(-1, '未找到指定优惠券');
    } elseif (!in_array($module, $modules)) {
        return error(-1, '该优惠券只能在特定的模块中领取');
    } elseif (empty($coupongroup)) {
        return error(-1, '该优惠券未指定可使用的会员组');
    } elseif (!in_array($groupid, $group)) {
        return error(-1, '您所在的用户组没有领取该优惠券的权限');
    } elseif ($coupon['starttime'] > TIMESTAMP) {
        return error(-1, '优惠券活动尚未开始');
    } elseif ($coupon['endtime'] < TIMESTAMP) {
        return error(-1, '优惠券活动已经结束');
    } elseif ($coupon['dosage'] >= $coupon['amount']) {
        return error(-1, '优惠券已经发放完毕');
    } elseif ($pcount >= $coupon['limit']) {
        return error(-1, '用户领取优惠券数量已经超过限制');
    }
    $creditnames = array();
    $unisettings = uni_setting($_W['uniacid'], array('creditnames'));
    if (!empty($unisettings) && !empty($unisettings['creditnames'])) {
        foreach ($unisettings['creditnames'] as $key => $credit) {
            $creditnames[$key] = $credit['title'];
        }
    }
    $credit = mc_credit_fetch($uid, array($coupon['credittype']));
    if ($credit[$coupon['credittype']] < $coupon['credit']) {
        return error(-1, '您的' . $creditnames[$coupon['credittype']] . '数量不够,无法兑换.');
    }
    mc_credit_update($uid, $coupon['credittype'], -1 * $coupon['credit'], array($uid, '优惠券兑换:' . $coupon['title'] . ' 消耗 ' . $creditnames[$coupon['credittype']] . ':' . $coupon['credit']));
    $remark = "通过{$module}模块领取优惠券";
    $insert = array('couponid' => $couponid, 'uniacid' => $_W['uniacid'], 'uid' => $uid, 'grantmodule' => $module, 'granttime' => TIMESTAMP, 'status' => 1, 'remark' => $remark);
    pdo_insert('activity_coupon_record', $insert);
    pdo_update('activity_coupon', array('dosage' => $coupon['dosage'] + 1), array('couponid' => $couponid));
    return $coupon;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:48,代码来源:activity.mod.php

示例8: FM_checkoauth

 private function FM_checkoauth()
 {
     global $_GPC, $_W;
     $uniacid = !empty($_W['uniacid']) ? $_W['uniacid'] : $_W['acid'];
     load()->model('mc');
     $openid = '';
     $nickname = '';
     $avatar = '';
     $follow = '';
     if (!empty($_W['member']['uid'])) {
         $member = mc_fetch(intval($_W['member']['uid']), array('avatar', 'nickname'));
         if (!empty($member)) {
             $avatar = $member['avatar'];
             $nickname = $member['nickname'];
         }
     }
     if (empty($avatar) || empty($nickname)) {
         $fan = mc_fansinfo($_W['openid']);
         if (!empty($fan)) {
             $avatar = $fan['avatar'];
             $nickname = $fan['nickname'];
             $openid = $fan['openid'];
             $follow = $fan['follow'];
         }
     }
     if (empty($avatar) || empty($nickname) || empty($openid) || empty($follow)) {
         $userinfo = mc_oauth_userinfo();
         if (!is_error($userinfo) && !empty($userinfo) && is_array($userinfo) && !empty($userinfo['avatar'])) {
             $avatar = $userinfo['avatar'];
         }
         if (!is_error($userinfo) && !empty($userinfo) && is_array($userinfo) && !empty($userinfo['nickname'])) {
             $nickname = $userinfo['nickname'];
         }
         if (!is_error($userinfo) && !empty($userinfo) && is_array($userinfo) && !empty($userinfo['openid'])) {
             $openid = $userinfo['openid'];
         }
         if (!is_error($userinfo) && !empty($userinfo) && is_array($userinfo) && !empty($userinfo['follow'])) {
             $follow = $userinfo['follow'];
         }
     }
     if ((empty($avatar) || empty($nickname)) && !empty($_W['member']['uid'])) {
     }
     $oauthuser = array();
     $oauthuser['avatar'] = $avatar;
     $oauthuser['nickname'] = $nickname;
     $oauthuser['from_user'] = $openid;
     $oauthuser['follow'] = !empty($follow) ? $follow : $_W['fans']['follow'];
     return $oauthuser;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:49,代码来源:site.php

示例9: booking

 private function booking($message)
 {
     global $_W;
     $setting = uni_setting($_W['uniacid'], array('passport'));
     load()->model('mc');
     $fans = mc_fansinfo($message['from']);
     if (!empty($fans)) {
         $rec = array();
         if (!empty($fans['follow'])) {
             if ($message['event'] == 'unsubscribe') {
                 $rec['follow'] = 0;
                 $rec['followtime'] = 0;
                 $rec['unfollowtime'] = $message['time'];
             }
         } else {
             if ($message['event'] != 'unsubscribe' && $message['event'] != 'ShakearoundUserShake') {
                 $rec['follow'] = 1;
                 $rec['followtime'] = $message['time'];
                 $rec['unfollowtime'] = 0;
             }
         }
         $member = array();
         if (!empty($fans['uid'])) {
             $member = mc_fetch($fans['uid']);
         }
         if (empty($member)) {
             if (!isset($setting['passport']) || empty($setting['passport']['focusreg'])) {
                 $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid']));
                 $data = array('uniacid' => $_W['uniacid'], 'email' => md5($message['from']) . '@we7.cc', 'salt' => random(8), 'groupid' => $default_groupid, 'createtime' => TIMESTAMP);
                 $data['password'] = md5($message['from'] . $data['salt'] . $_W['config']['setting']['authkey']);
                 pdo_insert('mc_members', $data);
                 $rec['uid'] = pdo_insertid();
             }
         }
         if (!empty($rec)) {
             pdo_update('mc_mapping_fans', $rec, array('acid' => $_W['acid'], 'openid' => $message['from'], 'uniacid' => $_W['uniacid']));
         }
     } else {
         $rec = array();
         $rec['acid'] = $_W['acid'];
         $rec['uniacid'] = $_W['uniacid'];
         $rec['uid'] = 0;
         $rec['openid'] = $message['from'];
         $rec['salt'] = random(8);
         if ($message['event'] == 'unsubscribe') {
             $rec['follow'] = 0;
             $rec['followtime'] = 0;
             $rec['unfollowtime'] = $message['time'];
         } else {
             $rec['follow'] = 1;
             $rec['followtime'] = $message['time'];
             $rec['unfollowtime'] = 0;
         }
         if (!isset($setting['passport']) || empty($setting['passport']['focusreg'])) {
             $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid']));
             $data = array('uniacid' => $_W['uniacid'], 'email' => md5($message['from']) . '@we7.cc', 'salt' => random(8), 'groupid' => $default_groupid, 'createtime' => TIMESTAMP);
             $data['password'] = md5($message['from'] . $data['salt'] . $_W['config']['setting']['authkey']);
             pdo_insert('mc_members', $data);
             $rec['uid'] = pdo_insertid();
         }
         pdo_insert('mc_mapping_fans', $rec);
     }
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:63,代码来源:api.php

示例10: iunserializer

            $map_fans = iunserializer($map_fans);
        }
        if (!empty($map_fans) && is_array($map_fans)) {
            empty($profile['nickname']) ? $data['nickname'] = $map_fans['nickname'] : '';
            empty($profile['gender']) ? $data['gender'] = $map_fans['sex'] : '';
            empty($profile['residecity']) ? $data['residecity'] = $map_fans['city'] ? $map_fans['city'] . '市' : '' : '';
            empty($profile['resideprovince']) ? $data['resideprovince'] = $map_fans['province'] ? $map_fans['province'] . '省' : '' : '';
            empty($profile['nationality']) ? $data['nationality'] = $map_fans['country'] : '';
            empty($profile['avatar']) ? $data['avatar'] = rtrim($map_fans['headimgurl'], '0') . 132 : '';
            if (!empty($data)) {
                mc_update($_W['member']['uid'], $data);
            }
        }
    }
}
$profile = mc_fetch($_W['member']['uid']);
if (!empty($profile)) {
    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]);
开发者ID:legeng,项目名称:project-2,代码行数:31,代码来源:profile.ctrl.php

示例11: defined

<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$dos = array('display', 'detail');
$do = in_array($do, $dos) ? $do : 'display';
if ($do == 'display') {
    $profile = mc_fetch($_W['member']['uid'], array('nickname', 'avatar', 'mobile', 'groupid'));
    $mcgroups = mc_groups();
    $profile['group'] = $mcgroups[$profile['groupid']];
    $stores = pdo_fetchall('SELECT * FROM ' . tablename('activity_stores') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid']));
}
if ($do == 'detail') {
    $id = intval($_GPC['id']);
    $store = pdo_get('activity_stores', array('uniacid' => $_W['uniacid'], 'id' => $id));
    if (empty($store)) {
        message('门店不存在或已删除', referer(), 'error');
    }
    $store['photo_list'] = iunserializer($store['photo_list']);
    $store['category'] = iunserializer($store['category']);
}
template('mc/store');
开发者ID:zhang19960118,项目名称:html11,代码行数:25,代码来源:store.ctrl.php

示例12: random

        $salt = random(8);
        $data = array('uniacid' => $_W['uniacid'], 'realname' => $realname, 'mobile' => $mobile, 'email' => $email, 'salt' => $salt, 'password' => md5(trim($_GPC['password']) . $salt . $_W['config']['setting']['authkey']), 'credit1' => intval($_GPC['credit1']), 'credit2' => intval($_GPC['credit2']), 'groupid' => intval($_GPC['groupid']), 'createtime' => TIMESTAMP);
        pdo_insert('mc_members', $data);
        $uid = pdo_insertid();
        message('添加会员成功,将进入编辑页面', url('mc/member/post', array('uid' => $uid)), 'success');
    }
}
if ($do == 'group') {
    if ($_W['isajax']) {
        $id = intval($_GPC['id']);
        $group = $_W['account']['groups'][$id];
        if (empty($group)) {
            exit('会员组信息不存在');
        }
        $uid = intval($_GPC['uid']);
        $member = mc_fetch($uid);
        if (empty($member)) {
            exit('会员信息不存在');
        }
        $credit = intval($group['credit']);
        $credit6 = $credit - $member['credit1'];
        $status = pdo_update('mc_members', array('credit6' => $credit6, 'groupid' => $id), array('uid' => $uid, 'uniacid' => $_W['uniacid']));
        if ($status !== false) {
            $openid = pdo_fetchcolumn('SELECT openid FROM ' . tablename('mc_mapping_fans') . ' WHERE acid = :acid AND uid = :uid', array(':acid' => $_W['acid'], ':uid' => $uid));
            if (!empty($openid)) {
                mc_notice_group($openid, $_W['account']['groups'][$member['groupid']]['title'], $_W['account']['groups'][$id]['title']);
            }
            exit('success');
        } else {
            exit('更新会员信息出错');
        }
开发者ID:wisemyth,项目名称:weizan,代码行数:31,代码来源:member.ctrl.php

示例13: mc_credit_update

    mc_credit_update($_W['member']['uid'], $goods['credittype'], -1 * $goods['credit'], array($_W['member']['uid'], '礼品兑换:' . $goods['title'] . ' 消耗 ' . $creditnames[$goods['credittype']] . ':' . $goods['credit']));
    if ($goods['credittype'] == 'credit1') {
        mc_notice_credit1($_W['openid'], $_W['member']['uid'], -1 * $goods['credit'], '兑换礼品消耗积分');
    } else {
        mc_notice_credit2($_W['openid'], $_W['member']['uid'], -1 * $goods['credit'], 0, '线上消费,兑换礼品');
    }
    message(error($ret, "兑换成功,您消费了 {$goods['credit']} {$creditnames[$goods['credittype']]},现在去完善订单信息"), '', 'ajax');
}
if ($do == 'deliver') {
    load()->func('tpl');
    $tid = intval($_GPC['tid']);
    $ship = pdo_fetch('SELECT * FROM ' . tablename('activity_exchange_trades_shipping') . ' WHERE uid = :uid AND tid = :tid', array(':uid' => $_W['member']['uid'], ':tid' => $tid));
    if (empty($ship)) {
        message('没有找到该兑换的收货人信息', '', 'error');
    }
    $member = mc_fetch($_W['member']['uid'], array('uid', 'realname', 'resideprovince', 'residecity', 'residedist', 'address', 'zipcode', 'mobile'));
    $ship['name'] = !empty($ship['name']) ? $ship['name'] : $member['realname'];
    $ship['province'] = !empty($ship['province']) ? $ship['province'] : $member['resideprovince'];
    $ship['city'] = !empty($ship['city']) ? $ship['city'] : $member['residecity'];
    $ship['district'] = !empty($ship['district']) ? $ship['district'] : $member['residedist'];
    $ship['address'] = !empty($ship['address']) ? $ship['address'] : $member['address'];
    $ship['zipcode'] = !empty($ship['zipcode']) ? $ship['zipcode'] : $member['zipcode'];
    $ship['mobile'] = !empty($ship['mobile']) ? $ship['mobile'] : $member['mobile'];
    if (checksubmit('submit')) {
        $data = array('name' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'province' => $_GPC['reside']['province'], 'city' => $_GPC['reside']['city'], 'district' => $_GPC['reside']['district'], 'address' => $_GPC['address'], 'zipcode' => $_GPC['zipcode']);
        pdo_update('activity_exchange_trades_shipping', $data, array('tid' => $tid, 'uid' => $_W['member']['uid']));
        message('收货人信息更新成功', url('activity/goods/mine'));
    }
}
if ($do == 'mine') {
    $psize = 10;
开发者ID:dalinhuang,项目名称:urWq,代码行数:31,代码来源:goods.ctrl.php

示例14: doMobileMyOrder

 public function doMobileMyOrder()
 {
     global $_W, $_GPC;
     $from_user = $this->getFromUser();
     $op = $_GPC['op'];
     if ($op == 'confirm') {
         $orderid = intval($_GPC['orderid']);
         $order = pdo_fetch("SELECT * FROM " . tablename('eso_sale_order') . " WHERE id = :id AND from_user = :from_user", array(':id' => $orderid, ':from_user' => $from_user));
         if (empty($order)) {
             message('抱歉,您的订单不存在或是已经被取消!', $this->mturl('myorder'), 'error');
         }
         pdo_update('eso_sale_order', array('status' => 3), array('id' => $orderid, 'from_user' => $from_user));
         message('确认收货完成!', $this->mturl('myorder'), 'success');
     } else {
         if ($op == 'detail') {
             $orderid = intval($_GPC['orderid']);
             $item = pdo_fetch("SELECT * FROM " . tablename('eso_sale_order') . " WHERE uniacid = '{$_W['uniacid']}' AND from_user = '" . $from_user . "' and id='{$orderid}' limit 1");
             if (empty($item)) {
                 message('抱歉,您的订单不存或是已经被取消!', $this->mturl('myorder'), 'error');
             }
             $goodsid = pdo_fetchall("SELECT goodsid,total FROM " . tablename('eso_sale_order_goods') . " WHERE orderid = '{$orderid}'", array(), 'goodsid');
             $goods = pdo_fetchall("SELECT g.id, g.title, g.thumb, g.unit, g.marketprice,o.total,o.optionid FROM " . tablename('eso_sale_order_goods') . " o left join " . tablename('eso_sale_goods') . " g on o.goodsid=g.id " . " WHERE o.orderid='{$orderid}'");
             foreach ($goods as &$g) {
                 //属性
                 $option = pdo_fetch("select title,marketprice,weight,stock from " . tablename("eso_sale_goods_option") . " where id=:id limit 1", array(":id" => $g['optionid']));
                 if ($option) {
                     $g['title'] = "[" . $option['title'] . "]" . $g['title'];
                     $g['marketprice'] = $option['marketprice'];
                 }
             }
             unset($g);
             $dispatch = pdo_fetch("select id,dispatchname from " . tablename('eso_sale_dispatch') . " where id=:id limit 1", array(":id" => $item['dispatch']));
             include $this->template('order_detail');
         } else {
             $pindex = max(1, intval($_GPC['page']));
             $psize = 20;
             $status = intval($_GPC['status']);
             $where = " uniacid = '{$_W['uniacid']}' AND from_user = '" . $from_user . "'";
             if ($status == 2) {
                 $where .= " and ( status=1 or status=2 )";
             } else {
                 $where .= " and status={$status}";
             }
             $list = pdo_fetchall("SELECT * FROM " . tablename('eso_sale_order') . " WHERE {$where} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize, array(), 'id');
             $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('eso_sale_order') . " WHERE uniacid = '{$_W['uniacid']}' AND from_user = '" . $from_user . "'");
             $pager = pagination($total, $pindex, $psize);
             if (!empty($list)) {
                 foreach ($list as &$row) {
                     $goods = pdo_fetchall("SELECT g.id, g.title, g.thumb, g.unit, g.marketprice,o.total,o.optionid FROM " . tablename('eso_sale_order_goods') . " o left join " . tablename('eso_sale_goods') . " g on o.goodsid=g.id " . " WHERE o.orderid='{$row['id']}'");
                     foreach ($goods as &$item) {
                         //属性
                         $option = pdo_fetch("select title,marketprice,weight,stock from " . tablename("eso_sale_goods_option") . " where id=:id limit 1", array(":id" => $item['optionid']));
                         if ($option) {
                             $item['title'] = "[" . $option['title'] . "]" . $item['title'];
                             $item['marketprice'] = $option['marketprice'];
                         }
                     }
                     unset($item);
                     $row['goods'] = $goods;
                     $row['total'] = $goodsid;
                     $row['dispatch'] = pdo_fetch("select id,dispatchname from " . tablename('eso_sale_dispatch') . " where id=:id limit 1", array(":id" => $row['dispatch']));
                 }
             }
             $carttotal = $this->getCartTotal();
             load()->model('mc');
             $fans = mc_fetch($_W['member']['uid']);
             include $this->template('order');
         }
     }
 }
开发者ID:noikiy,项目名称:mygit,代码行数:70,代码来源:site.php

示例15: doMobileOrderConfirmUpdate

 public function doMobileOrderConfirmUpdate()
 {
     global $_W, $_GPC;
     $weid = $this->_weid;
     $from_user = $_GPC['from_user'];
     $this->_fromuser = $from_user;
     $orderid = intval($_GPC['orderid']);
     $storeid = intval($_GPC['storeid']);
     $paytype = intval($_GPC['paytype']);
     $order = pdo_fetch("SELECT * FROM " . tablename($this->modulename . '_order') . " WHERE id=:id AND weid=:weid AND storeid=:storeid", array(':id' => $orderid, ':weid' => $weid, ':storeid' => $storeid));
     if (!empty($order)) {
         if ($order['status'] == 1) {
             $this->showMessageAjax('该订单已经确认过了,无需重复提交!', $this->msg_status_bad);
         }
     }
     if ($paytype == 0) {
         pdo_query("UPDATE " . tablename($this->modulename . '_order') . " SET status=1,paytype=:paytype WHERE id=:id", array(':id' => $orderid, ':paytype' => $paytype));
     }
     //余额支付处理
     if ($paytype == 1) {
         //ims_mc_card
         $module = pdo_fetch("SELECT * FROM " . tablename("mc_card") . " WHERE uniacid=:uniacid ", array(':uniacid' => $weid));
         if (empty($module) || $module['status'] == 0) {
             $this->showMessageAjax('系统没开通会员卡功能!', $this->msg_status_bad);
         }
         load()->model('mc');
         $fans = mc_fetch($from_user);
         if (!empty($fans)) {
             $card = pdo_fetch("SELECT * FROM " . tablename("mc_card_members") . " WHERE uniacid=:uniacid AND uid=:uid ", array(':uniacid' => $weid, ':uid' => $fans['uid']));
         }
         if (empty($card)) {
             $this->showMessageAjax('抱歉,您还没有领取会员卡!不能使用余额支付,请选择其它的支付方式!', $this->msg_status_bad);
         } else {
             $totalprice = floatval($order['totalprice']);
             $credit2 = floatval($fans['credit2']);
             if ($credit2 >= $totalprice) {
                 $uid = mc_openid2uid($from_user);
                 $remark = '微点餐余额消费 ' . $totalprice . ' 元 订单ID:' . $orderid;
                 $log = array();
                 $log[0] = $uid;
                 $log[1] = $remark;
                 mc_credit_update($fans['uid'], 'credit2', -$totalprice, $log);
                 pdo_query("UPDATE " . tablename($this->modulename . '_order') . " SET status=2,paytype=1 WHERE id=:id", array(':id' => $orderid));
             } else {
                 $this->showMessageAjax('抱歉,您的余额不足以支付本次消费!不能使用余额支付,请选择其它的支付方式!', $this->msg_status_bad);
             }
         }
         //            $module = $this->checkModule('icard');
         //            if (empty($module)) {
         //                $this->showMessageAjax('系统没开通会员卡功能!', $this->msg_status_bad);
         //            }
         //            //会员卡
         //            $card = get_user_card($from_user);
         //            if (empty($card)) {
         //                $this->showMessageAjax('抱歉,您还没有领取会员卡!不能使用余额支付,请选择其它的支付方式!', $this->msg_status_bad);
         //            } else {
         //                //积分策略
         //                $card_score = get_card_score();
         //                if (!empty($card_score)) {
         //                    //每1元奖励的积分数
         //                    $payx_score = intval($card_score['payx_score']);
         //                    if ($payx_score > 0) {
         //                        $reward_score = intval($payx_score * $order['totalprice']);
         //                    }
         //                }
         //
         //                //更新会员卡余额、总消费金额、剩余积分、总积分、消费积分//card
         //                $sql_update_card_coin = "UPDATE " . tablename('icard_card') . " SET total_score=total_score+:score,balance_score=balance_score+:score,spend_score=spend_score+:score,money=money+:money,coin=coin-:money WHERE from_user=:from_user and weid=:weid";
         //                $execute_rows = pdo_query(
         //                    $sql_update_card_coin,
         //                    array(
         //                        ':score' => $reward_score,
         //                        ':money' => $order['totalprice'],
         //                        ':from_user' => $from_user,
         //                        ':weid' => $weid)
         //                );
         //
         //                if ($execute_rows) {
         //                    //消费金额记录
         //                    $data_money = array(
         //                        'weid' => $_W['uniacid'],
         //                        'from_user' => $from_user,
         //                        'giftid' => $order['id'],
         //                        'type' => 6,
         //                        'payment' => 1, //余额卡消费
         //                        'outletid' => -2,
         //                        'money' => $order['totalprice'],
         //                        'score' => $reward_score,
         //                        'dateline' => TIMESTAMP
         //                    );
         //                    pdo_insert('icard_money_log', $data_money);
         //                    $data_announce = array(
         //                        'weid' => $weid,
         //                        'giftid' => $order['id'],
         //                        'from_user' => $from_user,
         //                        'type' => 6,
         //                        'title' => '微餐饮消费',
         //                        'content' => "您好,您的会员卡于" . date('Y-m-d H:i:s', TIMESTAMP) . "在微点餐使用余额消费订单号为" . $order['ordersn'] . ",本次消费金额为" . $order['totalprice'] . "元,获得" . $reward_score . "个积分。",
         //                        'money' => $order['totalprice']
         //                    );
//.........这里部分代码省略.........
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:101,代码来源:site.php


注:本文中的mc_fetch函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。