彭俊 6 лет назад
Родитель
Сommit
ad69cf6d56

+ 1 - 1
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -47,7 +47,7 @@ class SoccerNoteListController extends Controller
         $dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $dt->addColsFields('order_status', array('sort' => false, 'width' => 90));
         $dt->addColsFields('account_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 110));
-        $dt->addColsFields('game_status', array('sort' => false, 'width' => 80));
+        $dt->addColsFields('game_status', array('sort' => false, 'width' =>70));
         //$arr[] = 'view';
 //        if (checkRriv('/admin/SoccerNoteList/edit')) {
 //            $arr[] = 'edit';

+ 26 - 11
app/Http/Controllers/Admin/SportsfootController.php

@@ -38,8 +38,8 @@ class SportsfootController extends Controller {
 		$dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 70));
 		$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 110));
 		$dt->addColsFields('sxalfcourt', array('templet' => '#sxalfcourt', 'sort' => false, 'width' => 300));
+        $dt->addColsFields('statusmatch', array('templet' => '#statusmatch', 'sort' => false, 'width' => 150,'align' => 'left'));
 		$dt->addColsFields('operation', array('templet' => '#status', 'sort' => false, 'width' => 300));
-        // $dt->addColsFields('status', array('templet' => '#status', 'sort' => false, 'width' => 150,'align' => 'left'));
         // $arr[] = 'view';
 		// if (checkRriv('/admin/sportsfoot/edit')) {
 		// 	$arr[] = 'edit';
@@ -164,7 +164,7 @@ class SportsfootController extends Controller {
         if (!empty($end_time)) {
             $end_time = date('Y-m-d H:i:s', strtotime($end_time));
             $where[] = array('st_zq_result.update_time', '<=', $end_time);
-        }//var_dump($where);var_dump($orwhere);die;
+        }
         $newapp = new \App\Models\Stzqresult();
         $data = $newapp->resultlist($list, $page, $where, $orwhere);
         
@@ -260,29 +260,44 @@ class SportsfootController extends Controller {
 			$data['guest_score'] = $num;
 			$res = $newapp->updateInfo($data,$id);//联赛id
 			$this->addcomendnotice($match_id);
+			// $data = \App\Models\Comendnotice::where('match_id', $match_id)->first();
+			// if(!$data){
+			// 	$model = new \App\Models\Comendnotice();
+			// 	$model->status = 0;//联赛id
+			// 	$model->game_code = 'zq';
+			// 	$model->match_id = $match_id;//赛事id
+			// 	$model->ctime = date('Y-m-d H:i:s');
+			// 	$model->save();
+
+			// 	$newapp = new \App\Lib\Settlement\SettlementWinFail();
+			// 	return $newapp->doRun($model->id);
+			// }else{
+			// 	$newapp = new \App\Lib\Settlement\SettlementWinFail();
+			// 	return $newapp->doRun($data->toArray()['id']);
+			// }
 		}
 		return responseToJson($res);
 	}
 
 	//添加赛事结束纪录
-	function addcomendnotice($id){
-		// $id = '3214775';
-		$data = \App\Models\Comendnotice::where('match_id', $id)->first();
+	function addcomendnotice($match_id){
+		$data = \App\Models\Comendnotice::where('match_id', $match_id)->first();
 		if(!$data){
 			$model = new \App\Models\Comendnotice();
 			$model->status = 0;//联赛id
 			$model->game_code = 'zq';
-			$model->match_id = $id;//赛事id
+			$model->match_id = $match_id;//赛事id
 			$model->ctime = date('Y-m-d H:i:s');
-			$bid = $model->save();
+			$model->save();
 
 			$newapp = new \App\Lib\Settlement\SettlementWinFail();
-			$newapp->doRun($bid);
+			$newapp->doRun($model->id);
+		}else{
+			$newapp = new \App\Lib\Settlement\SettlementWinFail();
+			$newapp->doRun($data->toArray()['id']);
 		}
-// return $bid;
-		// return responseToJson(1);
+
 	}
 	
 	
-	
 }

+ 90 - 58
app/Http/Controllers/Api/WriteSportsController.php

@@ -21,52 +21,82 @@ class WriteSportsController extends BaseController{
     public function setSports(Req $data){
 
         try {
-            $obt = $data->data;
-            $getData = $this->getAddData($obt);
             //开启事务
             DB::beginTransaction();
-            //当只有一个参数时,则写滚球结果
+            //当只有球类代码,则写滚球结果
             if($data->game_code){
                 //将所有进行中的赛事写入结果
-                $ret = $this->match_result($data->game_code);
-                return Response::success();
-
+                $this->match_result($data->game_code);
             }
-            foreach ($getData as $k=>$v){
-                switch ($v['title']){
-                    case 'area'://地区
-                        throw new \Exception(Response::generate(Response::AUTH_ERROR)) ;
-                        break;
-                    case 'country'://国家
-                        throw new \Exception(Response::generate(Response::AUTH_ERROR));
-                        break;
-                    case 'league'://联赛
-                        $ret = $this->league($v);
-                        break;
-                    case 'competition'://赛事
-                        $ret = $this->competition($v);
-                        break;
-                    case 'odds'://赔率
-                        $ret = $this->odds($v);
-                        break;
-                    case 'league_result'://联赛结果
-    //                return Response::generate(Response::AUTH_ERROR);
-                        $ret = $this->league_result($v);
-                        break;
-                    case 'match_result'://赛事结果
-                        throw new \Exception(Response::generate(Response::AUTH_ERROR));
-                        $ret = $this->match_result($v);
-                        break;
-                    case 'match_result_record'://赛事结果记录
-                        $ret = $this->com_result_record($v);
-                        break;
-                    case 'odds_record'://赔率记录
-                        $ret = $this->odds_record($v);
-                        break;
-                    default:
-                        throw new \Exception(Response::generate(Response::ABNORMAL)) ;
+            //写赛事数据
+            $obt = $data->data;
+            if($obt){
+                $getData = $this->getAddData($obt);
+//                            return Response::success($getData);
+
+                $league = [];
+                $competition = [];
+                $odds = [];
+                $league_result = [];
+                $match_result = [];
+                $match_result_record = [];
+                $odds_record = [];
+                //指定排序
+                foreach ($getData as $k=>$v){
+                    if($v['title'] == 'league') $league[] = $v;
+                    if($v['title'] == 'competition') $competition[] = $v;
+                    if($v['title'] == 'odds') $odds[] = $v;
+                    if($v['title'] == 'league_result') $league_result[] = $v;
+                    if($v['title'] == 'match_result') $match_result[] = $v;
+                    if($v['title'] == 'match_result_record') $match_result_record[] = $v;
+                    if($v['title'] == 'odds_record') $odds_record[] = $v;
+                }
+                $matchData = [$league,$competition,$odds,$league_result,$match_result,$match_result_record,$odds_record];
+                //排空处理
+                foreach ($matchData as $k=>$v){
+                    if($v == []) unset($matchData[$k]);
+                }
+//                $dd = [];
+                //根据顺序写入数据
+//                return Response::success($matchData);
+                foreach ($matchData as $k=>$v){
+                    foreach ($v as $kk =>$vv){
+
+                        switch ($vv['title']){
+                            case 'area'://地区
+                                throw new \Exception(Response::generate(Response::AUTH_ERROR)) ;
+                                break;
+                            case 'country'://国家
+                                throw new \Exception(Response::generate(Response::AUTH_ERROR));
+                                break;
+                            case 'league'://联赛
+                                $ret = $this->league($vv);
+//                                $dd[] = $ret;
+                                break;
+                            case 'competition'://赛事
+                                $this->competition($vv);
+                                break;
+                            case 'odds'://赔率
+                                $this->odds($vv);
+                                break;
+                            case 'league_result'://联赛结果
+                                $this->league_result($vv);
+                                break;
+                            case 'match_result'://赛事结果
+                                throw new \Exception(Response::generate(Response::AUTH_ERROR));
+                                $this->match_result($vv);
+                                break;
+                            case 'match_result_record'://赛事结果记录
+                                $this->com_result_record($vv);
+                                break;
+                            case 'odds_record'://赔率记录
+                                $this->odds_record($vv);
+                                break;
+                            default:
+                                throw new \Exception(Response::generate(Response::ABNORMAL)) ;
+                        }
+                    }
                 }
-
             }
             //提交事务
             DB::commit();
@@ -78,7 +108,6 @@ class WriteSportsController extends BaseController{
         }
     }
 
-
     //计算滚球 赛事进行时间
     private function secTime($sec=0){
         $min = floor($sec/60);
@@ -171,15 +200,14 @@ class WriteSportsController extends BaseController{
         //根据球类代码获取相关model
         $model =commonFunction::getModels($game_code,1);
         $data = $opt['data'];
-        if(empty($data['belong'])) throw new \Exception(Response::generate(Response::COUNTRY_ERROR)) ;//Render([], '10013', lang('Tips','Sports')->get('country_error'));
-        //获取联赛所属 国家/地区id
-        $belong = St_area_countryModel::getID($data['belong']);
-        $set_lg['area_id'] = $belong['area_id'];
-        $set_lg['country_id'] = $belong['country_id'];
+//        if(empty($data['belong'])) throw new \Exception(Response::generate(Response::COUNTRY_ERROR)) ;//Render([], '10013', lang('Tips','Sports')->get('country_error'));
+//        //获取联赛所属 国家/地区id
+//        $belong = St_area_countryModel::getID($data['belong']);
+        $set_lg['area_id'] = 0;//$belong['area_id'];
+        $set_lg['country_id'] = 0;// $belong['country_id'];
 
         //查询中间表 是否已记录
-        $lg_id = $model['model_local_league']::select('lg_id')
-            ->where(['others_lg_id'=>$data['lg_id'],'source'=>$data['source']])
+        $lg_id = $model['model_local_league']::where(['others_lg_id'=>$data['lg_id'],'source'=>$data['source']])
             ->value('lg_id');
 
         //如果没有记录
@@ -187,14 +215,18 @@ class WriteSportsController extends BaseController{
             //查询联赛是否已存在
             $id = $model['model_league']::where('name_chinese','=',$data['name_chinese'])
                 ->value('id');
+            $last_time = '2019-12-31 23:59:59';
+            //决赛时间
+            if($data['last_time']){
+                $last_time = $data['last_time'];
+            }
             if(empty($id)){
                 $set_lg['name_chinese'] = $data['name_chinese'];
                 $set_lg['kind'] = $data['kind'];
                 $set_lg['match_mode'] = $data['match_mode'];
                 $set_lg['if_stop'] = $data['if_stop'];
-                $set_lg['last_time'] = $data['last_time'];
+                $set_lg['last_time'] = $last_time;
                 $set_lg['utime'] = date('Y-m-d H:m:i');
-
                 $id = $model['model_league']::insertGetId($set_lg);
                 $m_lg_id = $id;
                 if($m_lg_id < 1) throw new \Exception(Response::generate(Response::INSERT_ERROR));
@@ -207,12 +239,12 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_local_league']::insertGetId($set_local);
             if($ret < 1) throw new \Exception(Response::generate(Response::LOCAL_LEAGUE_ERROR)) ;//Render([], '10017', lang('Tips','Sports')->get('local_league_error'));
         }
-        return Response::success();
+        return 1;
+//        return Response::success();
     }
 
     //写入赛事数据
     public function competition($opt = []){
-
         $game_code = $opt['game_code'];
         //根据球类代码获取相关model
         $model = commonFunction::getModels($game_code,1);
@@ -283,7 +315,7 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_local_match']::insertGetId($set_local);
             if($ret < 1) throw new \Exception(Response::generate(Response::LOCAL_MATCH_ERROR)) ;//Render([], '10018', lang('Tips','Sports')->get('local_match_error'));
         }
-        return Response::success();
+//        return Response::success();
     }
 
     //写入赔率数据
@@ -343,7 +375,7 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_odds']::insert($set_odds);
             if($ret != true) throw new \Exception(Response::generate(Response::ADD_ODDS_ERROR));//Render([], '10019', lang('Tips','Sports')->get('add_odds_error'));
         }
-        return Response::success();
+//        return Response::success();
     }
 
     //写入联赛结果
@@ -377,7 +409,7 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_league_result']::insert($set_lg_result);
             if($ret != true) throw new \Exception(Response::generate(Response::ADD_LG_R_ERROR));//Render([], '10021', lang('Tips','Sports')->get('add_lg_r_error'));
         }
-        return Response::success();
+//        return Response::success();
     }
 
     //写入赛事结果
@@ -430,7 +462,7 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_result']::insert($set_match_r);
             if($ret != true) throw new \Exception(Response::generate(Response::ADD_MATCH_R_ERROR)) ;//Render([], '10022', lang('Tips','Sports')->get('add_match_r_error'));
         }
-        return Response::success();
+//        return Response::success();
     }
 
     //写入赛事结果记录
@@ -480,7 +512,7 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_result_record']::insert($set_match_r);
             if($ret != true) throw new \Exception(Response::generate(Response::ADD_MATCH_R_R_ERROR));//Render([], '10022', lang('Tips','Sports')->get('add_match_r_r_error'));
         }
-        return Response::success();
+//        return Response::success();
     }
 
     //写入赔率记录
@@ -538,7 +570,7 @@ class WriteSportsController extends BaseController{
             $ret = $model['model_odds_record']::insert($set_odds);
             if($ret != true) throw new \Exception(Response::generate(Response::ADD_ODDS_R_ERROR));//Render([], '10020', lang('Tips','Sports')->get('add_odds_r_error'));
         }
-        return Response::success();
+//        return Response::success();
     }
 
     /**

+ 18 - 12
app/Lib/Settlement/SettlementOrder.php

@@ -65,8 +65,8 @@ class SettlementOrder extends SettlementBase
                 return self::makeData(10, '不同场比赛不能同时结算!');
             }
         }
-        $this->match_id = $game_code;
-        $this->game_code = $match_id;
+        $this->match_id = $match_id;
+        $this->game_code = $game_code;
 
 
         try {
@@ -78,7 +78,7 @@ class SettlementOrder extends SettlementBase
                 $this->BuyDatasMainModel = $this->orderTypeGet($order_id, $bettype);
 
                 if ($this->BuyDatasMainModel->settle_status == 2) {
-                   continue;
+                    continue;
                 }
                 if ($bettype == 1) {
                     $this->SingOrder($order_id);
@@ -86,6 +86,10 @@ class SettlementOrder extends SettlementBase
                     $this->ChuanOrder($order_id);
                 }
             }
+
+            $this->cgStatus($game_code, $match_id);
+
+
             DB::commit();
         } catch (\Exception $e) {
             DB::rollBack();
@@ -172,7 +176,7 @@ class SettlementOrder extends SettlementBase
      * @param mixed $money 投注金额
      * @param mixed $match_id 赛场ID
      */
-    public function insertData($order_id, $returnMoney, $account_identity, $type, $game_name, $buy_identity, $money,$match_id=0)
+    public function insertData($order_id, $returnMoney, $account_identity, $type, $game_name, $buy_identity, $money, $match_id = 0)
     {
         // 查询用户当前剩余金额
         $accountInfo = DB:: table('account_detailed')
@@ -240,9 +244,6 @@ class SettlementOrder extends SettlementBase
             ]);
         }
 
-        DB::table("st_".$game_name."_result")->where(['match_id'=>$match_id])->update(['status'=>3]);
-        DB::table("st_".$game_name."_competition")->where(['match_id'=>$match_id])->update(['status'=>3]);
-
     }
 
 
@@ -257,7 +258,7 @@ class SettlementOrder extends SettlementBase
 
 
         $newTime = date('Y-m-d H:i:s');
-        if ($this->BuyDatasMainModel->status==1){
+        if ($this->BuyDatasMainModel->status == 1) {
             $in_array = [];
             foreach ($matchModels as $val) {
                 if (!in_array($val->result, [-1, 1, 2, 3, 4])) {
@@ -276,7 +277,7 @@ class SettlementOrder extends SettlementBase
             $lasPeilv = $this->stringComputing([$in_array, $chuanNum]);
             $money = floatPointDigit($this->BuyDatasMainModel->money * $lasPeilv);
 
-        }else{
+        } else {
             $money = $this->BuyDatasMainModel->money;
         }
 
@@ -286,7 +287,7 @@ class SettlementOrder extends SettlementBase
         }
 
         $this->WriteOrAddSettlement($this->game_code, $this->match_id, $this->orderType, $order_id, $this->BuyDatasMainModel->account_identity, $money);
-        $this->insertData($order_id, $money, $this->BuyDatasMainModel->account_identity, 2, $val->game_code, $this->BuyDatasMainModel->info_identity, $money,$this->match_id);
+        $this->insertData($order_id, $money, $this->BuyDatasMainModel->account_identity, 2, $val->game_code, $this->BuyDatasMainModel->info_identity, $this->BuyDatasMainModel->money, $this->match_id);
 
         return true;
 
@@ -334,7 +335,7 @@ class SettlementOrder extends SettlementBase
                 $orderList[$val->order_id] = $val;
             }
         } else {
-            $order_list = DB::table('money_buy_str') > where(['status' => 1])->whereIn('order_id', $order_ids)->get();
+            $order_list = DB::table('money_buy_str')->where(['status' => 1])->whereIn('order_id', $order_ids)->get();
             foreach ($order_list as $val) {
                 $orderList[$val->order_id] = $val;
             }
@@ -348,7 +349,7 @@ class SettlementOrder extends SettlementBase
             if (intval($money) * 100 == 0) {
                 continue;
             }
-            $this->insertData($oid, $money, $val->account_identity, $bettype, $game_code, $orderList[$oid]->info_identity, $money,$this->match_id);
+            $this->insertData($oid, $money, $val->account_identity, $bettype, $game_code, $orderList[$oid]->info_identity, $money, $this->match_id);
         }
         $table = $bettype == 1 ? 'money_buy_simplex' : 'money_buy_str';
         if ($bettype == 1) {
@@ -391,5 +392,10 @@ class SettlementOrder extends SettlementBase
         return true;
     }
 
+    private function cgStatus($game_code, $match_id)
+    {
+        DB::table("st_" . $game_code . "_result")->where(['match_id' => $match_id])->update(['status' => 3]);
+        DB::table("st_" . $game_code . "_competition")->where(['match_id' => $match_id])->update(['status' => 3]);
+    }
 
 }

+ 4 - 4
app/Lib/Settlement/SettlementWinFail.php

@@ -119,7 +119,7 @@ class SettlementWinFail
                 foreach ($fsval as $sval) {
                     $winorfalse = $this->winOrfalseInfo($sval);
                     $wininfo = $winorfalse['result'];
-                    $matchinfo = $winorfalse['matchResut'];
+                    $matchinfo = $winorfalse['matchResult'];
                     $this->makesql_up_buymatch_winorfalse($sval->id, $wininfo, date("Y-m-d H:i:s"), $matchinfo);
                 }
             }
@@ -160,7 +160,7 @@ class SettlementWinFail
                 }
                 $winorfalse = $this->winOrfalseInfo($sval);
                 $wininfo = $winorfalse['result'];
-                $matchinfo = $winorfalse['matchResut'];
+                $matchinfo = $winorfalse['matchResult'];
                 $this->makesql_up_buymatch_winorfalse($sval->id, $wininfo, date("Y-m-d H:i:s"), $matchinfo);
                 $sql = "update money_buy_str  set  wait_match_num=wait_match_num-1 where  batch_id='$sval->batch_id' ";
                 DB::update($sql);
@@ -201,7 +201,7 @@ class SettlementWinFail
             }
         }
 
-        if (isset($winorfalse['result']) || isset($winorfalse['matchResut'])) {
+        if (!isset($winorfalse['result']) || !isset($winorfalse['matchResult'])) {
             throw new \Exception('输赢结果数据结构异常!', 40011);
         }
 
@@ -214,7 +214,7 @@ class SettlementWinFail
 
     private function makesql_up_buymatch_winorfalse($id, $result, $utime, $matchResult = '')
     {
-        $sql = " update  money_buy_match  set  result=$result,utime='$utime',matchResult='$matchResult'  where id=$id  ";
+        $sql = " update  money_buy_match  set  result=$result,utime='$utime',\"matchResult\"='$matchResult'  where id=$id  ";
         DB::update($sql);
 
         return true;

+ 9 - 11
app/Models/MoneyBuyStr.php

@@ -91,6 +91,7 @@ class MoneyBuyStr extends BaseModel {
             //用户投注前账户金额
             $data[$i]->available_cash = $data[$i]->money_cash+$data[$i]->money;
             $data[$i]->account_money = $data[$i]->available_cash.' <span>'.$data[$i]->money.' </span> '.$data[$i]->frozen_cash;
+            //订单作废时账户可用余额
             if($data[$i]->status == 2 || $data[$i]->status == 3){
                 for($b=0;$b<count($invalid_money);$b++){
                     if($data[$i]->order_id == $invalid_money[$b]->trade_id){
@@ -148,17 +149,17 @@ class MoneyBuyStr extends BaseModel {
         $odds_code = \App\Models\Matchcode::get();
         for($i=0;$i<count($data);$i++){
 
+            //当父级玩法代码为first_last_ball/half_full/capot/two_sides时,不显示赔率条件
             if($data[$i]->p_code == 'first_last_ball' || $data[$i]->p_code == 'half_full' || $data[$i]->p_code == 'capot' || $data[$i]->p_code == 'two_sides' ){
                 $data[$i]->condition = '';
             }
             
-            $league = DB::table('st_'.$data[$i]->game_code.'_league')->join('st_'.$data[$i]->game_code.'_competition','st_'.$data[$i]->game_code.'_competition.lg_id','=','st_'.$data[$i]->game_code.'_league.lg_id')->where('st_'.$data[$i]->game_code.'_league.lg_id',$data[$i]->lg_id)->first();
+            $league = DB::table('st_'.$data[$i]->game_code.'_league')->join('st_'.$data[$i]->game_code.'_competition','st_'.$data[$i]->game_code.'_competition.lg_id','=','st_'.$data[$i]->game_code.'_league.lg_id')->where('st_'.$data[$i]->game_code.'_league.lg_id',$data[$i]->lg_id)->where('st_'.$data[$i]->game_code.'_competition.match_id',$data[$i]->match_id)->first();
             if(!empty($league)){
+                //联赛名称
                 $data[$i]->league = $league->name_chinese;
+                //赛事开赛时间
                 $data[$i]->time = $league->match_date.' '.$league->match_time;
-
-            }else{
-                $data[$i]->league = $data[$i]->lg_id;
             }
 
             if(!empty(strstr($data[$i]->odds_code,'home',true))){
@@ -169,13 +170,10 @@ class MoneyBuyStr extends BaseModel {
             }
 
             if($data[$i]->p_code == 'half_full'){
-                $string = explode('_',$data[$i]->odds_code);
-                if($string[2] == 'home')$string[2]=$data[$i]->home_team;
-                if($string[2] == 'guest')$string[2]=$data[$i]->guest_team;
-                if($string[2] == 'dogfall')$string[2]='和局';
-                if($string[3] == 'home')$string[3]=$data[$i]->home_team;
-                if($string[3] == 'guest')$string[3]=$data[$i]->guest_team;
-                if($string[3] == 'dogfall')$string[3]='和局';
+                $string = str_replace('home',$data[$i]->home_team,$data[$i]->odds_code);
+                $string = str_replace('guest',$data[$i]->guest_team,$string);
+                $string = str_replace('dogfall','和局',$string);
+                $string = explode('_',$string);
                 $data[$i]->team = $string['2'].'/'.$string['3'];
             }
 

+ 4 - 7
app/Models/SportsNoteList.php

@@ -115,13 +115,10 @@ class SportsNoteList extends BaseModel {
                     }
 
                     if($content[$b]->p_code == 'half_full'){
-                        $string = explode('_',$content[$b]->odds_code);
-                        if($string[2] == 'home')$string[2]=$data[$i]->home_team;
-                        if($string[2] == 'guest')$string[2]=$data[$i]->guest_team;
-                        if($string[2] == 'dogfall')$string[2]='和局';
-                        if($string[3] == 'home')$string[3]=$data[$i]->home_team;
-                        if($string[3] == 'guest')$string[3]=$data[$i]->guest_team;
-                        if($string[3] == 'dogfall')$string[3]='和局';
+                        $string = str_replace('home',$data[$i]->home_team,$content[$b]->odds_code);
+                        $string = str_replace('guest',$data[$i]->guest_team,$string);
+                        $string = str_replace('dogfall','和局',$string);
+                        $string = explode('_',$string);
                         $data[$i]->team = $string['2'].'/'.$string['3'];
                     }
                 }

+ 4 - 0
app/Models/SportsSoccer.php

@@ -113,6 +113,10 @@ class SportsSoccer extends BaseModel {
                 $data[$i]->status = '正在进行';
             }else if($data[$i]->status==2){
                 $data[$i]->status = '已结束';
+            }else if($data[$i]->status==3){
+                $data[$i]->status = '已结算';
+            }else if($data[$i]->status==4){
+                $data[$i]->status = '已作废';
             }
 
             if($data[$i]->guest_team == ''){

+ 1 - 0
resources/lang/zh-cn/sportsfoot.php

@@ -37,6 +37,7 @@ return array(
 	'dsnum' => '单式注单数',
 	'csnum' => '串式注单数',
 	'sxalfcourt' => '上半场/全场比分',
+	'statusmatch' => '比赛状态',
 	
 	'name_chinese' => '中文名称',
     'name_english' => '英文全称',

+ 18 - 11
resources/views/admin/sportsfoot/outcome.blade.php

@@ -43,7 +43,7 @@
 
     <script type="text/html" id="status">
         @{{#if(d.status==1 || d.status==2){ }}
-            <span><li class="layui-btn layui-btn-sm lay-btn-diy" onclick="settlement(@{{d.match_id}},1)">结算</li></span>
+            <span><li class="layui-btn layui-btn-sm layui-btn-green set" onclick="settlement(@{{d.match_id}},1)">结算</li></span>
         @{{#} }}
         @{{#if(d.status==3){ }}
             <span><li class="layui-btn   layui-btn-sm layui-btn-normal reset" onclick="settlement(@{{d.match_id}},2)">再结算</li></span>
@@ -56,6 +56,18 @@
         @{{#} }}
     </script>
 
+    <script type="text/html" id="statusmatch">
+      @{{#if(d.status==1){ }}
+        <span>未开始</span>
+      @{{#} }}
+      @{{#if(d.status==2){ }}
+        <span>进行中</span>
+      @{{#} }}
+      @{{#if(d.status==3){ }}
+        <span>已结束</span>
+      @{{#} }}
+    </script>
+
     <script type="text/html" id="sxalfcourt">
       @{{#if(d.match_time!=null){ }}
         <!-- <span>@{{ d.match_time}}</span> -->
@@ -89,7 +101,7 @@
 					<div class="layui-inline">
 						<label class="layui-form-label">{{ trans('sportsfoot.status') }}</label>
 						<div class="layui-input-inline" style="width: 200px">
-							<select name="status"  id="form_status"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
+							<select name="status"  id="status"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
 								<option value="-1">{{ trans('sportsfoot.select_status') }}</option>
 								@foreach(trans('status.match_status.status') as $k=>$v):
 									@if($status==$k))
@@ -121,14 +133,10 @@
                     <div class="layui-inline">
                         <label class="layui-form-label">相关操作:</label>
                         <div class="layui-input-inline" style="width: 200px">
-                            <select name="name_chinese"  id="name_chinese"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
+                            <select name=""  id=""  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
                                 <option value="">选择确认</option>
                                 @foreach(trans('status.xgstatus.status') as $k=>$v):
-                                    @if($status==$k)
-                                    <option value="{{$v['name_chinese']}}" selected>{{$v['name_chinese']}}</option>
-                                    @else
                                     <option value="{{$k}}">{{$v}}</option>
-                                    @endif
                                 @endforeach
                                 <option value="">设为无效</option>
                             </select>
@@ -180,7 +188,7 @@
         })
 
         //刷新赛事数据
-        function refreshall(game_code){
+        function refreshall(game_code){ 
             var game_code = game_code;
             $.ajax({
                 type: 'POST',
@@ -188,10 +196,9 @@
                 url: '/setSports',
                 data: {game_code:game_code},
                 success: function(data) {
-                    alert(data);
+                    // alert(data);
                     if(data.status==1){
-                        layer.msg('刷新成功');
-                        reloadDataTable();
+                        layer.msg(data.msg);
                         location. reload()//刷新当前页面
                     }
                 }