47 lines
985 B
PHP
Executable File
47 lines
985 B
PHP
Executable File
<?php
|
|
/**
|
|
* @createtime 2023/4/26
|
|
* @author wild
|
|
* @copyright PhpStorm
|
|
*/
|
|
|
|
|
|
namespace App\Model\Zq;
|
|
|
|
|
|
use App\Enums\SaleState;
|
|
use App\Model\BaseModel;
|
|
|
|
class BjdcResult extends BaseModel
|
|
{
|
|
public function match()
|
|
{
|
|
return $this->belongsTo(ZqMatch::class, 'match_id', 'match_id');
|
|
}
|
|
|
|
/**
|
|
* 是否取消比赛
|
|
* @return bool
|
|
*/
|
|
public function canceled()
|
|
{
|
|
$odds = BjdcOdds::where('odds_id', $this->odds_id)->first();
|
|
|
|
$oddsArray = [
|
|
'spf_odds' => 'spf_field',
|
|
'rq_odds' => 'rq_field',
|
|
'bf_odds' => 'bf_field',
|
|
'sxpds_odds' => 'sxpds_field',
|
|
'jq_odds' => 'jq_field',
|
|
'bqc_odds' => 'bqc_field',
|
|
];
|
|
|
|
foreach ($oddsArray as $oddType => $oddField) {
|
|
if ($odds->{$oddType} && $this->{$oddField} == '' && $this->{$oddType} == 1) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|