Commit fe94bf41 authored by hujun's avatar hujun

-1

parent 4cbd99e2
...@@ -141,8 +141,10 @@ class CouponService{ ...@@ -141,8 +141,10 @@ class CouponService{
$count_where['user_id'] = $user_id; $count_where['user_id'] = $user_id;
foreach ($activity_data as $k=>$v) { foreach ($activity_data as $k=>$v) {
if ($v['total'] - $v['get_number'] <= 0 ) { if ($v['total'] != -1) {
continue; if ($v['total'] - $v['get_number'] <= 0 ) {
continue;
}
} }
if ($type == 0) { if ($type == 0) {
...@@ -153,14 +155,17 @@ class CouponService{ ...@@ -153,14 +155,17 @@ class CouponService{
} }
} }
$where['user_id'] = $user_id; if ($v['available'] != -1) {
$where['activity_id'] = $v['id']; $where['user_id'] = $user_id;
$where['status'] = ['<>',2]; $where['activity_id'] = $v['id'];
$num = $this->m_coupon->getCount($where); $where['status'] = ['<>',2];
if ($num > $v['available']) { $num = $this->m_coupon->getCount($where);
continue; if ($num > $v['available']) {
continue;
}
} }
if (strtotime($v['activity_start_time']) < $time && strtotime($v['activity_end_time']) > $time) { if (strtotime($v['activity_start_time']) < $time && strtotime($v['activity_end_time']) > $time) {
$return_activity[] = $v; $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