47 lines
897 B
PHP
Executable File
47 lines
897 B
PHP
Executable File
<?php
|
|
/**
|
|
* @createtime 2023/4/26
|
|
* @author wild
|
|
* @copyright PhpStorm
|
|
*/
|
|
|
|
|
|
namespace App\Model\Lq;
|
|
|
|
|
|
use App\Model\BaseModel;
|
|
use Illuminate\Support\Arr;
|
|
|
|
class JclqResult extends BaseModel
|
|
{
|
|
public function match() {
|
|
return $this->belongsTo(JclqMatch::class, 'match_id', 'match_id');
|
|
}
|
|
public function getIssueWeekAttribute()
|
|
{
|
|
return self::getIssueNumWeek($this->issue_num);
|
|
}
|
|
public static function getIssueNumWeek($issueNum)
|
|
{
|
|
if (!$issueNum) {
|
|
return '';
|
|
}
|
|
$arr = explode('/', $issueNum);
|
|
return Arr::get($arr, 1);
|
|
}
|
|
|
|
public function getTotalScore()
|
|
{
|
|
return $this->home_score + $this->away_score;
|
|
}
|
|
|
|
/**
|
|
* 是否取消比赛
|
|
* @return bool
|
|
*/
|
|
public function canceled()
|
|
{
|
|
return $this->lottery_state == 'cancelLottery';
|
|
}
|
|
}
|