|
|
@@ -42,16 +42,16 @@ class AuctionOrder extends BaseModel
|
|
|
public static function userOrder($data,$uid)
|
|
|
{
|
|
|
if ($data['type'] == 1){
|
|
|
- $list = self::where([['uid', '=', $uid], ['status', '=', 1]])->select()->toArray(); //待上传订单
|
|
|
+ $list = self::where([['uid', '=', $uid], ['status', '=', 1]])->page($data['page'], $data['limit'])->select()->toArray(); //待上传订单
|
|
|
|
|
|
}else if($data['type'] == 2){
|
|
|
- $list = self::where([['uid', '=', $uid], ['status', '=', 2]])->select()->toArray(); //待审核订单
|
|
|
+ $list = self::where([['uid', '=', $uid], ['status', '=', 2]])->page($data['page'], $data['limit'])->select()->toArray(); //待审核订单
|
|
|
|
|
|
}else if($data['type'] == 3) {
|
|
|
- $list = self::where([['uid', '=', $uid], ['status', '=', 3]])->select()->toArray(); //完成订单
|
|
|
+ $list = self::where([['uid', '=', $uid], ['status', '=', 3]])->page($data['page'], $data['limit'])->select()->toArray(); //完成订单
|
|
|
}else{
|
|
|
|
|
|
- $list = self::where([['uid', '=', $uid], ['status', '<', 1]])->select()->toArray(); //过期订单
|
|
|
+ $list = self::where([['uid', '=', $uid], ['status', '<', 1]])->page($data['page'], $data['limit'])->select()->toArray(); //过期订单
|
|
|
}
|
|
|
|
|
|
return $list;
|
|
|
@@ -69,16 +69,16 @@ class AuctionOrder extends BaseModel
|
|
|
public static function seller_list($data,$uid)
|
|
|
{
|
|
|
if ($data['type'] == 1){
|
|
|
- $list = self::where([['collection_id', '=', $uid], ['status', '=', 1]])->select()->toArray(); //待上传订单
|
|
|
+ $list = self::where([['collection_id', '=', $uid], ['status', '=', 1]])->page($data['page'], $data['limit'])->select()->toArray(); //待上传订单
|
|
|
|
|
|
}else if($data['type'] == 2){
|
|
|
- $list = self::where([['collection_id', '=', $uid], ['status', '=', 2]])->select()->toArray(); //待审核订单
|
|
|
+ $list = self::where([['collection_id', '=', $uid], ['status', '=', 2]])->page($data['page'], $data['limit'])->select()->toArray(); //待审核订单
|
|
|
|
|
|
}else if($data['type'] == 3) {
|
|
|
- $list = self::where([['collection_id', '=', $uid], ['status', '=', 3]])->select()->toArray(); //完成订单
|
|
|
+ $list = self::where([['collection_id', '=', $uid], ['status', '=', 3]])->page($data['page'], $data['limit'])->select()->toArray(); //完成订单
|
|
|
}else{
|
|
|
|
|
|
- $list = self::where([['collection_id', '=', $uid], ['status', '<', 1]])->select()->toArray(); //过期订单
|
|
|
+ $list = self::where([['collection_id', '=', $uid], ['status', '<', 1]])->page($data['page'], $data['limit'])->select()->toArray(); //过期订单
|
|
|
}
|
|
|
|
|
|
return $list;
|
|
|
@@ -190,6 +190,13 @@ class AuctionOrder extends BaseModel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 订单过期
|
|
|
+ * @return void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
public static function deduction()
|
|
|
{
|
|
|
$hour = strtotime(date('Y-m-d H:i:s', strtotime('-1 hour'))); // 一小时以前
|
|
|
@@ -217,6 +224,30 @@ class AuctionOrder extends BaseModel
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 退回预约卷
|
|
|
+ * @return void
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public static function th()
|
|
|
+ {
|
|
|
+ $auction = Auction::where('rend_time', '<', time())->select();
|
|
|
+ if ($auction){
|
|
|
+ foreach ($auction as $k => $v){
|
|
|
+ $booking = AuctionBooking::where('auction_id', $v['id'])->whereBetweenTime('create_time',date('Y-m-d H:i:s', strtotime(date('Y-m-d', time()))), date('Y-m-d H:i:s', strtotime(date('Y-m-d', strtotime('+1 day')))))->select();
|
|
|
+ if ($booking){
|
|
|
+ $user = User::where('uid', $booking['uid'])->find();
|
|
|
+ $user['anticipate'] = $user['anticipate'] + $booking['anticipate'];
|
|
|
+ $user->save();
|
|
|
+ UserBill::income('预约卷增加',$user['uid'], 'anticipate', 'add_anticipate', $booking['anticipate'], 0, $user['anticipate'], '预约卷退回');
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|