|
|
@@ -11,4 +11,482 @@ namespace App\Lib\Settlement\Adapter;
|
|
|
class BqRule
|
|
|
{
|
|
|
|
|
|
+ /**
|
|
|
+ * 让球公共函数
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $difference 分差
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function concedeCommon($model, $difference){
|
|
|
+ // 让球个数
|
|
|
+ $condition = intval($model -> condition);
|
|
|
+ // 差值
|
|
|
+ $resultScore = $difference + $condition;
|
|
|
+ if ($resultScore > 0) {
|
|
|
+ $result = 1;
|
|
|
+ } elseif ($resultScore < 0) {
|
|
|
+ $result = -1;
|
|
|
+ } else {
|
|
|
+ $result = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 大小公共函数
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $allGoal 总分
|
|
|
+ * @param mixed $size 大小 1:大 -1:小
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function sizeCommon($model, $allGoal, $size){
|
|
|
+ // 总球条件
|
|
|
+ $condition = intval($model -> condition);
|
|
|
+ // 差值
|
|
|
+ if ($size == 1) {
|
|
|
+ $resultScore = $allGoal - $condition;
|
|
|
+ } else {
|
|
|
+ $resultScore = $condition - $allGoal;
|
|
|
+ }
|
|
|
+ if ($resultScore > 0) {
|
|
|
+ $result = 1;
|
|
|
+ } elseif ($resultScore < 0) {
|
|
|
+ $result = -1;
|
|
|
+ } else {
|
|
|
+ $result = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 全场|主队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_concede_home($model, $resultModel, $resultRecords){
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($resultModel -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($resultModel -> guest_score);
|
|
|
+ // 分差 - 主 :客
|
|
|
+ $difference = $homeScore - $guestScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 全场|客队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_concede_guest($model, $resultModel, $resultRecords){
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($resultModel -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($resultModel -> guest_score);
|
|
|
+ // 分差 - 客 :主
|
|
|
+ $difference = $guestScore - $homeScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上半场|主队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_half_concede_home($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $upResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$upResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$upResultKey] -> guest_score);
|
|
|
+ // 分差 - 主 :客
|
|
|
+ $difference = $homeScore - $guestScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上半场|客队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_half_concede_guest($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $upResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$upResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$upResultKey] -> guest_score);
|
|
|
+ // 分差 - 客 :主
|
|
|
+ $difference = $guestScore - $homeScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第一节|主队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_one_concede_home($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$oneResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ // 分差 - 主 :客
|
|
|
+ $difference = $homeScore - $guestScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第一节|客队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_one_concede_guest($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$oneResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ // 分差 - 客 :主
|
|
|
+ $difference = $guestScore - $homeScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第二节|主队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_two_concede_home($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$twoResultKey] -> home_score) - intval($newResultRecords[$oneResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$twoResultKey] -> guest_score) - intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ // 分差 - 主 :客
|
|
|
+ $difference = $homeScore - $guestScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第二节|客队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_two_concede_guest($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$twoResultKey] -> home_score) - intval($newResultRecords[$oneResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$twoResultKey] -> guest_score) - intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ // 分差 - 客 :主
|
|
|
+ $difference = $guestScore - $homeScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第三节|主队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_three_concede_home($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$threeResultKey] -> home_score) - intval($newResultRecords[$twoResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$threeResultKey] -> guest_score) - intval($newResultRecords[$twoResultKey] -> guest_score);
|
|
|
+ // 分差 - 主 :客
|
|
|
+ $difference = $homeScore - $guestScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第三节|客队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_three_concede_guest($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$threeResultKey] -> home_score) - intval($newResultRecords[$twoResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$threeResultKey] -> guest_score) - intval($newResultRecords[$twoResultKey] -> guest_score);
|
|
|
+ // 分差 - 客 :主
|
|
|
+ $difference = $guestScore - $homeScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第四节|主队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_four_concede_home($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $fourResultKey = array_search('第四节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$fourResultKey] -> home_score) - intval($newResultRecords[$threeResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$fourResultKey] -> guest_score) - intval($newResultRecords[$threeResultKey] -> guest_score);
|
|
|
+ // 分差 - 主 :客
|
|
|
+ $difference = $homeScore - $guestScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第四节|客队|让球
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_four_concede_guest($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $fourResultKey = array_search('第四节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 主队得分
|
|
|
+ $homeScore = intval($newResultRecords[$fourResultKey] -> home_score) - intval($newResultRecords[$threeResultKey] -> home_score);
|
|
|
+ // 客队得分
|
|
|
+ $guestScore = intval($newResultRecords[$fourResultKey] -> guest_score) - intval($newResultRecords[$threeResultKey] -> guest_score);
|
|
|
+ // 分差 - 客 :主
|
|
|
+ $difference = $guestScore - $homeScore;
|
|
|
+
|
|
|
+ return $this -> concedeCommon($model, $difference);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|全场|大
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_total_sizes_big($model, $resultModel, $resultRecords){
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($resultModel -> home_score) + intval($resultModel -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|全场|小
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_total_sizes_small($model, $resultModel, $resultRecords){
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($resultModel -> home_score) + intval($resultModel -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, -1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|上半场|大
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_half_total_sizes_big($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $upResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$upResultKey] -> home_score) + intval($newResultRecords[$upResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|上半场|小
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_half_total_sizes_small($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $upResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$upResultKey] -> home_score) + intval($newResultRecords[$upResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, -1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第一节|大
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_one_total_sizes_big($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$oneResultKey] -> home_score) + intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第一节|小
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_one_total_sizes_small($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$oneResultKey] -> home_score) + intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, -1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第二节|大
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_two_total_sizes_big($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$twoResultKey] -> home_score) + intval($newResultRecords[$twoResultKey] -> guest_score)
|
|
|
+ - intval($newResultRecords[$oneResultKey] -> home_score) - intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第二节|小
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_two_total_sizes_small($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $oneResultKey = array_search('第一节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$twoResultKey] -> home_score) + intval($newResultRecords[$twoResultKey] -> guest_score)
|
|
|
+ - intval($newResultRecords[$oneResultKey] -> home_score) - intval($newResultRecords[$oneResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, -1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第三节|大
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_three_total_sizes_big($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$threeResultKey] -> home_score) + intval($newResultRecords[$threeResultKey] -> guest_score)
|
|
|
+ - intval($newResultRecords[$twoResultKey] -> home_score) - intval($newResultRecords[$twoResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第三节|小
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_three_total_sizes_small($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $twoResultKey = array_search('第二节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$threeResultKey] -> home_score) + intval($newResultRecords[$threeResultKey] -> guest_score)
|
|
|
+ - intval($newResultRecords[$twoResultKey] -> home_score) - intval($newResultRecords[$twoResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, -1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第四节|大
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_four_total_sizes_big($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $fourResultKey = array_search('第四节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$fourResultKey] -> home_score) + intval($newResultRecords[$fourResultKey] -> guest_score)
|
|
|
+ - intval($newResultRecords[$threeResultKey] -> home_score) - intval($newResultRecords[$threeResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总进球|第四节|小
|
|
|
+ * @param mixed $model 注单表数据
|
|
|
+ * @param mixed $resultModel 结果表数据
|
|
|
+ * @param mixed $resultRecords 结果记录表数据
|
|
|
+ * @return string 1:赢 -1:输 2:平 3:赢半平半 4:输半平半
|
|
|
+ */
|
|
|
+ public function lq_four_total_sizes_small($model, $resultModel, $resultRecords){
|
|
|
+ $newResultRecords = array_reverse($resultRecords);
|
|
|
+ $threeResultKey = array_search('第三节', array_column($newResultRecords, 'match_process'));
|
|
|
+ $fourResultKey = array_search('第四节', array_column($newResultRecords, 'match_process'));
|
|
|
+ // 总进球数
|
|
|
+ $allGoal = intval($newResultRecords[$fourResultKey] -> home_score) + intval($newResultRecords[$fourResultKey] -> guest_score)
|
|
|
+ - intval($newResultRecords[$threeResultKey] -> home_score) - intval($newResultRecords[$threeResultKey] -> guest_score);
|
|
|
+ return $this -> sizeCommon($model, $allGoal, -1);
|
|
|
+ }
|
|
|
}
|