|
|
@@ -74,7 +74,7 @@ class AuctionController
|
|
|
|
|
|
$userModel = new User();
|
|
|
$user = $userModel->find($request->uid());
|
|
|
-
|
|
|
+ if ($user['is_auth'] != 2) return app('json')->fail('未实名认证');
|
|
|
if ($user['anticipate'] < $auction['anticipate']) return app('json')->fail('预约卷不够');
|
|
|
$user['anticipate'] = $user['anticipate'] - $auction['anticipate'];// 扣除预约卷
|
|
|
|
|
|
@@ -108,7 +108,7 @@ class AuctionController
|
|
|
if (!$data['id']) return app('json')->fail('数据传入错误');
|
|
|
$auction = Auction::find($data['id']);
|
|
|
$booking = AuctionBooking::where([['auction_id', '=',$auction['id']], ['frequency', '=', $auction['frequency']]])->find();
|
|
|
- $radd_time = strtotime($auction['radd_time']) - 360; // 提前五分钟进场
|
|
|
+ $radd_time = strtotime($auction['radd_time']) - 360; // 提前6分钟进场
|
|
|
|
|
|
if (!$booking){
|
|
|
return app('json')->fail('未预约');
|
|
|
@@ -174,19 +174,26 @@ class AuctionController
|
|
|
public function transfer_accounts(Request $request){
|
|
|
$data = UtilService::getMore([
|
|
|
['uid'],
|
|
|
- ['anticipate']
|
|
|
+ ['anticipate'],
|
|
|
+ ['payment']
|
|
|
], $request);
|
|
|
if (!$data['uid'] or !$data['anticipate']) return app('json')->fail('数据传入错误');
|
|
|
+ if (!$data['payment']) return app('json')->fail('请填写支付密码');
|
|
|
$user = User::find($request->uid());
|
|
|
- if ($user['anticipate'] < $data['anticipate']) return app('json')->fail('预约卷不够');
|
|
|
+ $userList = User::select();
|
|
|
+ $uid = get_downline($userList, $user['uid']);
|
|
|
+
|
|
|
+ if ($user['payment'] != md5($data['payment'])) return app('json')->fail('支付密码错误');
|
|
|
+ if (!in_array($data['uid'],$uid)) return app('json')->fail('该用户不是你下级');
|
|
|
+ if ($data['anticipate'] < 10) return app('json')->fail('最少转账10');
|
|
|
+ if ($user['anticipate'] < $data['anticipate']) return app('json')->fail('艺金券不够');
|
|
|
$me = User::find($data['uid']);
|
|
|
$user['anticipate'] = $user['anticipate'] - $data['anticipate'];// 扣除预约卷
|
|
|
$me['anticipate'] = $me['anticipate'] + $data['anticipate'];// 增加预约卷
|
|
|
-
|
|
|
try {
|
|
|
Db::startTrans();
|
|
|
- UserBill::expend('预约卷减少',$user['uid'], 'anticipate', 'reduce_anticipate', $data['anticipate'], 0, $user['anticipate'], '转账给用户'.$me['nickname'].$data['anticipate'].'预约卷');
|
|
|
- UserBill::income('预约卷增加',$me['uid'], 'anticipate', 'add_anticipate', $data['anticipate'], 0, $me['anticipate'], $me['nickname'].'转账'.$data['anticipate'].'预约卷');
|
|
|
+ UserBill::expend('艺金券减少',$user['uid'], 'anticipate', 'reduce_anticipate', $data['anticipate'], 0, $user['anticipate'], '转账给('.$me['nickname'].')'.$data['anticipate'].'预约卷');
|
|
|
+ UserBill::income('艺金券增加',$me['uid'], 'anticipate', 'add_anticipate', $data['anticipate'], 0, $me['anticipate'], '接收('.$user['nickname'].'-'.$user['uid'].')转账'.$data['anticipate'].'预约卷');
|
|
|
$user->save();
|
|
|
$me->save();
|
|
|
|
|
|
@@ -440,11 +447,7 @@ class AuctionController
|
|
|
$time = strtotime(date('Y-m-d', time()));// 今天
|
|
|
$today = strtotime(date('Y-m-d', strtotime('+1day')));// 明天
|
|
|
$datas = [];
|
|
|
- if ($user['is_new'] == 1 or ($user['green_time'] >= $time and $user['green_time'] <= $today)){
|
|
|
- $datas['time'] = strtotime($list['radd_time']) - 180;
|
|
|
- }else{
|
|
|
- $datas['time'] = strtotime($list['radd_time']);
|
|
|
- }
|
|
|
+ $datas['time'] = strtotime($list['radd_time']);
|
|
|
|
|
|
return app('json')->success($datas);// 失败
|
|
|
}
|