Commit fe94bf41 authored by hujun's avatar hujun

-1

parent 4cbd99e2
......@@ -141,8 +141,10 @@ class CouponService{
$count_where['user_id'] = $user_id;
foreach ($activity_data as $k=>$v) {
if ($v['total'] - $v['get_number'] <= 0 ) {
continue;
if ($v['total'] != -1) {
if ($v['total'] - $v['get_number'] <= 0 ) {
continue;
}
}
if ($type == 0) {
......@@ -153,14 +155,17 @@ class CouponService{
}
}
$where['user_id'] = $user_id;
$where['activity_id'] = $v['id'];
$where['status'] = ['<>',2];
$num = $this->m_coupon->getCount($where);
if ($num > $v['available']) {
continue;
if ($v['available'] != -1) {
$where['user_id'] = $user_id;
$where['activity_id'] = $v['id'];
$where['status'] = ['<>',2];
$num = $this->m_coupon->getCount($where);
if ($num > $v['available']) {
continue;
}
}
if (strtotime($v['activity_start_time']) < $time && strtotime($v['activity_end_time']) > $time) {
$return_activity[] = $v;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment