several cosmetic updates
This commit is contained in:
parent
5a90bb2c8a
commit
8c368524fe
8 changed files with 56 additions and 24 deletions
|
|
@ -5,6 +5,7 @@ namespace App;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Game;
|
||||
use Log;
|
||||
use DB;
|
||||
|
||||
class Round extends Model
|
||||
{
|
||||
|
|
@ -66,4 +67,11 @@ class Round extends Model
|
|||
return $lastLockedRoundId;
|
||||
}
|
||||
|
||||
public static function getClosestRoundToNow() {
|
||||
$sql="select round_id,DATEDIFF(NOW(),kickoff) from games order by 2 desc limit 1;";
|
||||
$result=DB::select($sql);
|
||||
if (count($result)==0) return 0;
|
||||
|
||||
return $result[0]->round_id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue