|
@@ -287,72 +287,76 @@ class AuctionOrder extends BaseModel
|
|
foreach ($order as $K => $v) {
|
|
foreach ($order as $K => $v) {
|
|
$product = AuctionProduct::where('id', $v['product_id'])->find();
|
|
$product = AuctionProduct::where('id', $v['product_id'])->find();
|
|
$auction = Auction::where('id', $product['auction_id'])->find();
|
|
$auction = Auction::where('id', $product['auction_id'])->find();
|
|
- $booking = AuctionBooking::where([['uid', '=', $v['uid']], ['status', '=', 1], ['auction_id', '=', $auction['id']], ['frequency', '=', $auction['frequency']]])->find(); // 找到预约订单
|
|
|
|
- $fz = AuctionFrozen::where('order_id', $v['order_id'])->where('status', 1)->find();
|
|
|
|
- $userl = \app\models\user\User::where('uid', $v['uid'])->find();//买家
|
|
|
|
- if ($fz) {
|
|
|
|
- if (strtotime($v['create_time']) <= $hour and strtotime($v['create_time']) > $time) {
|
|
|
|
- // 订单在一个小时到一个半小时内
|
|
|
|
- if ($fz['deduction'] == 0) {
|
|
|
|
- $user = \app\models\user\User::where('uid', $v['collection_id'])->find();
|
|
|
|
- $user['anticipate'] = $user['anticipate'] + $fz['anticipate'] / 2; // 卖家增加预约卷
|
|
|
|
- $fz['deduction'] = $fz['anticipate'] / 2;
|
|
|
|
- UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $fz['anticipate'] / 2, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
|
|
- UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $fz['anticipate'] / 2, $v['uid'], $fz['anticipate'] / 2, '超时付款,扣除订单'.$v['order_id'].'冻结'. ($fz['anticipate'] / 2) . '易趣卷');
|
|
|
|
- $fz->save();
|
|
|
|
- $user->save();
|
|
|
|
- }
|
|
|
|
- } elseif (strtotime($v['create_time']) <= $time) {
|
|
|
|
-
|
|
|
|
- $user = \app\models\user\User::where('uid', $v['collection_id'])->find(); //卖家
|
|
|
|
- $dedu = $fz['anticipate'] - $fz['deduction'];
|
|
|
|
- $user['anticipate'] += $dedu; // 卖家增加预约卷
|
|
|
|
- $fz['deduction'] = $fz['anticipate'];
|
|
|
|
- $fz['status'] = 2;
|
|
|
|
- $product['succeed_time'] = 0;
|
|
|
|
-
|
|
|
|
- $product->save();
|
|
|
|
- $user->save();
|
|
|
|
- \app\models\user\User::where('uid', $v['uid'])->update(['status' => 0, 'freeze_time' => strtotime('+1 day')]); // 冻结用户
|
|
|
|
- UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $dedu, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
|
|
- UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $dedu, $v['uid'], 0, '超时付款,扣除订单'.$v['order_id'].'冻结' . $dedu . '易趣卷');
|
|
|
|
- $fz->save();
|
|
|
|
-
|
|
|
|
- AuctionOrder::where('id', $v['id'])->where('status', '=', 1)->update(['status' => 0]); // 修改为已过期订单
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- if (strtotime($v['create_time']) <= $hour and strtotime($v['create_time']) > $time) {
|
|
|
|
- // 订单在一个小时到一个半小时内
|
|
|
|
- if ($booking) {
|
|
|
|
- if ($booking['deduction'] == 0) {
|
|
|
|
|
|
+ $kc_time = strtotime($auction['radd_time']);//开场时间
|
|
|
|
+ if ($kc_time < time()){
|
|
|
|
+ if (strtotime($v['create_time']) < $kc_time) $v['create_time'] = date('Y-m-d H:i:s', $kc_time);
|
|
|
|
+ $booking = AuctionBooking::where([['uid', '=', $v['uid']], ['status', '=', 1], ['auction_id', '=', $auction['id']], ['frequency', '=', $auction['frequency']]])->find(); // 找到预约订单
|
|
|
|
+ $fz = AuctionFrozen::where('order_id', $v['order_id'])->where('status', 1)->find();
|
|
|
|
+ $userl = \app\models\user\User::where('uid', $v['uid'])->find();//买家
|
|
|
|
+ if ($fz) {
|
|
|
|
+ if (strtotime($v['create_time']) <= $hour and strtotime($v['create_time']) > $time) {
|
|
|
|
+ // 订单在一个小时到一个半小时内
|
|
|
|
+ if ($fz['deduction'] == 0) {
|
|
$user = \app\models\user\User::where('uid', $v['collection_id'])->find();
|
|
$user = \app\models\user\User::where('uid', $v['collection_id'])->find();
|
|
- $user['anticipate'] = $user['anticipate'] + $booking['anticipate'] / 2; // 卖家增加预约卷
|
|
|
|
- $booking['deduction'] = $booking['anticipate'] / 2;
|
|
|
|
- UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $booking['anticipate'] / 2, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
|
|
- UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $booking['anticipate'] / 2, $v['uid'], $booking['anticipate'] / 2, '超时付款,扣除预约冻结' . ($booking['anticipate'] / 2) . '易趣卷');
|
|
|
|
- $booking->save();
|
|
|
|
|
|
+ $user['anticipate'] = $user['anticipate'] + $fz['anticipate'] / 2; // 卖家增加预约卷
|
|
|
|
+ $fz['deduction'] = $fz['anticipate'] / 2;
|
|
|
|
+ UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $fz['anticipate'] / 2, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
|
|
+ UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $fz['anticipate'] / 2, $v['uid'], $fz['anticipate'] / 2, '超时付款,扣除订单'.$v['order_id'].'冻结'. ($fz['anticipate'] / 2) . '易趣卷');
|
|
|
|
+ $fz->save();
|
|
$user->save();
|
|
$user->save();
|
|
}
|
|
}
|
|
- }
|
|
|
|
- } elseif (strtotime($v['create_time']) <= $time) {
|
|
|
|
- if ($booking) {
|
|
|
|
|
|
+ } elseif (strtotime($v['create_time']) <= $time) {
|
|
|
|
+
|
|
$user = \app\models\user\User::where('uid', $v['collection_id'])->find(); //卖家
|
|
$user = \app\models\user\User::where('uid', $v['collection_id'])->find(); //卖家
|
|
- $dedu = $booking['anticipate'] - $booking['deduction'];
|
|
|
|
|
|
+ $dedu = $fz['anticipate'] - $fz['deduction'];
|
|
$user['anticipate'] += $dedu; // 卖家增加预约卷
|
|
$user['anticipate'] += $dedu; // 卖家增加预约卷
|
|
- $booking['deduction'] = $booking['anticipate'];
|
|
|
|
- $booking['status'] = 2;
|
|
|
|
|
|
+ $fz['deduction'] = $fz['anticipate'];
|
|
|
|
+ $fz['status'] = 2;
|
|
$product['succeed_time'] = 0;
|
|
$product['succeed_time'] = 0;
|
|
|
|
|
|
$product->save();
|
|
$product->save();
|
|
$user->save();
|
|
$user->save();
|
|
\app\models\user\User::where('uid', $v['uid'])->update(['status' => 0, 'freeze_time' => strtotime('+1 day')]); // 冻结用户
|
|
\app\models\user\User::where('uid', $v['uid'])->update(['status' => 0, 'freeze_time' => strtotime('+1 day')]); // 冻结用户
|
|
UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $dedu, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $dedu, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
- UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $dedu, $v['uid'], 0, '超时付款,扣除预约冻结' . $dedu . '易趣卷');
|
|
|
|
- $booking->save();
|
|
|
|
|
|
+ UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $dedu, $v['uid'], 0, '超时付款,扣除订单'.$v['order_id'].'冻结' . $dedu . '易趣卷');
|
|
|
|
+ $fz->save();
|
|
|
|
|
|
AuctionOrder::where('id', $v['id'])->where('status', '=', 1)->update(['status' => 0]); // 修改为已过期订单
|
|
AuctionOrder::where('id', $v['id'])->where('status', '=', 1)->update(['status' => 0]); // 修改为已过期订单
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ if (strtotime($v['create_time']) <= $hour and strtotime($v['create_time']) > $time) {
|
|
|
|
+ // 订单在一个小时到一个半小时内
|
|
|
|
+ if ($booking) {
|
|
|
|
+ if ($booking['deduction'] == 0) {
|
|
|
|
+ $user = \app\models\user\User::where('uid', $v['collection_id'])->find();
|
|
|
|
+ $user['anticipate'] = $user['anticipate'] + $booking['anticipate'] / 2; // 卖家增加预约卷
|
|
|
|
+ $booking['deduction'] = $booking['anticipate'] / 2;
|
|
|
|
+ UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $booking['anticipate'] / 2, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
|
|
+ UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $booking['anticipate'] / 2, $v['uid'], $booking['anticipate'] / 2, '超时付款,扣除预约冻结' . ($booking['anticipate'] / 2) . '易趣卷');
|
|
|
|
+ $booking->save();
|
|
|
|
+ $user->save();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } elseif (strtotime($v['create_time']) <= $time) {
|
|
|
|
+ if ($booking) {
|
|
|
|
+ $user = \app\models\user\User::where('uid', $v['collection_id'])->find(); //卖家
|
|
|
|
+ $dedu = $booking['anticipate'] - $booking['deduction'];
|
|
|
|
+ $user['anticipate'] += $dedu; // 卖家增加预约卷
|
|
|
|
+ $booking['deduction'] = $booking['anticipate'];
|
|
|
|
+ $booking['status'] = 2;
|
|
|
|
+ $product['succeed_time'] = 0;
|
|
|
|
+
|
|
|
|
+ $product->save();
|
|
|
|
+ $user->save();
|
|
|
|
+ \app\models\user\User::where('uid', $v['uid'])->update(['status' => 0, 'freeze_time' => strtotime('+1 day')]); // 冻结用户
|
|
|
|
+ UserBill::income('超时增加', $v['collection_id'], 'anticipate', 'ad_anticipate', $dedu, $v['uid'], $user['anticipate'], '(' . $userl['nickname'] . '-' . $userl['uid'] . ')超时付款,增加易趣卷');
|
|
|
|
+ UserBill::expend('超时扣除', $v['uid'], 'anticipate', 'dec_anticipate', $dedu, $v['uid'], 0, '超时付款,扣除预约冻结' . $dedu . '易趣卷');
|
|
|
|
+ $booking->save();
|
|
|
|
+
|
|
|
|
+ AuctionOrder::where('id', $v['id'])->where('status', '=', 1)->update(['status' => 0]); // 修改为已过期订单
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|