40 lines
731 B
PHP
40 lines
731 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Bookmaker extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'icon',
|
|
'image',
|
|
'baid',
|
|
'txso',
|
|
'txot',
|
|
'betsapi',
|
|
'direct',
|
|
'is_active',
|
|
];
|
|
|
|
public function sport()
|
|
{
|
|
return $this->belongsTo(Sport::class)->where('is_active', 1);
|
|
}
|
|
|
|
public static function map()
|
|
{
|
|
$arr = [];
|
|
$res = Bookmaker::query()->where('is_active', 1)->get();
|
|
foreach ($res as $value) {
|
|
$arr[$value->id] = [
|
|
'name' => $value->name,
|
|
'icon' => $value->icon,
|
|
];
|
|
}
|
|
|
|
return $arr;
|
|
}
|
|
}
|