62 lines
1.5 KiB
PHP
Executable File
62 lines
1.5 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* @createtime 2023/4/26
|
|
* @author wild
|
|
* @copyright PhpStorm
|
|
*/
|
|
|
|
|
|
namespace App\Model\Zq;
|
|
|
|
|
|
use App\Model\BaseModel;
|
|
|
|
class CtzqBqcMatch extends BaseModel
|
|
{
|
|
protected $appends = [
|
|
'half_odds',
|
|
'whole_odds',
|
|
];
|
|
|
|
public function match() {
|
|
return $this->belongsTo(ZqMatch::class, 'match_id', 'match_id');
|
|
}
|
|
|
|
public function getJcHomeTeamNameAttribute() {
|
|
if ($this->is_reverse == 1) {
|
|
return $this->attributes['jc_away_team_name'];
|
|
}
|
|
return $this->attributes['jc_home_team_name'];
|
|
}
|
|
public function getJcHomeTeamNameFullAttribute() {
|
|
|
|
if ($this->is_reverse == 1) {
|
|
return $this->attributes['jc_away_team_name_full'];
|
|
}
|
|
return $this->attributes['jc_home_team_name_full'];
|
|
}
|
|
|
|
public function getJcAwayTeamNameAttribute() {
|
|
if ($this->is_reverse == 1) {
|
|
return $this->attributes['jc_home_team_name'];
|
|
}
|
|
return $this->attributes['jc_away_team_name'];
|
|
}
|
|
public function getJcAwayTeamNameFullAttribute() {
|
|
if ($this->is_reverse == 1) {
|
|
return $this->attributes['jc_home_team_name_full'];
|
|
}
|
|
return $this->attributes['jc_away_team_name_full'];
|
|
}
|
|
|
|
public function getHalfOddsAttribute($key)
|
|
{
|
|
// 3胜 1平 0负
|
|
return ['3', '1', '0'];
|
|
}
|
|
public function getWholeOddsAttribute($key)
|
|
{
|
|
return ['3', '1', '0'];
|
|
}
|
|
}
|