本文整理汇总了PHP中activity_exchange_info函数的典型用法代码示例。如果您正苦于以下问题:PHP activity_exchange_info函数的具体用法?PHP activity_exchange_info怎么用?PHP activity_exchange_info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了activity_exchange_info函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doMobileCheckprize
//.........这里部分代码省略.........
$couponid = $prizes['p1_score'];
$coupon = activity_coupon_info($couponid, $_W['uniacid']);
$ret = activity_coupon_grant($uid, $couponid, 'hx_lottery', '幸运大转盘中奖获得');
if (is_error($ret)) {
//领取错误做等值处理
$remsg = ' 由于' . $ret['message'] . ' 奖品转换为等值' . $this->getcreditname($coupon['credittype']) . ':' . $coupon['credit'];
mc_credit_update($uid, $coupon['credittype'], $coupon['credit'], array('1', '幸运大抽奖 等价 ' . $this->getcreditname($coupon['credittype']) . ':' . $coupon['credit'] . '原因:' . $ret['message']));
}
$detail_url = $_W['siteroot'] . 'app/index.php?i=' . $_W['uniacid'] . '&c=activity&a=coupon&do=mine';
$awarddata = array('reply_id' => $id, 'uid' => $uid, 'name' => '折扣券:' . $coupon['title'], 'prizetype' => 'coupon', 'level' => '1', 'createtime' => time(), 'consumetime' => time(), 'status' => 1);
$title = '折扣券';
$type = '折扣券';
$value = 1;
} elseif ($prizes['p1_type'] == 3) {
//非积分类奖品:代金券
$point = 0;
$tokenid = $prizes['p1_score'];
$token = activity_token_info($tokenid, $_W['uniacid']);
$ret = activity_token_grant($uid, $tokenid, 'hx_lottery', '幸运大转盘中奖获得');
if (is_error($ret)) {
//领取错误做等值处理
$remsg = ' 由于' . $ret['message'] . ' 奖品转换为等值' . $this->getcreditname($token['credittype']) . ':' . $token['credit'];
mc_credit_update($uid, $token['credittype'], $token['credit'], array('1', '幸运大抽奖 等价 ' . $this->getcreditname($token['credittype']) . ':' . $token['credit'] . '原因:' . $ret['message']));
}
$detail_url = $_W['siteroot'] . 'app/index.php?i=' . $_W['uniacid'] . '&c=activity&a=token&do=mine';
$awarddata = array('reply_id' => $id, 'uid' => $uid, 'name' => '折扣券:' . $token['title'], 'prizetype' => 'token', 'level' => '1', 'createtime' => time(), 'consumetime' => time(), 'status' => 1);
$title = '代金券';
$type = '代金券';
$value = 1;
} elseif ($prizes['p1_type'] == 4) {
//非积分类奖品:真实物品
$point = 0;
$goodsid = $prizes['p1_score'];
$goods = activity_exchange_info($goodsid, $_W['uniacid']);
$ret = activity_goods_grant($uid, $goodsid, 'hx_lottery', '幸运大转盘中奖获得');
if (is_error($ret)) {
//领取错误做等值处理
$remsg = ' 由于' . $ret['message'] . ' 奖品转换为等值' . $this->getcreditname($goods['credittype']) . ':' . $goods['credit'];
mc_credit_update($uid, $goods['credittype'], $goods['credit'], array('1', '幸运大抽奖 等价 ' . $this->getcreditname($goods['credittype']) . ':' . $goods['credit'] . '原因:' . $ret['message']));
}
$detail_url = $_W['siteroot'] . 'app/index.php?i=' . $_W['uniacid'] . '&c=activity&a=goods&do=mine';
$awarddata = array('reply_id' => $id, 'uid' => $uid, 'name' => '折扣券:' . $goods['title'], 'prizetype' => 'goods', 'level' => '1', 'createtime' => time(), 'consumetime' => time(), 'status' => 1);
$title = '真实物品券';
$type = '真实物品券';
$value = 1;
}
$award = array('title' => $title, 'value' => $value, 'type' => $type, 'remsg' => $remsg, 'point' => $point, 'point_name' => $point_name, 'give_point' => $give_point, 'give_name' => $give_name, 'level' => '1', 'detail_url' => $detail_url);
} elseif ($result == 'p2') {
if ($prizes['p2_type'] != 2 && $prizes['p2_type'] != 3 && $prizes['p2_type'] != 4) {
//积分类奖品
$point = $prizes['p2_score'];
$point_name = $this->getcreditname($prizes['p2_type']);
mc_credit_update($uid, $prizes['p2_type'], $point, array('1', '幸运大抽奖 中奖获得 ' . $this->getcreditname($prizes['p2_type']) . ':' . $point));
$detail_url = $_W['siteroot'] . 'app/index.php?i=' . $_W['uniacid'] . '&c=mc&a=bond&do=credits&credittype=' . $prizes['p2_type'];
$awarddata = array('reply_id' => $id, 'uid' => $uid, 'name' => $this->getcreditname($prizes['p2_type']) . ':' . $point, 'prizetype' => $prizes['p2_type'], 'level' => '2', 'createtime' => time(), 'consumetime' => time(), 'status' => 1);
} elseif ($prizes['p2_type'] == 2) {
//非积分类奖品:折扣券
$point = 0;
$couponid = $prizes['p2_score'];
$coupon = activity_coupon_info($couponid, $_W['uniacid']);
$ret = activity_coupon_grant($uid, $couponid, 'hx_lottery', '幸运大转盘中奖获得');
if (is_error($ret)) {
//领取错误做等值处理
$remsg = ' 由于' . $ret['message'] . ' 奖品转换为等值' . $this->getcreditname($coupon['credittype']) . ':' . $coupon['credit'];
mc_credit_update($uid, $coupon['credittype'], $coupon['credit'], array('1', '幸运大抽奖 等价 ' . $this->getcreditname($coupon['credittype']) . ':' . $coupon['credit'] . '原因:' . $ret['message']));
}
示例2: activity_module_grant
function activity_module_grant($uid, $exid)
{
global $_W;
$exchange = activity_exchange_info($exid, $_W['uniacid']);
if (empty($exchange)) {
return error(-1, '没有指定的活动参与次数兑换');
}
if ($exchange['starttime'] > TIMESTAMP) {
return error(-1, '该活动参与次数兑换尚未开始');
}
if ($exchange['endtime'] < TIMESTAMP) {
return error(-1, '该活动参与次数兑换已经结束');
}
if ($exchange['pretotal'] > 0) {
$activity_modules = pdo_fetch('SELECT * FROM ' . tablename('activity_modules') . ' WHERE uniacid = :uniacid AND uid = :uid AND exid = :exid AND module = :module', array(':uniacid' => $_W['uniacid'], ':uid' => $uid, 'exid' => $exid, 'module' => $exchange['extra']['name']));
if ($activity_modules) {
$starttime = strtotime(date('Y-m-d')) - intval($exchange['extra']['period']) * 3600 * 24;
$pnum = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('activity_modules_record') . ' WHERE mid = :mid AND num = 1 AND createtime > :createtime', array('mid' => $activity_modules['mid'], ':createtime' => $starttime));
if ($pnum >= $exchange['pretotal']) {
return error(-1, '每人每' . $exchange['extra']['period'] . '天内,只能兑换' . $exchange['pretotal'] . '次');
}
pdo_update('activity_modules', array('available' => $activity_modules['available'] + 1), array('mid' => $activity_modules['mid'], 'uid' => $uid));
} else {
$data = array('uniacid' => $_W['uniacid'], 'uid' => intval($uid), 'exid' => $exid, 'module' => trim($exchange['extra']['name']), 'available' => 1);
pdo_insert('activity_modules', $data);
$activity_modules['mid'] = pdo_insertid();
}
$data = array('mid' => $activity_modules['mid'], 'num' => 1, 'createtime' => TIMESTAMP);
pdo_insert('activity_modules_record', $data);
return true;
} else {
return error(-1, '该兑换活动每人可兑换' . intval($exchange['pretotal']));
}
return true;
}
示例3: pdo_fetchcolumn
if ($do == 'display') {
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('activity_exchange') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime', array(':uniacid' => $_W['uniacid'], ':type' => 3, ':endtime' => TIMESTAMP));
$pindex = max(1, intval($_GPC['page']));
$psize = 10;
$lists = pdo_fetchall('SELECT id,title,extra,thumb,type,credittype,endtime,description,credit FROM ' . tablename('activity_exchange') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize, array(':uniacid' => $_W['uniacid'], ':type' => 3, ':endtime' => TIMESTAMP));
foreach ($lists as &$li) {
$li['extra'] = iunserializer($li['extra']);
if (!is_array($li['extra'])) {
$li['extra'] = array();
}
}
$pager = pagination($total, $pindex, $psize);
}
if ($do == 'post') {
$id = intval($_GPC['id']);
$goods = activity_exchange_info($id, $_W['uniacid']);
if (empty($goods)) {
message(error(-1, '没有指定的礼品兑换'), '', 'ajax');
}
$credit = mc_credit_fetch($_W['member']['uid'], array($goods['credittype']));
if ($credit[$goods['credittype']] < $goods['credit']) {
message(error(-1, "您的 {$creditnames[$token['credittype']]} 数量不够,无法兑换."), '', 'ajax');
}
$ret = activity_goods_grant($_W['member']['uid'], $id, 'system', '用户使用' . $goods['credit'] . $creditnames[$goods['credittype']] . '兑换');
if (is_error($ret)) {
message($ret, '', 'ajax');
}
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 {
示例4: defined
defined('IN_IA') or exit('Access Denied');
$dos = array('display', 'post', 'mine', 'use', 'deliver', 'confirm');
$do = in_array($_GPC['do'], $dos) ? $_GPC['do'] : 'display';
if ($do == 'display') {
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('activity_exchange') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime', array(':uniacid' => $_W['uniacid'], ':type' => 5, ':endtime' => TIMESTAMP));
$pindex = max(1, intval($_GPC['page']));
$psize = 10;
$lists = pdo_fetchall('SELECT id,title,extra,thumb,type,credittype,endtime,description,credit FROM ' . tablename('activity_exchange') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize, array(':uniacid' => $_W['uniacid'], ':type' => 5, ':endtime' => TIMESTAMP));
foreach ($lists as &$li) {
$li['extra'] = iunserializer($li['extra']);
}
$pager = pagination($total, $pindex, $psize);
}
if ($do == 'post') {
$id = intval($_GPC['id']);
$partime = activity_exchange_info($id, $_W['uniacid']);
if (empty($partime)) {
message('没有指定的礼品兑换.');
}
$credit = mc_credit_fetch($_W['member']['uid'], array($partime['credittype']));
if ($credit[$partime['credittype']] < $partime['credit']) {
message('您的' . $creditnames[$partime['credittype']] . '数量不够,无法兑换.');
}
$ret = activity_module_grant($_W['member']['uid'], $id, 'system', '用户使用' . $partime['credit'] . $creditnames[$partime['credittype']] . '兑换');
if (is_error($ret)) {
message($ret['message']);
}
mc_credit_update($_W['member']['uid'], $partime['credittype'], -1 * $partime['credit'], array($_W['member']['uid'], '礼品兑换:' . $partime['title'] . ' 消耗 ' . $creditnames[$partime['credittype']] . ':' . $partime['credit']));
message("兑换成功,您消费了 {$partime['credit']} {$creditnames[$partime['credittype']]}", url('activity/partimes/mine'));
}
if ($do == 'mine') {
示例5: in_array
$type = in_array($type, array(1, 2, 3, 4, 5)) ? $type : 1;
$page = intval($_GPC['__input']['page']);
switch ($type) {
case 1:
case 2:
break;
case 3:
$pindex = max(1, $page);
$psize = 10;
$where = ' WHERE uniacid=:uniacid AND uid=:uid';
$params = array(':uniacid' => $uniacid, ':uid' => $uid);
$sql = 'SELECT * FROM ' . tablename('activity_exchange_trades_shipping') . " {$where} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize;
$list = pdo_fetchall($sql, $params);
if (!empty($list)) {
foreach ($list as &$row) {
$row['exchange'] = activity_exchange_info($row['exid']);
$row['createtime_cn'] = date('Y-m-d', $row['createtime']);
if ($row['status'] == 1) {
$row['status_cn'] = "<a onclick=\"return confirm('确认收货吗?');\" class=\"btn btn-primary\" href=\"" . url('activity/exchange/confirm', array('id' => $row['id'])) . "\">收货</a>";
} else {
$row['status_cn'] = activity_shipping_status_title($row['status']);
}
}
}
if ($_W['isajax'] && $_W['ispost']) {
$list = json_encode($list);
exit($list);
}
break;
case 4:
break;
示例6: message
if (empty($shipping)) {
message('未找到指定兑换礼品或已删除.');
}
if ($shipping['uniacid'] != $_W['uniacid'] || $shipping['status'] != 2) {
message('没有权限删除当前兑换礼品.');
}
pdo_delete('activity_exchange_trades_shipping', array('id' => $id));
message('礼品删除成功.', url('activity/exchange/shipping', array('op' => 'display')), 'success');
} elseif ($op == 'post') {
$id = intval($_GPC['id']);
if (!empty($id)) {
$shipping = activity_exchange_shipping($id);
}
if (empty($shipping)) {
message('未找到指定兑换礼品或已删除.', url('activity/exchange/shipping'), 'error');
}
if (checksubmit('submit')) {
$data = array('name' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'province' => $_GPC['province'], 'city' => $_GPC['city'], 'district' => $_GPC['district'], 'address' => $_GPC['address'], 'zipcode' => $_GPC['zipcode']);
pdo_update('activity_exchange_trades_shipping', $data, array('id' => $id));
message('实物礼品邮递信息修改成功.', url('activity/exchange/shipping', array('op' => 'post', 'id' => $id)), 'success');
} elseif (checksubmit('deliver')) {
$data = array('name' => $_GPC['realname'], 'mobile' => $_GPC['mobile'], 'province' => $_GPC['province'], 'city' => $_GPC['city'], 'district' => $_GPC['district'], 'address' => $_GPC['address'], 'zipcode' => $_GPC['zipcode'], 'status' => 1);
pdo_update('activity_exchange_trades_shipping', $data, array('id' => $id));
message('实物礼品发货成功.', url('activity/exchange/shipping', array('op' => 'post', 'id' => $id)), 'success');
} else {
$exchange = activity_exchange_info($shipping['exid']);
$member = mc_fetch($shipping['uid']);
}
}
template('activity/exchange_shipping');
}