|
|
|
@ -50,7 +50,7 @@ class CouponRebateController extends BaseController |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户领取优惠券 |
|
|
|
* 用户领取优惠券 2020.08.04 只领一张 |
|
|
|
* 2020.08.04 只领一张优惠券 |
|
|
|
*/ |
|
|
|
public function userReceiveCoupon(CouponRebateReceiveRequest $validator) |
|
|
|
{ |
|
|
|
@ -105,9 +105,9 @@ class CouponRebateController extends BaseController |
|
|
|
|| |
|
|
|
$cp->inventory < ($cp->inventory_use+$cr->number) |
|
|
|
|| |
|
|
|
$cp->start_time < $now |
|
|
|
$cp->start_time > $now |
|
|
|
|| |
|
|
|
$cp->end_time > $now |
|
|
|
$cp->end_time < $now |
|
|
|
) |
|
|
|
{ |
|
|
|
$return['status'] = 2; |
|
|
|
@ -116,11 +116,8 @@ class CouponRebateController extends BaseController |
|
|
|
$cp->inventory_use += $cr->number;//记录已领取的数量
|
|
|
|
if ( $cr->save() && $cp->save() ) { |
|
|
|
$return['status'] = 0; |
|
|
|
$return['data'] = $cps; |
|
|
|
$return['coupon_text'] = $cps['discounts'].'元红包'; |
|
|
|
} else { |
|
|
|
$return['status'] = 3; |
|
|
|
$return['coupon_text'] = '下次继续努力~'; |
|
|
|
$return['data'] = $cp; |
|
|
|
$return['coupon_text'] = $cp['discounts'].'元红包'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|