|
|
@@ -1260,13 +1260,17 @@ class SoccerNoteListController extends Controller
|
|
|
}
|
|
|
|
|
|
|
|
|
-//单式订单直接手动设置比赛结果 --> 提交胜负判断处理以及 --> 提交结算
|
|
|
- public function manualmatchpdate_v2(Req $req)
|
|
|
+//单式订单直接手动设置比赛结果 --> 提交胜负判断处理以及 --> 提交结算
|
|
|
+ public function ___manualmatchpdate_v2(Req $req)
|
|
|
{
|
|
|
$order_id = isset($req->order_id) ? $req->order_id : 0;
|
|
|
$game_code = isset($req->game_code) ? $req->game_code : 0;
|
|
|
$match_id = isset($req->match_id) ? $req->match_id : 0;
|
|
|
$pdatas = isset($req->matchdata) ? $req->matchdata : [];
|
|
|
+ $ScoreTitle = isset($req->ScoreTitle) ? $req->ScoreTitle : '';//进程
|
|
|
+ $home_sorce = isset($req->home) ? $req->home : '';//主队比分
|
|
|
+ $guest_sorce = isset($req->guest) ? $req->guest : '';//客队比分
|
|
|
+
|
|
|
$pdatas = json_decode($pdatas, true);
|
|
|
if (empty($order_id) || empty($game_code) || empty($match_id) || empty($pdatas)) {
|
|
|
return responseToJson(0, '参数错误');
|
|
|
@@ -1439,12 +1443,217 @@ class SoccerNoteListController extends Controller
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //单式订单直接手动设置比赛结果 --> 提交胜负判断处理以及 --> 提交结算
|
|
|
+ public function manualmatchpdate_v2(Req $req)
|
|
|
+ {
|
|
|
+ $order_id = isset($req->order_id) ? $req->order_id : 0;
|
|
|
+ $game_code = isset($req->game_code) ? $req->game_code : 0;
|
|
|
+ $match_id = isset($req->match_id) ? $req->match_id : 0;
|
|
|
+ $pdatas = isset($req->matchdata) ? $req->matchdata : [];
|
|
|
+ $ScoreTitle = isset($req->ScoreTitle) ? $req->ScoreTitle : '';//进程
|
|
|
+ $home_sorce = isset($req->home) ? $req->home : '';//主队比分
|
|
|
+ $guest_sorce = isset($req->guest) ? $req->guest : '';//客队比分
|
|
|
+
|
|
|
+ $pdatas = json_decode($pdatas, true);
|
|
|
+ if (empty($order_id) || empty($game_code) || empty($match_id) || empty($pdatas)) {
|
|
|
+ return responseToJson(0, '参数错误');
|
|
|
+ }
|
|
|
+ if(in_array(-1,$pdatas)){
|
|
|
+ return responseToJson(-1, '输入比分错误');
|
|
|
+ }
|
|
|
+
|
|
|
+ $buyModel = (new MoneyBuySimplexModel())->where([['order_id', '=', $order_id]])->first();
|
|
|
+ if (empty($buyModel)) {
|
|
|
+ return responseToJson(0, '订单数据错误');
|
|
|
+ }
|
|
|
+
|
|
|
+ $restModel = '';
|
|
|
+ switch ($game_code) {
|
|
|
+ case 'zq':
|
|
|
+ $restModel = DB::table('st_zq_result')->where([['match_id', '=', $match_id]])->first();
|
|
|
+ break;
|
|
|
+ case 'lq':
|
|
|
+ $restModel = DB::table('st_lq_result')->where([['match_id', '=', $match_id]])->first();
|
|
|
+ break;
|
|
|
+ case 'wq':
|
|
|
+ $restModel = DB::table('st_wq_result')->where([['match_id', '=', $match_id]])->first();
|
|
|
+ break;
|
|
|
+ case 'bq':
|
|
|
+ $restModel = DB::table('st_bq_result')->where([['match_id', '=', $match_id]])->first();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (empty($restModel)) {
|
|
|
+ return responseToJson(0, '赛事结果记录没有找到,数据错误');
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($game_code == 'zq') {
|
|
|
+ if($ScoreTitle == '上半'){
|
|
|
+ //替换上半场比分
|
|
|
+ $restModel->u_home_score = $home_sorce;
|
|
|
+ $restModel->u_guest_score = $guest_sorce;
|
|
|
+ }
|
|
|
+ if($ScoreTitle == '全场'){
|
|
|
+ //替换全场比分
|
|
|
+ $restModel->home_score = $home_sorce;
|
|
|
+ $restModel->guest_score = $guest_sorce;
|
|
|
+ }
|
|
|
+ if($ScoreTitle == '角球上半'){
|
|
|
+ //获取角球数据 arr {"home":0,"guest":0,"home_half":0,"guest_half":0}
|
|
|
+ $corner_arr = json_decode($restModel->corner_ball,256);
|
|
|
+ //替换上半场角球比分
|
|
|
+ $corner_arr['home_half'] = $home_sorce;
|
|
|
+ $corner_arr['guest_half'] = $guest_sorce;
|
|
|
+
|
|
|
+ $restModel->corner_ball = json_encode($corner_arr);
|
|
|
+ }
|
|
|
+ if($ScoreTitle == '角球全场'){
|
|
|
+ //获取角球数据 arr {"home":0,"guest":0,"home_half":0,"guest_half":0}
|
|
|
+ $corner_arr = json_decode($restModel->corner_ball,256);
|
|
|
+ //替换全场角球比分
|
|
|
+ $corner_arr['home'] = $home_sorce;
|
|
|
+ $corner_arr['guest'] = $guest_sorce;
|
|
|
+
|
|
|
+ $restModel->corner_ball = json_encode($corner_arr);
|
|
|
+ }
|
|
|
+
|
|
|
+ $restModel->corner_ball = json_decode($restModel->corner_ball, 256);
|
|
|
+ $restModel->penalty_card = json_decode($restModel->penalty_card, 256);
|
|
|
+ $restModel->first_score = json_decode($restModel->first_score, 256);
|
|
|
+ $restModel->warn_more = json_decode($restModel->warn_more, 256);
|
|
|
+
|
|
|
+ $buyModel->single_result = json_encode([$restModel], 256);
|
|
|
+
|
|
|
+ $buyModel->result_flag = 1;
|
|
|
+ $buyModel->is_manual = 1;
|
|
|
+ $ret = $buyModel->save();
|
|
|
+
|
|
|
+ if ($ret) {
|
|
|
+ $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
|
|
|
+
|
|
|
+ if ($ret2['status'] == 1) {
|
|
|
+ return responseToJson(1, '操作成功!');
|
|
|
+ } else {
|
|
|
+ return responseToJson(0, '操作失败2!--' . $ret2['data']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return responseToJson(0, '更新失败1');
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($game_code == 'lq') {
|
|
|
+ $home = $pdatas['home'];
|
|
|
+ $guest = $pdatas['guest'];
|
|
|
+
|
|
|
+ $restModel->home_score = ['1' => intval($home['0']), '2' => intval($home['1']), '3' => intval($home['2']), '4' => intval($home['3'])];
|
|
|
+ $restModel->guest_score = ['1' => intval($guest['0']), '2' => intval($guest['1']), '3' => intval($guest['2']), '4' => intval($guest['3'])];
|
|
|
+ $restModel->u_home_score = intval($home['0']) + intval($home['1']);
|
|
|
+ $restModel->u_guest_score = intval($guest['0']) + intval($guest['1']);
|
|
|
+
|
|
|
+ $all_home = intval($home['0']) + intval($home['1']) + intval($home['2']) + intval($home['3']);
|
|
|
+ $all_guest = intval($guest['0']) + intval($guest['1']) + intval($guest['2']) + intval($guest['3']);
|
|
|
+ $restModel->all_goal = $all_home + $all_guest;
|
|
|
+ $restModel->match_score = $all_home . ':' . $all_guest;
|
|
|
+ $restModel->match_winer = $all_home > $all_guest ? $restModel->home_team : $restModel->guest_team;
|
|
|
+ $restModel->warn_more = json_decode($restModel->warn_more, 256);
|
|
|
+
|
|
|
+ $buyModel->single_result = json_encode([$restModel], 256);
|
|
|
+ $buyModel->result_flag = 1;
|
|
|
+ $buyModel->is_manual = 1;
|
|
|
+ $ret = $buyModel->save();
|
|
|
+
|
|
|
+ if ($ret) {
|
|
|
+ $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
|
|
|
+ if ($ret2['status'] == 1) {
|
|
|
+ return responseToJson(1, '操作成功!');
|
|
|
+ } else {
|
|
|
+ return responseToJson(0, '操作失败2!--' . $ret2['data']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return responseToJson(0, '更新失败1');
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($game_code == 'bq') {
|
|
|
+ $home = $pdatas['home'];
|
|
|
+ $guest = $pdatas['guest'];
|
|
|
+ $home_other = $pdatas['home_other'];
|
|
|
+ $guest_other = $pdatas['guest_other'];
|
|
|
+
|
|
|
+ $arrs = [];
|
|
|
+ for ($i = 0; $i <= 8; $i++) {
|
|
|
+ $j = $i + 1;
|
|
|
+ $arrs[$j] = [
|
|
|
+ 'home' => intval($home[$i]),
|
|
|
+ 'guest' => intval($guest[$i]),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $arrs['other'] = [
|
|
|
+ 'home' => intval($home_other),
|
|
|
+ 'guest' => intval($guest_other),
|
|
|
+ ];
|
|
|
+
|
|
|
+ $restModel->match_score_t = $arrs;
|
|
|
+ $restModel->warn_more = json_decode($restModel->warn_more, 256);
|
|
|
+
|
|
|
+ $buyModel->single_result = json_encode([$restModel], 256);
|
|
|
+ $buyModel->result_flag = 1;
|
|
|
+ $buyModel->is_manual = 1;
|
|
|
+ $ret = $buyModel->save();
|
|
|
+
|
|
|
+ if ($ret) {
|
|
|
+ $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
|
|
|
+ if ($ret2['status'] == 1) {
|
|
|
+ return responseToJson(1, '操作成功!');
|
|
|
+ } else {
|
|
|
+ return responseToJson(0, '操作失败2!--' . $ret2['data']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return responseToJson(0, '更新失败1');
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($game_code == 'wq') {
|
|
|
+ $home = $pdatas['home'];
|
|
|
+ $guest = $pdatas['guest'];
|
|
|
+
|
|
|
+ $arrs = [];
|
|
|
+ for ($i = 0; $i <= 4; $i++) {
|
|
|
+ $j = $i + 1;
|
|
|
+ $arrs[$j] = [
|
|
|
+ 'home' => intval($home[$i]),
|
|
|
+ 'guest' => intval($guest[$i]),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ $restModel->inning = $arrs;
|
|
|
+ $restModel->warn_more = json_decode($restModel->warn_more, 256);
|
|
|
+
|
|
|
+ $buyModel->single_result = json_encode([$restModel], 256);
|
|
|
+ $buyModel->result_flag = 1;
|
|
|
+ $buyModel->is_manual = 1;
|
|
|
+ $ret = $buyModel->save();
|
|
|
+
|
|
|
+ if ($ret) {
|
|
|
+ $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
|
|
|
+ if ($ret2['status'] == 1) {
|
|
|
+ return responseToJson(1, '操作成功!');
|
|
|
+ } else {
|
|
|
+ return responseToJson(0, '操作失败2!--' . $ret2['data']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return responseToJson(0, '更新失败1');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return responseToJson(0, '未做更新', ['order_id' => $order_id, 'game_code' => $game_code, 'match_id' => $game_code, 'datas' => $pdatas]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//修复比分时用到订单信息及比赛结果数据
|
|
|
public function manualmatchget_v2(Req $req)
|
|
|
{
|
|
|
$order_id = isset($req->order_id) ? $req->order_id : 0;
|
|
|
+ $ScoreTitle = isset($req->ScoreTitle) ? $req->ScoreTitle : 0;
|
|
|
+
|
|
|
$model = new MoneyBuySimplexModel();
|
|
|
- $ret = $model->OrderinfoResult($order_id);
|
|
|
+ $ret = $model->OrderinfoResult($order_id,$ScoreTitle);
|
|
|
if ($ret && !empty($ret['result'])) {
|
|
|
return responseToJson(1, '成功', $ret);
|
|
|
} else {
|
|
|
@@ -1520,9 +1729,13 @@ class SoccerNoteListController extends Controller
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
+ //获取球类分类下的父级玩法数据
|
|
|
public function getpcode(){
|
|
|
$game_type = $_GET["game_type"];
|
|
|
- $p_code = \App\Models\StoddsCode::where('p_id',0)->where('game_code',$game_type)->get();
|
|
|
+
|
|
|
+ $pcode = new \App\Models\StoddsCode();
|
|
|
+ $p_code = $pcode->getpcode($game_type);
|
|
|
+
|
|
|
return json_encode($p_code);
|
|
|
}
|
|
|
|