Kaynağa Gözat

追加推送 6/11

彭俊 6 yıl önce
ebeveyn
işleme
928d92dd00

+ 2 - 1
app/Http/Controllers/Admin/SportsfootController.php

@@ -208,7 +208,7 @@ class SportsfootController extends Controller {
         		'home'=>intval($alldata['homeallcorner'])?intval($alldata['homeallcorner']):0,
         		'guest'=>intval($alldata['guestallcorner'])?intval($alldata['guestallcorner']):0,
         		'home_half'=>intval($alldata['homehalfcorner'])?intval($alldata['homehalfcorner']):0,
-        		'guest_half'=>intval($alldata['guesthalfcorner'])?intval($alldata['guesthalfcorner']):0,
+        		'guest_half'=>intval($alldata['guesthalfcorner'])?intval($alldata['guesthalfcorner'])0,
         	);
 
         	$ret = \App\Models\Stzqresult::updateOrCreate(['match_id'=>$match_id],array_merge($alldata,['match_time'=>'00:01','update_time'=>date('Y-m-d H:i:s'),'all_goal'=>$all_goal,'penalty_card'=>json_encode($penaltycard),'corner_ball'=>json_encode($cornerball)]));
@@ -267,6 +267,7 @@ class SportsfootController extends Controller {
 			}
 			$newapp->totalgoal($match_id);
 			return responseToJson($res);
+			$update = $this->addcomendnotice($match_id);
 		}else{
 			return responseToJson($update);
 		}

+ 21 - 7
app/Http/Controllers/Api/SettlementController.php

@@ -32,6 +32,27 @@ class SettlementController extends Controller
 
     public function debug()
     {
+
+        $rule = new ZqRule();
+        $model = DB::table('money_buy_match')->where(['id' => 320])->first();
+        $reco = DB::table('st_zq_result')->where(['id' => 1317823])->get();
+
+        print_r([$model,$reco]);
+        $ret = $rule->tema_ball($model, $reco, []);
+        //corner_concede_home($model, $reco, []);
+        print_r($ret);
+
+
+        exit;
+
+
+
+
+
+
+
+
+
         $cond = '+2.5/3';
         $cond = '+3/3.5';
 
@@ -80,14 +101,7 @@ class SettlementController extends Controller
 
         exit;
 
-        $rule = new ZqRule();
-        $model = DB::table('money_buy_match')->where(['id' => 320])->first();
-        $reco = DB::table('st_zq_result')->where(['id' => 1317823])->get();
-        $ret = $rule->corner_concede_home($model, $reco, []);
-        print_r($ret);
-
 
-        exit;
 
     }
 

+ 1 - 0
app/Lib/Settlement/Adapter/LqRule.php

@@ -11,6 +11,7 @@ use Illuminate\Support\Facades\DB;
 
 class LqRule
 {
+    use RulePlus;
     /**
      * 让球公共函数
      * @param mixed $model 注单表数据

+ 37 - 0
app/Lib/Settlement/Adapter/RulePlus.php

@@ -147,6 +147,43 @@ trait RulePlus
     }
 
 
+    //type ==1 返回第$sn节   ==2返回上下节,sn=1上半场,sn=2下半场    type==4全部按节数的数组
+    public function lq_getResultBySn($recoreModesArray, $type=4, $sn = 1)
+    {
+        $return = [];
+        foreach ($recoreModesArray as $key => $val) {
+            $nowsn = intval($val->match_process);
+            $return[$nowsn] = $val;
+        }
+        if ( !((count($return) == 4 )  && isset($return['1'])  &&  isset($return['2'] )    &&  isset($return['3'])   &&  isset($return['4']))){
+            throw new  \Exception("篮球结果不为4的数组,或match_process有错");
+        }
+
+        if ($type == 4) {
+            return $return;
+        }
+
+        if ($type == 1) {
+            return $return[$sn];
+        }
+
+        if ($type == 2) {
+            if ($sn == 1) {
+                $ret = [
+                    $return[1],
+                    $return[2],
+                ];
+            } else {
+                $ret = [
+                    $return[3],
+                    $return[4],
+                ];
+            }
+        }
+        return $ret;
+    }
+
+
     private function doexchage(&$num1, &$num2)
     {
         $tmp = $num2;