hrjy 3 years ago
parent
commit
d651ddb1d5
2 changed files with 5 additions and 4 deletions
  1. 3 2
      app/admin/model/auction/AuctionOrder.php
  2. 2 2
      app/models/auction/Auction.php

+ 3 - 2
app/admin/model/auction/AuctionOrder.php

@@ -43,11 +43,12 @@ class AuctionOrder extends BaseModel
 
 
 
-        if (trim($where['store_name']) != '') $model->where('a.id|u.account|u.nickname|a.order_id', 'like', '%'.$where['store_name'].'%');
+        if (trim($where['store_name']) != '') $model->where('a.id|u.account|u.nickname|a.order_id|p.id', 'like', '%'.$where['store_name'].'%');
         if (trim($where['status']) != '') $model->where('a.status', $where['status']);
         if (trim($where['auction_id']) != '') $model->where('au.id', $where['auction_id']);
         if (trim($where['product_name']) != '') $model->where('p.name', 'like', '%'.$where['product_name']);
         if (trim($where['data']) != '') $model = self::getModelTime($where, $model,  'a.create_time');
+        $data['count'] = $model->count();
 
         if (isset($where['excel']) && $where['excel'] == 1) {
             $list = ($list = $model->select()) && count($list) ? $list->toArray() : [];
@@ -57,7 +58,7 @@ class AuctionOrder extends BaseModel
         if (isset($where['excel']) && $where['excel'] == 1) {
             self::SaveExcel($list);
         }
-        $data['count'] = $model->count();
+
         if ($where['page'] && $where['limit']){
             $model->page($where['page'], $where['limit']);
         }else{

+ 2 - 2
app/models/auction/Auction.php

@@ -100,7 +100,7 @@ class Auction extends BaseModel
         $recovery = (int)SystemConfigService::get('recovery');
         if ($auction){
             foreach ($auction as $k => $v) {
-                if (strtotime($v['rend_time'])-600 < time()){
+                if (strtotime($v['rend_time'])-600 < time() and strtotime($v['rend_time']) > time()){
                     //关闭场次五分钟前
 //                    $orderCount = AuctionOrder::where('auction_id', '=', $v['id'])->where('frequency', '=', $v['frequency'])->where('status', '>',0)->where('price', '<', $recovery)->count();// 当前订单数量
 //                    $bok = AuctionBooking::where([['auction_id', '=', $v['id']], ['frequency', '=', $v['frequency']]])->count();
@@ -108,7 +108,7 @@ class Auction extends BaseModel
                     $orderId = AuctionOrder::where([['auction_id', '=', $v['id']], ['frequency', '=', $v['frequency']], ['status', '>', 0]])->column('product_id');
                     // 如果购买人数没有到放单人数
                     $dayo = AuctionOrder::where('auction_id', '=', $v['id'])->where('frequency', '=', $v['frequency'])->where('status', '>',0)->where('price', '<', $recovery)->column('product_id');// 当前出售商品
-                    $product = AuctionProduct::where([['id', 'notIn', $dayo], ['uid', '>', 1], ['price', '<', $recovery], ['auction_id', '=', $v['id']]])->select();
+                    $product = AuctionProduct::where([['id', 'notIn', $dayo], ['uid', '>', 1], ['is_show', '=', 1],['hanging_price', '<', $recovery], ['auction_id', '=', $v['id']]])->select();
                     if ($product){
                         // 存在挂售没卖出的订单
                         foreach ($product as &$item){