|
|
@@ -86,7 +86,7 @@ class SettlementOrder extends SettlementBase
|
|
|
-> where(['order_id' => $order_id])
|
|
|
-> first();
|
|
|
// 查询单式注单下的所有玩法
|
|
|
- $matchData = DB :: table('money_buy_match') -> select('odds', 'result', 'batch_id', 'bet_money') -> where(['bet_type' => 1, 'batch_id' => $simplexData -> batch_id]);
|
|
|
+ $matchData = DB :: table('money_buy_match') -> select('odds', 'result', 'batch_id', 'bet_money') -> where(['bet_type' => 1, 'batch_id' => $simplexData -> batch_id, 'match_id' => $simplexData->match_id]);
|
|
|
$matchData = $matchData -> where(function($query) {
|
|
|
$query = $query -> where(['result' => 1])
|
|
|
-> orWhere(['result' => 2])
|
|
|
@@ -198,7 +198,7 @@ class SettlementOrder extends SettlementBase
|
|
|
//单个串式订单的处理
|
|
|
public function ChuanOrder($order_id){
|
|
|
$batch_id = $this->BuyDatasMainModel->batch_id ;
|
|
|
- $matchModels = DB::table('money_buy_match')->where(['batch_id'=>$batch_id])->get();
|
|
|
+ $matchModels = DB::table('money_buy_match')->where(['batch_id'=>$batch_id,'bet_type' => 2])->get();
|
|
|
if (empty($matchModels)) { throw new \Exception('match 数据异常');}
|
|
|
|
|
|
$in_array = [] ;
|
|
|
@@ -233,31 +233,6 @@ class SettlementOrder extends SettlementBase
|
|
|
|
|
|
return true ;
|
|
|
|
|
|
- /*
|
|
|
- $ret = DB::update('update money_buy_str set settle_status=2 , game_status=1 , gain_money=? where order_id = ?', [$money,$order_id]);
|
|
|
- if(!($ret || $ret===0)){ throw new \Exception('更新数据出错3!'); }
|
|
|
-
|
|
|
- $account_identity = $this->BuyDatasMainModel->account_identity ;
|
|
|
- $ret1 = DB::update("update account_detailed set available_cash=available_cash+$money , cash=cash+$money where account_identity='$account_identity' ") ;
|
|
|
-
|
|
|
- $allbuyModel = $this->BuyDatasMainModel ;
|
|
|
- $dtime = date("Y-m-d H:i:s");
|
|
|
- $uuid = self::UUID();
|
|
|
- $userInfoArray = $this->getUserInfo($allbuyModel->account_name);
|
|
|
- $cashmoney = $userInfoArray['detail']->cash;
|
|
|
-
|
|
|
- $SQL = "insert into money_details(info_identity,trade_id,account_name,account_identity,money,money_time,money_type,trade_desc,status,money_cash,trade_type) values";
|
|
|
- $SQL .= "('$uuid','$allbuyModel->order_id','$allbuyModel->account_name','$allbuyModel->account_identity','$money','$dtime',1,'中奖收入','1','$cashmoney',4)" ;
|
|
|
-
|
|
|
- $ret2 = DB::insert($SQL);
|
|
|
-
|
|
|
- if ($ret1 && $ret2){
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- throw new \Exception('更新数据出错4!');
|
|
|
- */
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|