|
@@ -32,15 +32,14 @@ class SoccerStringNoteListController extends Controller
|
|
|
$dt->setLang('sportsnotelist');
|
|
$dt->setLang('sportsnotelist');
|
|
|
//$dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
|
|
//$dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
|
|
|
$dt->addColsFields('order_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 200));
|
|
$dt->addColsFields('order_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 200));
|
|
|
- $dt->addColsFields('game_name', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
|
|
|
|
+ $dt->addColsFields('str_type', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
$dt->addColsFields('detail_content', array('sort' => false, 'width' => 150));
|
|
$dt->addColsFields('detail_content', array('sort' => false, 'width' => 150));
|
|
|
$dt->addColsFields('money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
$dt->addColsFields('money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
- $dt->addColsFields('water_status', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
|
|
|
|
+ $dt->addColsFields('water_return', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
$dt->addColsFields('prize_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
$dt->addColsFields('prize_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
$dt->addColsFields('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
$dt->addColsFields('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
$dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
|
|
$dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
|
|
|
$dt->addColsFields('account', array('templet' => '#userdetail', 'sort' => false, 'width' => 240));
|
|
$dt->addColsFields('account', array('templet' => '#userdetail', 'sort' => false, 'width' => 240));
|
|
|
- //$dt->addColsFields('member_type', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
|
|
$dt->addColsFields('settle_status', array('sort' => false, 'width' => 100));
|
|
$dt->addColsFields('settle_status', array('sort' => false, 'width' => 100));
|
|
|
//$arr[] = 'view';
|
|
//$arr[] = 'view';
|
|
|
// if (checkRriv('/admin/SoccerStringNoteList/edit')) {
|
|
// if (checkRriv('/admin/SoccerStringNoteList/edit')) {
|
|
@@ -103,17 +102,19 @@ class SoccerStringNoteListController extends Controller
|
|
|
$dt->setDataSource('/admin/SoccerStringNoteList/detailinfo?id='.$id.'');
|
|
$dt->setDataSource('/admin/SoccerStringNoteList/detailinfo?id='.$id.'');
|
|
|
$dt->setLang('sportsnotelist');
|
|
$dt->setLang('sportsnotelist');
|
|
|
$dt->addColsFields('match_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
|
|
$dt->addColsFields('match_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
|
|
|
|
|
+ $dt->addColsFields('league', array('templet' => '#userdetail', 'sort' => false, 'width' => 150));
|
|
|
$dt->addColsFields('home_guest', array('templet' => '#userdetail', 'sort' => false, 'width' => 180));
|
|
$dt->addColsFields('home_guest', array('templet' => '#userdetail', 'sort' => false, 'width' => 180));
|
|
|
$dt->addColsFields('game_type', array('templet' => '#userdetail', 'sort' => false, 'width' => 90));
|
|
$dt->addColsFields('game_type', array('templet' => '#userdetail', 'sort' => false, 'width' => 90));
|
|
|
$dt->addColsFields('odds_code', array('templet' => '#userdetail', 'sort' => false, 'width' => 180));
|
|
$dt->addColsFields('odds_code', array('templet' => '#userdetail', 'sort' => false, 'width' => 180));
|
|
|
$dt->addColsFields('condition', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
$dt->addColsFields('condition', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
$dt->addColsFields('odds', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
$dt->addColsFields('odds', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
|
|
+ $dt->addColsFields('status', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
|
|
+ $dt->addColsFields('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
$dt->enableCheckBox();
|
|
$dt->enableCheckBox();
|
|
|
return view('sports/sports_notelistdetail', $dt->render($request));
|
|
return view('sports/sports_notelistdetail', $dt->render($request));
|
|
|
}
|
|
}
|
|
|
function detailinfo(Req $req) {
|
|
function detailinfo(Req $req) {
|
|
|
$id = $req->id;
|
|
$id = $req->id;
|
|
|
- //$match_id = Request::get('match_id') ? Request::get('match_id') : '';
|
|
|
|
|
|
|
|
|
|
$newapp = new \App\Models\MoneyBuyStr();
|
|
$newapp = new \App\Models\MoneyBuyStr();
|
|
|
$data = $newapp->getdetailinfo($id);
|
|
$data = $newapp->getdetailinfo($id);
|
|
@@ -130,23 +131,61 @@ class SoccerStringNoteListController extends Controller
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
$order = DB::table('money_buy_str')->where('id',$id)->first();
|
|
$order = DB::table('money_buy_str')->where('id',$id)->first();
|
|
|
- $money = $order->money;
|
|
|
|
|
- $codes = DB::table('st_bet_str')->where('id',$order->bet_str_id)->first();
|
|
|
|
|
- $bet_str_all = json_decode($codes->bet_str_all, true);
|
|
|
|
|
- for($i=0;$i<count($bet_str_all);$i++){
|
|
|
|
|
- $match_id = $bet_str_all[$i]['match_id'];
|
|
|
|
|
- $odds_code = $bet_str_all[$i]['odds_code'];
|
|
|
|
|
- $result = DB::table('st_zq_result')->where('match_id',$match_id)->get();
|
|
|
|
|
- $odds = $bet_str_all[$i]['odds'];
|
|
|
|
|
- $money = $money*$odds;
|
|
|
|
|
|
|
+ $m = explode('串',$order->str_type);
|
|
|
|
|
+ $matchs = DB::table('money_buy_match')->where('batch_id',$order->batch_id)->get()->toArray();
|
|
|
|
|
+ function combination($a, $m) {
|
|
|
|
|
+ $r = array();
|
|
|
|
|
+ $n = count($a);
|
|
|
|
|
+ if ($m <= 0 || $m > $n) {
|
|
|
|
|
+ return $r;
|
|
|
|
|
+ }
|
|
|
|
|
+ for ($i=0; $i<$n; $i++) {
|
|
|
|
|
+ $t = array($a[$i]);
|
|
|
|
|
+ if ($m == 1) {
|
|
|
|
|
+ $r[] = $t;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $b = array_slice($a, $i+1);
|
|
|
|
|
+ $c = combination($b, $m-1);
|
|
|
|
|
+ foreach ($c as $v) {
|
|
|
|
|
+ $r[] = array_merge($t, $v);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return $r;
|
|
|
}
|
|
}
|
|
|
- $money = $money-$order->money;
|
|
|
|
|
- return $money;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ $arr = combination($matchs,$m[0]);
|
|
|
|
|
+ $win_money = 0;
|
|
|
|
|
+ for($i=0;$i<count($arr);$i++){
|
|
|
|
|
+ $money = $order->money/count($arr);
|
|
|
|
|
+ for($j=0;$j<count($arr[$i]);$j++){
|
|
|
|
|
+ if($arr[$i][$j]->result == -1){ //输
|
|
|
|
|
+ $win_money = 0;
|
|
|
|
|
+ $model = new \App\Models\MoneyBuyStr();
|
|
|
|
|
+ $model = $model::find($id);
|
|
|
|
|
+ $model->gain_money = $win_money;
|
|
|
|
|
+ $model->save();
|
|
|
|
|
+ return "<script>history.go(-1);</script>";
|
|
|
|
|
+ }else if($arr[$i][$j]->result == 1){ //赢
|
|
|
|
|
+ $odds = $arr[$i][$j]->odds;
|
|
|
|
|
+ $money = $money*$odds;
|
|
|
|
|
+ }else if($arr[$i][$j]->result == 2){ //平
|
|
|
|
|
+ $money = $money*1;
|
|
|
|
|
+ }else if($arr[$i][$j]->result == 3){ //赢半平半
|
|
|
|
|
+ $odds = $arr[$i][$j]->odds;
|
|
|
|
|
+ $money = $money/2*$odds+$money/2*1;
|
|
|
|
|
+ }else if($arr[$i][$j]->result == 4){ //输半平半
|
|
|
|
|
+ $money = $money/2*1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $win_money = $win_money+$money-$order->money/count($arr);
|
|
|
|
|
+ }
|
|
|
|
|
+ $model = new \App\Models\MoneyBuyStr();
|
|
|
|
|
+ $model = $model::find($id);
|
|
|
|
|
+ $model->gain_money = $win_money;
|
|
|
|
|
+ $model->save();
|
|
|
|
|
+ return "<script>history.go(-1);</script>";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
*删除串关注单
|
|
*删除串关注单
|
|
|
*/
|
|
*/
|
|
@@ -166,7 +205,6 @@ class SoccerStringNoteListController extends Controller
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$rows = \App\Models\MoneyBuyStr::whereIn('id', $ids)->delete();
|
|
$rows = \App\Models\MoneyBuyStr::whereIn('id', $ids)->delete();
|
|
|
if (!$rows) {
|
|
if (!$rows) {
|
|
|
return responseToJson(-2003); //id����
|
|
return responseToJson(-2003); //id����
|
|
@@ -181,7 +219,7 @@ class SoccerStringNoteListController extends Controller
|
|
|
function moneycount()
|
|
function moneycount()
|
|
|
{
|
|
{
|
|
|
$where = Request::has('where') ? Request::get('where') : '';
|
|
$where = Request::has('where') ? Request::get('where') : '';
|
|
|
- $db = new \App\Models\MoneyBuyStr;
|
|
|
|
|
|
|
+ $db = new \App\Models\MoneyBuyStr();
|
|
|
|
|
|
|
|
$data = $db->MoneyCount($where);
|
|
$data = $db->MoneyCount($where);
|
|
|
return responseToJson($data);
|
|
return responseToJson($data);
|