|
|
@@ -705,7 +705,6 @@ class ZqRule
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//结果总数 home_score 主队进球数 guest_score 客队进球数 home_rate 主队让球 guest_rate 客队让球 u_home_score 上半场-主队进球数 u_guest_score 上半场-客队进球数
|
|
|
public function total_goal($model, $resultModels, $resultRecords)
|
|
|
{
|
|
|
@@ -713,109 +712,99 @@ class ZqRule
|
|
|
//全场总进球数
|
|
|
$resulttod = intval($resultModel->home_score) + intval($resultModel->guest_score);
|
|
|
//上半场总进球数
|
|
|
- $Firsthalftod = intval($resultModel->u_home_score) + intval($resultModel->u_guest_score);
|
|
|
- $results = 0;
|
|
|
- $resultb = 0;
|
|
|
- $qjnum = explode('-', $model->condition);
|
|
|
+ $firsthalftod = intval($resultModel->u_home_score) + intval($resultModel->u_guest_score);
|
|
|
+
|
|
|
if ($model->odds_code == "total_goal_four") {
|
|
|
- if ($qjnum[0] <= $resulttod and $qjnum[1] >= $resulttod) {
|
|
|
+ if ( 4<=$resulttod and $resulttod<=6 ) {
|
|
|
$results = 1;
|
|
|
} else {
|
|
|
$results = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "total_goal_zero") {
|
|
|
- if ($qjnum[0] <= $resulttod and $qjnum[1] >= $resulttod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "total_goal_zero") {
|
|
|
+ if (0 <= $resulttod and $resulttod<=1) {
|
|
|
$results = 1;
|
|
|
} else {
|
|
|
$results = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "total_goal_two") {
|
|
|
- if ($qjnum[0] <= $resulttod and $qjnum[1] >= $resulttod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "total_goal_two") {
|
|
|
+ if (2 <= $resulttod and $resulttod<=3) {
|
|
|
$results = 1;
|
|
|
} else {
|
|
|
$results = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "total_goal_seven") {
|
|
|
- if ($qjnum[0] <= $resulttod and $qjnum[1] >= $resulttod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "total_goal_seven") {
|
|
|
+ if (7 <= $resulttod) {
|
|
|
$results = 1;
|
|
|
} else {
|
|
|
$results = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "half_total_goal_zero") {
|
|
|
- if ($qjnum[0] <= $Firsthalftod and $qjnum[1] >= $Firsthalftod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "half_total_goal_zero") {
|
|
|
+ if ($firsthalftod==0) {
|
|
|
$resultb = 1;
|
|
|
} else {
|
|
|
$resultb = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "half_total_goal_one") {
|
|
|
- if ($qjnum[0] <= $Firsthalftod and $qjnum[1] >= $Firsthalftod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "half_total_goal_one") {
|
|
|
+ if ($firsthalftod==1) {
|
|
|
$resultb = 1;
|
|
|
} else {
|
|
|
$resultb = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "half_total_goal_two") {
|
|
|
- if ($qjnum[0] <= $Firsthalftod and $qjnum[1] >= $Firsthalftod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "half_total_goal_two") {
|
|
|
+ if ($firsthalftod==2) {
|
|
|
$resultb = 1;
|
|
|
} else {
|
|
|
$resultb = -1;
|
|
|
}
|
|
|
- } elseif ($model->odds_code == "half_total_goal_three") {
|
|
|
- if ($qjnum[0] <= $Firsthalftod and $qjnum[1] >= $Firsthalftod) {
|
|
|
+ }
|
|
|
+ if ($model->odds_code == "half_total_goal_three") {
|
|
|
+ if ($firsthalftod==3) {
|
|
|
$resultb = 1;
|
|
|
} else {
|
|
|
$resultb = -1;
|
|
|
}
|
|
|
- } else {
|
|
|
- $data = [
|
|
|
- 'result' => 100,
|
|
|
- 'matchResult' => "参数不存在",
|
|
|
- ];
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if ($results == 1) {
|
|
|
$data = [
|
|
|
'result' => 1,
|
|
|
'matchResult' => "$resulttod(全场)",
|
|
|
];
|
|
|
- }
|
|
|
- if ($results == -1) {
|
|
|
+ }
|
|
|
+ if($results == -1) {
|
|
|
$data = [
|
|
|
'result' => -1,
|
|
|
'matchResult' => "$resulttod(全场)",
|
|
|
];
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
if ($resultb == 1) {
|
|
|
$data = [
|
|
|
'result' => 1,
|
|
|
'matchResult' => "$resulttod(半场)",
|
|
|
];
|
|
|
- }
|
|
|
- if ($resultb == -1) {
|
|
|
+ }
|
|
|
+ if($resultb == -1) {
|
|
|
$data = [
|
|
|
'result' => -1,
|
|
|
'matchResult' => "$resulttod(半场)",
|
|
|
];
|
|
|
}
|
|
|
-
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//球队进球数:大/小
|
|
|
//condition 0.5 或 0.5/1 这种
|
|
|
public function tema_ball($model, $resultModels, $result_match_r = [])
|
|
|
{
|
|
|
$resultModel = $resultModels['0'];
|
|
|
- $returnDatas = ['result' => -1, 'matchResult' => '(异常)'];
|
|
|
- $condArr = explode("/", $model->condition);
|
|
|
- $smin = trim($condArr['0']);
|
|
|
- $smax = (count($condArr) == 1) ? 0 : trim($condArr['1']);
|
|
|
- if (count($condArr) == 2) {
|
|
|
- ($smin > $smax) ? $this->exchage($smin, $smax) : '';
|
|
|
- }
|
|
|
- $odds_code = $model->odds_code;
|
|
|
+
|
|
|
+ $odds_code = trim($model->odds_code);
|
|
|
$score_home = intval($resultModel->home_score);
|
|
|
$score_guest = intval($resultModel->guest_score);
|
|
|
$score_home_uhalf = intval($resultModel->u_home_score);
|
|
|
@@ -823,116 +812,36 @@ class ZqRule
|
|
|
|
|
|
switch ($odds_code) {
|
|
|
case 'home_tema_ball_big':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_home > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_home > $smax) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_home >= $smin && $score_home <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
$returnDatas['matchResult'] = $score_home . '(全场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_home,$model->condition,2,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'home_tema_ball_small':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_home > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_home < $smin) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_home <= $smax && $score_home >= $smin) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
$returnDatas['matchResult'] = $score_home . '(全场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_home,$model->condition,1,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'guest_tema_ball_big':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_guest > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_guest > $smax) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_guest >= $smin && $score_guest <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
$returnDatas['matchResult'] = $score_guest . '(全场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_guest,$model->condition,2,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'guest_tema_ball_small':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_guest > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_guest < $smin) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_guest >= $smin && $score_guest <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
$returnDatas['matchResult'] = $score_guest . '(全场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_guest,$model->condition,1,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'half_home_tema_ball_big':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_home_uhalf > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_home_uhalf > $smax) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_home_uhalf >= $smin && $score_home_uhalf <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
$returnDatas['matchResult'] = $score_home_uhalf . '(上全场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_home_uhalf,$model->condition,2,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'half_home_tema_ball_small':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_home_uhalf > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_home_uhalf < $smin) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_home_uhalf >= $smin && $score_home_uhalf <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
$returnDatas['matchResult'] = $score_home_uhalf . '(上全场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_home_uhalf,$model->condition,1,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'half_guest_tema_ball_big':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_guest_uhalf > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_guest_uhalf > $smax) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_guest_uhalf >= $smin && $score_guest_uhalf <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
- $returnDatas['matchResult'] = $score_guest_uhalf . '(上全场)';
|
|
|
+ $returnDatas['matchResult'] = $score_guest_uhalf . '(上半场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_guest_uhalf,$model->condition,2,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
case 'half_guest_tema_ball_small':
|
|
|
- if (count($condArr) == 1) {
|
|
|
- if ($score_guest_uhalf > $condArr['0']) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if ($score_guest_uhalf < $smin) {
|
|
|
- $returnDatas['result'] = 1;
|
|
|
- } elseif ($score_guest_uhalf >= $smin && $score_guest_uhalf <= $smax) {
|
|
|
- $returnDatas['result'] = 3;
|
|
|
- }
|
|
|
- }
|
|
|
- $returnDatas['matchResult'] = $score_guest_uhalf . '(上全场)';
|
|
|
+ $returnDatas['matchResult'] = $score_guest_uhalf . '(上半场)';
|
|
|
+ $returnDatas = $this->zq_inball_bigsmall($score_guest_uhalf,$model->condition,1,$returnDatas['matchResult']);
|
|
|
break;
|
|
|
}
|
|
|
return $returnDatas;
|
|
|
@@ -1188,14 +1097,15 @@ class ZqRule
|
|
|
$odds_code = $model->odds_code;
|
|
|
$isHalf = strpos(strtolower($odds_code), 'half');
|
|
|
if ($isHalf) {
|
|
|
- return $this->corner_ball_all($model, $resultModels, $result_match_r);
|
|
|
- } else {
|
|
|
return $this->corner_ball_half($model, $resultModels, $result_match_r);
|
|
|
+ } else {
|
|
|
+ return $this->corner_ball_all($model, $resultModels, $result_match_r);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function corner_ball_all($model, $resultModels, $result_match_r)
|
|
|
{
|
|
|
+
|
|
|
$resultModel = $resultModels['0'];
|
|
|
if ($resultModel->corner_ball == '') {
|
|
|
$game_ret = json_decode(json_encode(['home' => 0, 'guest' => 0, 'home_half' => 0, 'guest_half' => 0]));
|