一款通用的微信优惠劵应用

WechatIMG124.jpeg


WechatIMG125.jpeg


WechatIMG126.jpeg


火狐截图_2018-01-31T04-22-39.831Z_.png


火狐截图_2018-01-31T04-23-12.790Z_.png


火狐截图_2018-01-31T04-23-54.078Z_.png


这是一款通用的微信优惠劵应用,可以运用到你的商城当中,还可以应用到抽奖游戏,实物兑换等等……
通用优惠劵是支持分类的,然后这个类别可以运用起来比较灵活,可当成任何对象。支持多功能设定。支持劵号生成与导出。现在分享给大家,如果需要演示请在首页扫码进入公众号查看演示。
 

8 个评论

前排沙发,赞
安装了还没使用,也还没配置,只简单的看了一下。。
是不是没有数据的时候点查询统计会出错?
我点查询统计,提示[8] ErrorException in Collection.php line 322
未定义数组下标: 0
是不是正常的?我还没配置。
我怎么试都试不出来
优惠劵怎么核销呢
这个问题解决没?
插件没有数据报错,修复方式:coupon.php中的search函数改为:
/**
* @author Geeson RhaPHP.com
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function search()
{
$_data = input();
$codes = isset($_data['codes']) ? $_data['codes'] : '';
$time = isset($_data['times']) ? $_data['times'] : '';
$status = isset($_data['status']) ? $_data['status'] : '-1';
$coupons = Db::name('coupon_name')->where('mid', '=', $this->mid)->select();
$where = [];
if (isset($_data['codes']) && !empty($_data['codes'])) {
$where[] = ['codes', '=', $_data['codes']];
}
if (isset($_data['times'])) {
$times = explode('到', $_data['times']);
if (count($times) == 2) {
$where[] = ['create_time', 'between', [strtotime($times[0]), strtotime($times[1]) + 86400]];
}
}
if (isset($_data['status'])) {
if ($_data['status'] != -1) {
$status = $_data['status'] ? $_data['status'] : '0';
$where[] = ['status', '=', $status];
}
}
if(isset($_data['coupon_id']) && !empty($_data['coupon_id']) && empty($_data['codes'])){
$where[] = ['coupon_id', '=', $_data['coupon_id']];
}
$where[] = ['mid', '=', $this->mid];
$model = new CouponData();

$data = $model->where($where)->paginate(10, false, ['query' => ['codes' => $codes, 'times' => $time, 'status' => $status]]);
if(isset($data['0'])){
if (isset($data['0']['coupon_id']) && isset($_data['coupon_id'])) {
$info = Db::name('coupon_name')->where('id', '=', $data['0']['coupon_id'])
->where('mid', '=', $this->mid)
->find();
$unused = $model->where($where)->where('status', '=', 0)->count();
$used = $model->where($where)->where('status', '=', 1)->count();
$got = $model->where($where)->where('status', '=', 2)->count();
$usedMoney = $used * $info['money'];
$gotMoney = $got * $info['money'];
$this->assign('unused', $unused);
$this->assign('used', $used);
$this->assign('usedMoney', $usedMoney);
$this->assign('got', $got);
$this->assign('gotMoney', $gotMoney);
$this->assign('info', $info);
} else {
$this->assign('unused', 0);
$this->assign('used', 0);
$this->assign('usedMoney', 0);
$this->assign('got', 0);
$this->assign('gotMoney', 0);
$this->assign('info', ['name' => '', 'code_count' => 0]);
}
}else{
$this->assign('unused', 0);
$this->assign('used', 0);
$this->assign('usedMoney', 0);
$this->assign('got', 0);
$this->assign('gotMoney', 0);
$this->assign('info', ['name' => '', 'code_count' => 0]);
}

$this->assign('page', $data->render());
foreach ($data as $key => $val) {
if ($val['user_id']) {
$user = getMember($val['user_id']);
if (isset($user['nickname'])) {
$data[$key]['username'] = $user['nickname'];
} else {
$data[$key]['username'] = '无';
}
} elseif ($val['openid']) {
$user = getMemberInfo($val['openid']);
if (isset($user['nickname'])) {
$data[$key]['username'] = $user['nickname'];
} else {
$data[$key]['username'] = '无';
}
} else {
$data[$key]['username'] = '无';
}

if ($val['use_time']) {
$data[$key]['use_time'] = date('Y-m-d H:i:s');
} else {
$data[$key]['use_time'] = '无';
}
}
$post['codes'] = $codes;
$post['times'] = $time;
$post['status'] = $status;
$this->assign('coupons', $coupons);
$this->assign('data', $data);
$this->assign('post', $post);
$this->fetch();
}
同样报了二楼的错误..
if(isset($data['0'])){}加上这个判断

要回复文章请先登录注册