本文整理汇总了PHP中coupon::ConsumeCode方法的典型用法代码示例。如果您正苦于以下问题:PHP coupon::ConsumeCode方法的具体用法?PHP coupon::ConsumeCode怎么用?PHP coupon::ConsumeCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coupon
的用法示例。
在下文中一共展示了coupon::ConsumeCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: message
message('更改卡券领取状态成功', referer(), 'success');
}
if ($op == 'consume') {
$id = intval($_GPC['id']);
$record = pdo_fetch('SELECT code,status FROM ' . tablename('coupon_record') . ' WHERE acid = :acid AND id = :id', array(':acid' => $acid, ':id' => $id));
if (empty($record)) {
message('对应code码不存在', referer(), 'error');
}
$pwd = trim($_GPC['pdw']);
if (empty($pwd)) {
message('请输入店员密码', referer(), 'error');
}
$sql = 'SELECT * FROM ' . tablename('activity_coupon_password') . " WHERE `uniacid` = :uniacid AND `password` = :password";
$clerk = pdo_fetch($sql, array(':uniacid' => $_W['uniacid'], ':password' => $pwd));
if (empty($clerk)) {
message('店员密码错误', referer(), 'error');
}
if ($record['status'] == 1) {
load()->classs('coupon');
$acc = new coupon($acid);
$status = $acc->ConsumeCode(array('code' => $record['code']));
if (is_error($status)) {
message($status['message'], '', 'error');
} else {
pdo_update('coupon_record', array('status' => 3, 'clerk_name' => $clerk['name'], 'usetime' => TIMESTAMP), array('acid' => $acid, 'code' => $record['code'], 'id' => $id));
}
}
message('核销卡券成功', referer(), 'success');
}
template('wechat/consume');
}
示例2: exit
defined('IN_IA') or exit('Access Denied');
if (!empty($_W['uniacid'])) {
$sql = 'SELECT * FROM ' . tablename('core_queue') . ' WHERE `uniacid`=:uniacid AND type = 2 ORDER BY `qid` ASC LIMIT 15';
$pars = array();
$pars[':uniacid'] = $_W['uniacid'];
$cards = pdo_fetchall($sql, $pars);
if (!empty($cards)) {
load()->classs('coupon');
foreach ($cards as $li) {
if (!empty($li['acid']) && !empty($li['message'])) {
$acc = new coupon($li['acid']);
$code = $acc->DecryptCode(array('encrypt_code' => $li['message']));
if (is_error($code)) {
continue;
} else {
$sumecode = $acc->ConsumeCode(array('code' => $code['code']));
if (is_error($sumecode)) {
continue;
} else {
pdo_delete('core_queue', array('uniacid' => $_W['uniacid'], 'id' => $li['id']));
pdo_update('coupon_record', array('status' => 3), array('acid' => $li['acid'], 'code' => $code['code'], 'card_id' => $li['params']));
}
}
}
}
}
$sql = 'SELECT * FROM ' . tablename('core_queue') . ' WHERE `uniacid`=:uniacid AND type = 1 ORDER BY `qid` ASC LIMIT 50';
$pars = array();
$pars[':uniacid'] = $_W['uniacid'];
$messages = pdo_fetchall($sql, $pars);
if (!empty($messages)) {