|
|
@@ -134,10 +134,9 @@ class Betorder extends BaseController{
|
|
|
|
|
|
}
|
|
|
//球类联赛分类并且插入数据库
|
|
|
- $odds_ids = [];
|
|
|
foreach($res as $k => $v){
|
|
|
$gamedate = $this->Group_ball($res[$k]);
|
|
|
- $odds_ids[] = $this->Simplex_bet_insert($gamedate,$userInfo,$k,$batch_id);
|
|
|
+ $this->Simplex_bet_insert($gamedate,$userInfo,$k,$batch_id);
|
|
|
}
|
|
|
|
|
|
return $odds_ids;
|
|
|
@@ -227,8 +226,6 @@ class Betorder extends BaseController{
|
|
|
if(empty($data)||empty($userInfo)||empty($game_code)){
|
|
|
Render('', '7003',lang('Errors','Api')->get('error-7003'));
|
|
|
}
|
|
|
- //回调订单id
|
|
|
- $odds_ids = [];
|
|
|
foreach($data as $k => $v){
|
|
|
$OrderID = OrderID('S');//生成订单ID
|
|
|
$UUID = UUID(); //生成信息ID
|
|
|
@@ -320,11 +317,7 @@ class Betorder extends BaseController{
|
|
|
Render('', $insertMoney,lang('Errors','Api')->get('error'.$insertMoney));
|
|
|
}
|
|
|
$this->M->fanshui($userInfo['account_identity'],$userInfo['account'],$bet_money,$OrderID);//反水
|
|
|
- if($is_rolling == 1){
|
|
|
- $odds_ids[] = $OrderID;
|
|
|
- }
|
|
|
}
|
|
|
- return $odds_ids;
|
|
|
}
|
|
|
|
|
|
public function Bet(){
|
|
|
@@ -514,7 +507,7 @@ class Betorder extends BaseController{
|
|
|
_beginTransaction();//开启事务
|
|
|
$data = $this->Classify($data);
|
|
|
if(!empty($data['single'])){
|
|
|
- $odds_ids = $this->Simplex_bet($data['single'],$userInfo,$batch_id);//单式数据处理
|
|
|
+ $this->Simplex_bet($data['single'],$userInfo,$batch_id);//单式数据处理
|
|
|
}
|
|
|
if(!empty($data['bunch'])){
|
|
|
|
|
|
@@ -524,9 +517,6 @@ class Betorder extends BaseController{
|
|
|
}
|
|
|
_commit();//提交
|
|
|
Render('', '1',lang('Errors','Api')->get('error-1'));
|
|
|
-
|
|
|
- //延时处理滚球投注
|
|
|
- $this->Handle($odds_ids);
|
|
|
|
|
|
} catch (Exception $e) {
|
|
|
_rollBack();//回滚
|
|
|
@@ -534,32 +524,6 @@ class Betorder extends BaseController{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 追加滚球投注 延时处理审核
|
|
|
- */
|
|
|
- public function Handle($odds_ids = []){
|
|
|
- $size = ob_get_length();
|
|
|
- header("Content-Length: $size");
|
|
|
- header('Connection: close');
|
|
|
- header("HTTP/1.1 200 OK");
|
|
|
- header("Content-Type: application/json;charset=utf-8");
|
|
|
- ob_end_flush();
|
|
|
- if(ob_get_length())
|
|
|
- ob_flush();
|
|
|
- flush();
|
|
|
- if (function_exists("fastcgi_finish_request")) { // yii或yaf默认不会立即输出,加上此句即可(前提是用的fpm)
|
|
|
- fastcgi_finish_request(); // 响应完成, 立即返回到前端,关闭连接
|
|
|
- }
|
|
|
- ignore_user_abort(true);//在关闭连接后,继续运行php脚本
|
|
|
- set_time_limit(0); //no time limit,不设置超时时间(根据实际情况使用)
|
|
|
- //继续运行的代码
|
|
|
- sleep(20);//等待20秒后执行
|
|
|
-
|
|
|
- file_put_contents("test.txt", "This is something.");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* token获取用户详情
|
|
|
*/
|