|
|
@@ -11,6 +11,7 @@ use App\Http\Controllers\Controller;
|
|
|
use Illuminate\Http\Request as Req;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
Use App\Lib\Settlement\SettlementOrder;
|
|
|
+Use App\Lib\Settlement\SettlementWinFail;
|
|
|
use App\Models;
|
|
|
use Request;
|
|
|
|
|
|
@@ -188,7 +189,7 @@ class SoccerStringNoteListController extends Controller
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *串关注单结算
|
|
|
+ *串关注单首次结算
|
|
|
*/
|
|
|
public function settlement(Req $req)
|
|
|
{
|
|
|
@@ -198,19 +199,20 @@ class SoccerStringNoteListController extends Controller
|
|
|
}
|
|
|
$order = \App\Models\MoneyBuyStr::where('id', $id)->first();
|
|
|
$match = \App\Models\MoneyBuyMatch::where('batch_id',$order->batch_id)->where('bet_type','2')->get();
|
|
|
+ $bet_type = 2; //串关注单
|
|
|
+ $order_id = $order->order_id;
|
|
|
for($i=0;$i<count($match);$i++){
|
|
|
$match_id = $match[$i]->match_id;
|
|
|
$game_code = $match[$i]->game_code;
|
|
|
//判断输赢
|
|
|
//$match_ids[] = $match[$i]->match_id;
|
|
|
- $comendnotice = new \App\Models\Comendnotice();
|
|
|
- $res[] = $comendnotice->addcomendnotice($match_id);
|
|
|
+ $settlementWinFail = new SettlementWinFail();
|
|
|
+ $res = $settlementWinFail->ProcWinInfoByOneOrder($match_id, $order_id, $bet_type);
|
|
|
}
|
|
|
$order_ids = array($order->order_id);
|
|
|
//return $match_ids;
|
|
|
//结算
|
|
|
$SettlementOrder = new SettlementOrder();
|
|
|
- $bet_type = 2; //串关注单
|
|
|
$settype = 1; //首次结算
|
|
|
$data = $SettlementOrder->reSettlement($order_ids,$bet_type,$settype,$game_code,$match_id);
|
|
|
return $data;
|
|
|
@@ -226,18 +228,19 @@ class SoccerStringNoteListController extends Controller
|
|
|
}
|
|
|
$order = \App\Models\MoneyBuyStr::where('id',$id)->first();
|
|
|
$match = \App\Models\MoneyBuyMatch::where('batch_id',$order->batch_id)->where('bet_type','2')->get();
|
|
|
+ $bet_type = 2; //串关注单
|
|
|
+ $order_id = $order->order_id;
|
|
|
for($i=0;$i<count($match);$i++){
|
|
|
$match_id = $match[$i]->match_id;
|
|
|
$game_code = $match[$i]->game_code;
|
|
|
//判断输赢
|
|
|
- $comendnotice = new \App\Models\Comendnotice();
|
|
|
- $res = $comendnotice->addcomendnotice($match_id);
|
|
|
+ $settlementWinFail = new SettlementWinFail();
|
|
|
+ $res = $settlementWinFail->ProcWinInfoByOneOrder($match_id, $order_id, $bet_type);
|
|
|
}
|
|
|
$order_ids = array($order->order_id);
|
|
|
//return $order_ids;
|
|
|
//重新结算
|
|
|
$SettlementOrder = new SettlementOrder();
|
|
|
- $bet_type = 2; //串关注单
|
|
|
$settype = 2; //重新结算
|
|
|
$data = $SettlementOrder->reSettlement($order_ids,$bet_type,$settype,$game_code,$match_id);
|
|
|
return $data;
|