|
@@ -60,6 +60,7 @@ class AuctionController
|
|
|
['id']
|
|
|
]);
|
|
|
if (!$data['id']) return app('json')->fail('数据传入错误');
|
|
|
+ if (cache($request->uid())) return app('json')->fail('请勿频繁点击');
|
|
|
$auctionModel = new Auction();
|
|
|
$auction = $auctionModel->find($data['id']);
|
|
|
if (!$auction)return app('json')->fail('没有此数据');
|
|
@@ -73,16 +74,15 @@ class AuctionController
|
|
|
if (AuctionBooking::where([['uid', '=', $request->uid()], ['auction_id' , '=', $auction['id']], ['frequency', '=', $auction['frequency']]])->find()){
|
|
|
return app('json')->fail('当前场馆已预约');
|
|
|
}
|
|
|
-
|
|
|
+ cache($request->uid(), 1, 5);
|
|
|
$userModel = new User();
|
|
|
- $user = $userModel->find($request->uid());
|
|
|
+ $user = User::where('uid', $request->uid())->find();
|
|
|
if ($user['is_auth'] != 2) return app('json')->fail('未实名认证');
|
|
|
if ($user['anticipate'] < $auction['anticipate']) return app('json')->fail('易趣卷不足');
|
|
|
$user['anticipate'] = $user['anticipate'] - $auction['anticipate'];
|
|
|
|
|
|
User::rollbackTrans();
|
|
|
$res = $user->save();
|
|
|
-
|
|
|
if ($res){
|
|
|
AuctionBooking::booking($user['uid'], $auction);
|
|
|
UserBill::expend('预约场馆', $user['uid'], 'anticipate','reduce_anticipate', $auction['anticipate'], 0, $user['anticipate'], '预约扣除易趣卷');
|