|
|
@@ -131,7 +131,7 @@ class UnSettmatchLogic
|
|
|
}
|
|
|
|
|
|
foreach ($order_main->matchdatas as $matitem) {
|
|
|
- if ($matitem->order_id == $order_id) {
|
|
|
+ if ($matitem->match_id == $match_id) {
|
|
|
$matitem->result = 0;
|
|
|
$matitem->matchresult = '';
|
|
|
$matitem->save();
|
|
|
@@ -205,78 +205,7 @@ class UnSettmatchLogic
|
|
|
//撤销串式订单(整个订单撤销)
|
|
|
public function UnSettelementOneStringOrder($request, $response, $datas)
|
|
|
{
|
|
|
- $order_id = isset($datas['order_id']) ? trim($datas['order_id']) : 0;
|
|
|
- $token = isset($datas['token']) ? trim($datas['token']) : '';
|
|
|
-
|
|
|
- if (empty($order_id) || empty($token)) {
|
|
|
- SECPARAEORROR:
|
|
|
- $msg = date("Y-m-d H:i:s") . " 取消赛事处理--参数错误(参数错或为空了)!";
|
|
|
- unset($datas['token']);
|
|
|
- $this->backandret($response, 0, $msg, $datas);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- $order_main = $this->getByOrderString($order_id);
|
|
|
- if (empty($order_main)) {
|
|
|
- $msg = date("Y-m-d H:i:s") . " 撤销整个串式要单失败,数据为空.order_id= $order_id ";
|
|
|
- $this->backandret($response, 0, '撤销失败!' . $msg, []);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if ($order_main->status == 2 || $order_main->status == 3) {
|
|
|
- $msg = date("Y-m-d H:i:s") . " 已撤销过的订单(不用处理)!--end:order_id=$order_id ";
|
|
|
- $this->backandret($response, 1, '撤销成功!' . $msg, []);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- foreach ($order_main->matchdatas as $matitem) {
|
|
|
- if ($matitem->order_id == $order_id) {
|
|
|
- $matitem->result = 2;
|
|
|
- $matitem->matchresult = '手动订单取消(平局)';
|
|
|
- $matitem->save();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $game_code = $order_main->matchdatas['0']->game_code;
|
|
|
- $match_id = $order_main->matchdatas['0']->match_id;
|
|
|
- $dataArr = [
|
|
|
- 'game_code' => $game_code,
|
|
|
- 'match_id' => $match_id,
|
|
|
- 'settype' => 2,
|
|
|
- 'bettype' => 2,
|
|
|
- 'change_status' => 0,
|
|
|
- 'order_ids' => $order_id,
|
|
|
- 'token' => $token,
|
|
|
- ];
|
|
|
- $url = 'http://127.0.0.1:9094/Settelement';
|
|
|
-
|
|
|
- $ret_str = post_curls($url, $dataArr);
|
|
|
- if (empty($ret_str)) {
|
|
|
- goto ERRORCURL;
|
|
|
- } else {
|
|
|
- $ret = json_decode($ret_str, true);
|
|
|
- if (empty($ret) || !isset($ret['status']) || $ret['status'] != 1) {
|
|
|
- goto ERRORCURL;
|
|
|
- } else {
|
|
|
- sleep(2);
|
|
|
- $order_main->status = 2;
|
|
|
- $order_main->settlement_time = date('Y-m-d H:i:s');
|
|
|
- $order_main->use_mark = '';
|
|
|
- $order_main->save();
|
|
|
-
|
|
|
- goto SUCCESSCUL;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- ERRORCURL:
|
|
|
- $msg = date("Y-m-d H:i:s") . " 串式订单取消处理--end:game_code= $game_code match_id= $match_id .$ret_str ";
|
|
|
- $this->backandret($response, 0, '撤销失败!' . $msg, []);
|
|
|
- return;
|
|
|
-
|
|
|
- SUCCESSCUL:
|
|
|
- $msg = date("Y-m-d H:i:s") . " 串式订单取消--end:game_code= $game_code match_id= $match_id order_id=$order_id ";
|
|
|
- $this->backandret($response, 1, '撤销成功!' . $msg, []);
|
|
|
- return;
|
|
|
+ return $this->doUnsetMatchOneOrder($request, $response, $datas);
|
|
|
}
|
|
|
|
|
|
|