|
@@ -38,7 +38,7 @@ class SportsNoteList extends BaseModel
|
|
|
$orderData = $this
|
|
$orderData = $this
|
|
|
->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
|
->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
|
- //->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
|
|
|
|
|
|
|
+ ->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
|
|
|
->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
|
->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status','money_buy_simplex.use_mark', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'money_buy_simplex.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese as league', 'st_' . $type . '_league.last_time')
|
|
->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status','money_buy_simplex.use_mark', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'money_buy_simplex.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese as league', 'st_' . $type . '_league.last_time')
|
|
|
->whereIn('money_buy_simplex.roll_ratify',array(0,1,-1))
|
|
->whereIn('money_buy_simplex.roll_ratify',array(0,1,-1))
|
|
@@ -348,7 +348,7 @@ class SportsNoteList extends BaseModel
|
|
|
$data = $this
|
|
$data = $this
|
|
|
->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
|
->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
|
- //->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
|
|
|
|
|
|
|
+ ->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
|
|
|
->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
|
->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status','money_buy_simplex.use_mark', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
|
|
->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status','money_buy_simplex.use_mark', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
|
|
|
->whereIn('money_buy_simplex.roll_ratify',array(0,1,-1))
|
|
->whereIn('money_buy_simplex.roll_ratify',array(0,1,-1))
|
|
@@ -1007,7 +1007,7 @@ class SportsNoteList extends BaseModel
|
|
|
$data = $this
|
|
$data = $this
|
|
|
->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
|
->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
|
- //->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
|
|
|
|
|
|
|
+ ->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
|
|
|
->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
|
->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'money_buy_simplex.roll_ratify', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
|
|
->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'money_buy_simplex.roll_ratify', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
|
|
|
->whereIn('money_buy_simplex.roll_ratify',array(-1,2))
|
|
->whereIn('money_buy_simplex.roll_ratify',array(-1,2))
|
|
@@ -1307,6 +1307,15 @@ class SportsNoteList extends BaseModel
|
|
|
if( !$v )
|
|
if( !$v )
|
|
|
unset( $orders[$k] );
|
|
unset( $orders[$k] );
|
|
|
}
|
|
}
|
|
|
|
|
+ //数组去重
|
|
|
|
|
+ foreach( $orders as $k=>$v){
|
|
|
|
|
+ $order = $orders;
|
|
|
|
|
+ unset( $order[$k] );
|
|
|
|
|
+ foreach( $order as $kk=>$vv){
|
|
|
|
|
+ if( $v['order_id'] == $vv['order_id'])
|
|
|
|
|
+ unset( $orders[$k] );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$order_ids = array();
|
|
$order_ids = array();
|
|
|
if(!empty($orders)){
|
|
if(!empty($orders)){
|
|
@@ -1391,7 +1400,7 @@ class SportsNoteList extends BaseModel
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 作废赛事下注单处理
|
|
|
|
|
|
|
+ * 改变注单状态下注单处理
|
|
|
* $matchid int 赛事id
|
|
* $matchid int 赛事id
|
|
|
* $orders_sim obj 待处理单式注单数据 非必须
|
|
* $orders_sim obj 待处理单式注单数据 非必须
|
|
|
* $orders_str obj 待处理串式注单数据 非必须
|
|
* $orders_str obj 待处理串式注单数据 非必须
|
|
@@ -1410,10 +1419,12 @@ class SportsNoteList extends BaseModel
|
|
|
$order = $orders_str;
|
|
$order = $orders_str;
|
|
|
}
|
|
}
|
|
|
$orders = array_merge($orders,$order);
|
|
$orders = array_merge($orders,$order);
|
|
|
- //去除数组的空值
|
|
|
|
|
|
|
+ //去除数组的空值 去除串式已结算的注单
|
|
|
foreach( $orders as $k=>$v){
|
|
foreach( $orders as $k=>$v){
|
|
|
if( !$v )
|
|
if( !$v )
|
|
|
unset( $orders[$k] );
|
|
unset( $orders[$k] );
|
|
|
|
|
+ if( $v['str_type'] && $v['settle_status'] ==2 )
|
|
|
|
|
+ unset( $orders[$k] );
|
|
|
}
|
|
}
|
|
|
//数组去重
|
|
//数组去重
|
|
|
foreach( $orders as $k=>$v){
|
|
foreach( $orders as $k=>$v){
|
|
@@ -1484,7 +1495,7 @@ class SportsNoteList extends BaseModel
|
|
|
$models->account_identity = $v['account_identity'];
|
|
$models->account_identity = $v['account_identity'];
|
|
|
$str = 0;
|
|
$str = 0;
|
|
|
$change_money = 0;
|
|
$change_money = 0;
|
|
|
- if($v['status'] == 1 && $v['settle_status'] == 2 && $v['result'] != -1 && $v['result'] != 0){
|
|
|
|
|
|
|
+ if($v['status'] == 1 && $v['settle_status'] == 2 && $v['gain_money'] != 0){
|
|
|
$str = 1;
|
|
$str = 1;
|
|
|
$change_money = 0 - $v['gain_money'];
|
|
$change_money = 0 - $v['gain_money'];
|
|
|
$models->trade_type = '26';
|
|
$models->trade_type = '26';
|
|
@@ -1509,8 +1520,9 @@ class SportsNoteList extends BaseModel
|
|
|
if($str == 1){
|
|
if($str == 1){
|
|
|
try {
|
|
try {
|
|
|
DB::beginTransaction();//开启事务
|
|
DB::beginTransaction();//开启事务
|
|
|
- $this->where('order_id', $v['order_id'])->update(['status' => '1','settle_status' => '1','game_status' => '0','game_status' => '0']);//'use_mark'=>'通过设置赛事比分作废'
|
|
|
|
|
- \App\Models\MoneyBuyStr::where('order_id', $v['order_id'])->update(['status' => '1','settle_status' => '1','game_status' => '0','game_status' => '0']);
|
|
|
|
|
|
|
+ $this->where('order_id', $v['order_id'])->update(['status' => '1','settle_status' => '1','game_status' => '0','gain_money' => '0']);//'use_mark'=>'通过设置赛事比分作废'
|
|
|
|
|
+ \App\Models\MoneyBuyStr::where('order_id', $v['order_id'])->update(['status' => '1','settle_status' => '1','game_status' => '0','gain_money' => '0']);
|
|
|
|
|
+ \App\Models\SettlementMiddleDetail::where('order_id', $v['order_id'])->update(['money' => '0']);
|
|
|
\App\Models\MoneyBuyMatch::where('order_id', $v['order_id'])->where('match_id', $matchid)->update(['result' => 0, 'status' => 0]);
|
|
\App\Models\MoneyBuyMatch::where('order_id', $v['order_id'])->where('match_id', $matchid)->update(['result' => 0, 'status' => 0]);
|
|
|
\App\Models\Account_detailed::where('account_identity', $v['account_identity'])->update(['available_cash' => $v['available_cash'], 'cash' => $v['available_cash']]);
|
|
\App\Models\Account_detailed::where('account_identity', $v['account_identity'])->update(['available_cash' => $v['available_cash'], 'cash' => $v['available_cash']]);
|
|
|
$models->save();
|
|
$models->save();
|
|
@@ -1526,12 +1538,6 @@ class SportsNoteList extends BaseModel
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-// //该赛事相关的的串关注单做未处理
|
|
|
|
|
-// if(empty($orders_str)){
|
|
|
|
|
-// $order_ids_str = array_column($orders_str,'order_id');
|
|
|
|
|
-// \App\Models\MoneyBuyMatch::where('match_id',$matchid)->where('game_code',$type)->whereIn('order_id',$order_ids_str)->where('bet_type',2)->update(['result'=>0]);
|
|
|
|
|
-// }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|