代码拉取完成,页面将自动刷新
<?php
function detail()
{
global $_W;
global $_GPC;
$id = intval($_GPC['id']);
$log = pdo_fetch('select * from ' . tablename('ewei_shop_creditshop_log') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $id, ':uniacid' => $_W['uniacid']));
$log['goods_num'] = max(1, intval($log['goods_num']));
if (empty($log))
{
$this->message('兑换记录不存在!', referer(), 'error');
}
$member = m('member')->getMember($log['openid']);
$goods = $this->model->getGoods($log['goodsid'], $member, $log['optionid']);
$goods['money'] *= $log['goods_num'];
$goods['credit'] *= $log['goods_num'];
if (empty($goods['id']))
{
$this->message('商品记录不存在!', referer(), 'error');
}
$set = m('common')->getPluginset('creditshop');
$canexchange = true;
if ($log['status'] == 2)
{
if (empty($log['paystatus']))
{
$canexchange = false;
}
if (empty($log['dispatchstatus']) && (0 < $log['dispatch']))
{
$canexchange = false;
}
if (($goods['isverify'] == 1) && empty($log['storeid']))
{
$canexchange = false;
}
}
else
{
$canexchange = false;
}
$log['canexchange'] = $canexchange;
$verifys = array();
if (!(empty($goods['isverify'])))
{
if (0 < $log['merchid'])
{
if (!(empty($log['storeid'])))
{
$verifys = pdo_fetchall('select cv.verifytime,cv.verifier,s.storename,s.address,m.realname,m.nickname,m.mobile from ' . tablename('ewei_shop_creditshop_verify') . ' as cv' . "\r\n\t\t\t" . ' left join ' . tablename('ewei_shop_merch_store') . ' as s on s.uniacid = cv.uniacid and s.id = cv.storeid and s.merchid = cv.merchid' . "\r\n\t\t\t" . ' left join ' . tablename('ewei_shop_member') . ' as m on m.openid = cv.verifier and m.uniacid = cv.uniacid ' . "\r\n\t\t\t" . ' where cv.logid = :logid and cv.uniacid = :uniacid order by cv.verifytime DESC ', array(':logid' => $log['id'], ':uniacid' => $_W['uniacid']));
}
}
else if (!(empty($log['storeid'])))
{
$verifys = pdo_fetchall('select cv.verifytime,cv.verifier,s.storename,s.address,m.realname,m.nickname,m.mobile from ' . tablename('ewei_shop_creditshop_verify') . ' as cv' . "\r\n\t\t\t" . ' left join ' . tablename('ewei_shop_store') . ' as s on s.uniacid = cv.uniacid and s.id = cv.storeid' . "\r\n\t\t\t" . ' left join ' . tablename('ewei_shop_member') . ' as m on m.openid = cv.verifier and m.uniacid = cv.uniacid ' . "\r\n\t\t\t" . ' where cv.logid = :logid and cv.uniacid = :uniacid order by cv.verifytime DESC ', array(':logid' => $log['id'], ':uniacid' => $_W['uniacid']));
}
}
else
{
$address = iunserializer($log['address']);
$address = array_filter($address);
if (empty($address))
{
$address = pdo_fetch('select realname,mobile,address,province,city,area from ' . tablename('ewei_shop_member_address') . ' where id=:id and uniacid=:uniacid limit 1', array(':id' => $log['addressid'], ':uniacid' => $_W['uniacid']));
}
}
include $this->template();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。