Selaa lähdekoodia

Merge branch 'auth' into stabble

zz 6 vuotta sitten
vanhempi
commit
ec717d70f4
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      app/Console/Commands/BookTest.php

+ 6 - 0
app/Console/Commands/BookTest.php

@@ -345,14 +345,17 @@ class BookTest extends Command
                 foreach ($to_bids as $v){
                     $to_bid = $v->to_bid;
                     $time = $v->created_at->format('Y-m-d H:i:s');
+                    $end_time = date('Y-m-d H:i:s',strtotime($time)+2*86400);
                     if(!$to_bid) continue;
                     $fee = $chapter_model->where('uid',$item->uid)
                         ->where('bid',$to_bid)
                         ->where('created_at','>=',$time)
+                        ->where('created_at','<=',$end_time)
                         ->sum('fee');
                     $amount = Order::where('uid',$item->uid)
                         ->where('from_bid',$to_bid)
                         ->where('created_at','>=',$time)
+                        ->where('created_at','<=',$end_time)
                         ->where('status','PAID')
                         ->sum('price');
                     $result[] = [
@@ -379,13 +382,16 @@ class BookTest extends Command
                     $test = YqZsyTestService::getByBid($bid);
                     if($test) continue;
                     $time = $from_bid->created_at->format('Y-m-d H:i:s');
+                    $end_time = date('Y-m-d H:i:s',strtotime($time)+2*86400);
                     $fee = $chapter_model->where('uid',$item->uid)
                         ->where('bid',$bid)
                         ->where('created_at','>=',$time)
+                        ->where('created_at','<=',$end_time)
                         ->sum('fee');
                     $amount = Order::where('uid',$item->uid)
                         ->where('from_bid',$bid)
                         ->where('created_at','>=',$time)
+                        ->where('created_at','<=',$end_time)
                         ->where('status','PAID')
                         ->sum('price');
                     $result[] = [