人人商城记次时商品核销时展示剩余积分

人人商城记次时商品有很多二开方案,有一客户就要求在核销时,扣除相应的积分。今天我们在记次时商品核销时展示剩余积分。

我们打开如下文件

ewei_shopv2/core/mobile/verify/verifygoods.php

找到 detail() 函数中的如下语句

$item = pdo_fetch('select vg.*,g.id as goodsid ,g.title,g.subtitle,g.thumb,vg.storeid  from ' . tablename('ewei_shop_verifygoods') . "   vg inner join " . tablename('ewei_shop_order_goods') . " og on vg.ordergoodsid = og.id inner join " . tablename('ewei_shop_goods') . " g on og.goodsid = g.id where  vg.id =:id and  vg.verifycode=:verifycode and vg.uniacid=:uniacid and vg.invalid=0 limit 1", array(':id' => $id, ':uniacid' => $_W['uniacid'], ':verifycode' => $verifycode));

在其下一行添加如下代码

$u_openid = $item['openid'];
$credit = m('member')->getCredit($u_openid);

接着打开前端如下文件

ewei_shopv2/template/mobile/default/verify/verifygoods/detail.html

在任意想调用的位置输入

<span class="text-danger">剩余积分:{php echo $credit}</span>

此教程仅此,其他延伸看后续吧!