|
|
|
@ -67,17 +67,6 @@ class CouponRebateController extends BaseController |
|
|
|
'data' => [], |
|
|
|
'coupon_text' => '继续努力~' |
|
|
|
]; |
|
|
|
// mock 数据 给前端用
|
|
|
|
$test = $this->request->input("test", 0); |
|
|
|
if($test){ |
|
|
|
$cps = Coupon::where('id', $id)->lockForUpdate() |
|
|
|
->select('id','title','status','inventory','inventory_use','start_time','end_time','full_amount','discounts') |
|
|
|
->first(); |
|
|
|
$return['status'] = 0; |
|
|
|
$return['data'] = $cps; |
|
|
|
$return['coupon_text'] = $cps['discounts'].'元红包'; |
|
|
|
return $this->success($return); |
|
|
|
} |
|
|
|
|
|
|
|
Db::transaction( function () use ($id,$receiveType,$userId,$sendUserId,$phone,&$return,$now) { |
|
|
|
//读写锁,完全控制,性能低
|
|
|
|
|