Kaynağa Gözat

追加推送

彭俊 6 yıl önce
ebeveyn
işleme
21b1832ce8
31 değiştirilmiş dosya ile 1157 ekleme ve 166 silme
  1. 8 2
      app/Http/Controllers/Admin/BaseSetController.php
  2. 11 14
      app/Http/Controllers/Admin/SoccerNoteListController.php
  3. 58 20
      app/Http/Controllers/Admin/SoccerStringNoteListController.php
  4. 15 3
      app/Http/Controllers/Admin/UserController.php
  5. 1 1
      app/Http/Controllers/Admin/WagentController.php
  6. 18 0
      app/Http/Controllers/Api/SettlementController.php
  7. 14 0
      app/Lib/Settlement/Adapter/BqRule.php
  8. 14 0
      app/Lib/Settlement/Adapter/LqRule.php
  9. 15 0
      app/Lib/Settlement/Adapter/WqRule.php
  10. 158 0
      app/Lib/Settlement/Adapter/ZqRule.php
  11. 295 0
      app/Lib/Settlement/SettlementBase.php
  12. 297 0
      app/Lib/Settlement/SettlementSql.php
  13. 1 1
      app/Models/Account.php
  14. 58 27
      app/Models/MoneyBuyStr.php
  15. 7 0
      app/Models/Setinfo.php
  16. 20 33
      app/Models/SportsNoteList.php
  17. 0 0
      public/frame/layui/css/layui.css
  18. 4 1
      resources/lang/zh-cn/sportsnotelist.php
  19. 6 0
      resources/lang/zh-cn/status.php
  20. 2 0
      resources/lang/zh-cn/user.php
  21. 37 19
      resources/views/admin/baseSet/index.blade.php
  22. 4 0
      resources/views/admin/sportsfoot/outcome.blade.php
  23. 43 5
      resources/views/admin/user/index.blade.php
  24. 13 2
      resources/views/sports/base_match.blade.php
  25. 13 2
      resources/views/sports/basket_match.blade.php
  26. 13 2
      resources/views/sports/soccer_match.blade.php
  27. 0 3
      resources/views/sports/sports_notelist.blade.php
  28. 14 17
      resources/views/sports/sports_notelistdetail.blade.php
  29. 0 12
      resources/views/sports/sports_stringnotelist.blade.php
  30. 13 2
      resources/views/sports/tennis_match.blade.php
  31. 5 0
      routes/web.php

+ 8 - 2
app/Http/Controllers/Admin/BaseSetController.php

@@ -43,6 +43,7 @@ class BaseSetController extends SystemController {
         $open = $db->getInfo(1000);//开奖token
         $info = $db->getInfo(1024); //分享注册页面信息设置
         $startup = $db->getInfo(1111); //启动页设置设置
+        $fsnum = $db->getInfo(1001); //启动页设置设置
         $wsport = $db->getInfo(9501);//websocket聊天服务器ip 端口设置
         $jnd = $db->getInfo(40);//加拿大28维护
         $playtest = $db->getInfo(2000);//试玩账号设置
@@ -67,14 +68,14 @@ class BaseSetController extends SystemController {
         if (is_array($new_box) && count($new_box) > 0) {
             $new_box = $this->netData($new_box);
         }
-
+// var_dump($fsnum);die;//infotype
         $db_reg = new \App\Models\Settings();
         $reg = $db_reg->getSet();
         return view('admin.baseSet/index', ['notice' => $notice, 'bank' => $bank, 'tan_box' => $tan_box, 'new_box' => $new_box, 'qq' => $ser_qq, 'connectioninfo' => $connectioninfo,
             'agent' => $agent, 'plat' => $plat, 'game' => $game, 'run' => $run, 'two' => $two,
             'url' => $url, 'reg' => $reg, 'add_token' => $add_token, 'agent_box' => $agent_box,
             'quickUl' => $quickUrl, 'ip' => $ipLimit, 'net' => $net, 'agentUrl' => $agentUrl,
-            'extension' => $extension, 'open' => $open, 'nagentFxUrl' => $nagentFxUrl, 'regInfo' => $info,
+            'extension' => $extension,'fsnum'=>$fsnum, 'open' => $open, 'nagentFxUrl' => $nagentFxUrl, 'regInfo' => $info,
             'startup' => $startup, 'wsport' => $wsport, 'jnd' => $jnd, 'playtest' => $playtest,
             'oggame' => $oggame, 'liao' => $liao, 'word' => $word, 'imglink' => $imglink, 'H5ShareLink' => $H5ShareLink,
             'tokentime' => $tokentime, 'updateOdds' => $updateOdds, 'updateTime' => $updateTime,'paymentCate'=>$paymentCate]);
@@ -495,6 +496,11 @@ class BaseSetController extends SystemController {
         return responseToJson($data);
     }
 
+    function Fsnum() {
+        $db = new \App\Models\Setinfo();
+        $data = $db->getFsnumSet();
+        return responseToJson($data);
+    }
 
     /**
      * 平台维护

+ 11 - 14
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -36,14 +36,13 @@ class SoccerNoteListController extends Controller
         $dt->addColsFields('match_id_order', array('templet' => '#userdetail', 'sort' => true, 'width' => 200));
         $dt->addColsFields('league', array('templet' => '#userdetail', 'sort' => false, 'width' => 150));
         $dt->addColsFields('home_guest', array('templet' => '#userdetail', 'sort' => false, 'width' => 150));
-        $dt->addColsFields('content', array('templet' => '#userdetail', 'sort' => false, 'width' => 150));
+        $dt->addColsFields('content', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $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('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
         $dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $dt->addColsFields('account', array('templet' => '#userdetail', 'sort' => false, 'width' => 120));
-        //$dt->addColsFields('member_type', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
         $dt->addColsFields('game_status', array('templet' => '#userdetail', 'sort' => false, 'width' => 70));
         //$arr[] = 'view';
 //        if (checkRriv('/admin/SoccerNoteList/edit')) {
@@ -68,33 +67,31 @@ class SoccerNoteListController extends Controller
         $where = array();
         if (!empty($account)) {
             if (empty($sureblur) || $sureblur == 'off') {
-                $where[] = array('money_buy.account_name', 'like', '%' . $account . '%');
+                $where[] = array('money_buy_simplex.account_name', 'like', '%' . $account . '%');
             } else {
-                $where[] = array('money_buy.account_name', '=', $account);
+                $where[] = array('money_buy_simplex.account_name', '=', $account);
             }
         }
         if (!empty($star_time)) {
             if (!empty($end_time)){
-                $where[] = array('money_buy.money_time', '>', $star_time);
-                $where[] = array('money_buy.money_time', '<', $end_time);
+                $where[] = array('money_buy_simplex.money_time', '>', $star_time);
+                $where[] = array('money_buy_simplex.money_time', '<', $end_time);
             }else{
-                $where[] = array('money_buy.money_time', '>', $star_time);
+                $where[] = array('money_buy_simplex.money_time', '>', $star_time);
             }
         }else if(empty($star_time)){
             if (!empty($end_time)){
 
-                $where[] = array('money_buy.money_time', '<', $end_time);
+                $where[] = array('money_buy_simplex.money_time', '<', $end_time);
             }
         }
         if (!empty($order_id)){
-            $where[] = array('money_buy.order_id', $order_id);
+            $where[] = array('money_buy_simplex.order_id', $order_id);
         }
         if (!empty($match_id)){
-            $where[] = array('money_buy.match_id', $match_id);
-        }
-        if (!empty($type)){
-            $where[] = array('money_buy.game_name', $type);
+            $where[] = array('money_buy_simplex.match_id', $match_id);
         }
+        $where[] = array('money_buy_simplex.game_code', $type);
         $newapp = new \App\Models\SportsNoteList();
         $data = $newapp->getinfo($list, $page, $where,$type);
 

+ 58 - 20
app/Http/Controllers/Admin/SoccerStringNoteListController.php

@@ -32,15 +32,14 @@ class SoccerStringNoteListController extends Controller
         $dt->setLang('sportsnotelist');
         //$dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
         $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('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('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
         $dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $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));
         //$arr[] = 'view';
 //        if (checkRriv('/admin/SoccerStringNoteList/edit')) {
@@ -103,17 +102,19 @@ class SoccerStringNoteListController extends Controller
         $dt->setDataSource('/admin/SoccerStringNoteList/detailinfo?id='.$id.'');
         $dt->setLang('sportsnotelist');
         $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('game_type', array('templet' => '#userdetail', 'sort' => false, 'width' => 90));
         $dt->addColsFields('odds_code', array('templet' => '#userdetail', 'sort' => false, 'width' => 180));
         $dt->addColsFields('condition', 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();
         return view('sports/sports_notelistdetail', $dt->render($request));
     }
     function detailinfo(Req $req) {
         $id = $req->id;
-        //$match_id = Request::get('match_id') ? Request::get('match_id') : '';
 
         $newapp = new \App\Models\MoneyBuyStr();
         $data = $newapp->getdetailinfo($id);
@@ -130,23 +131,61 @@ class SoccerStringNoteListController extends Controller
             return -1;
         }
         $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();
         if (!$rows) {
             return responseToJson(-2003); //id����
@@ -181,7 +219,7 @@ class SoccerStringNoteListController extends Controller
     function moneycount()
     {
         $where = Request::has('where') ? Request::get('where') : '';
-        $db = new \App\Models\MoneyBuyStr;
+        $db = new \App\Models\MoneyBuyStr();
 
         $data = $db->MoneyCount($where);
         return responseToJson($data);

+ 15 - 3
app/Http/Controllers/Admin/UserController.php

@@ -33,6 +33,7 @@ class UserController extends Controller
         $request['last_startime'] = isset($req->last_startime) ? trim($req->last_startime) : null;
         $request['last_endtime'] = isset($req->last_endtime) ? trim($req->last_endtime) : null;
         $request['regist_startime'] = isset($req->regist_startime) ? trim($req->regist_startime) : null;
+        $request['fanshui'] = isset($req->fanshui) ? trim($req->fanshui) : '';
         $request['regist_endtime'] = isset($req->regist_endtime) ? trim($req->regist_endtime) : null;
         $request['status'] = isset($req->status) ? trim($req->status) : null;
         $request['group'] = isset($req->group) ? intval($req->group) : null;
@@ -61,12 +62,19 @@ class UserController extends Controller
         // $dt->addColsFields('last_time',array('width'=>90)); //'templet' => '#selectphone',
         //$dt->addColsFields('money_num', array('templet' => '#moneynum', 'sort' => false, 'width' => 110));
         $dt->addColsFields('statuss', array('templet' => '#openstatus', 'sort' => false,'width'=>100));
-        $dt->addColsFields('agent_name', array('sort' => false, 'templet' => '#agent','width'=>100,));
+        $dt->addColsFields('isfs', array('sort' => false, 'templet' => '#agent','width'=>100,));
         $dt->addColsFields('action_user', array('templet' => '#waterTool', 'sort' => false,'width'=>160));
         $dt->setPriKey('id');
         return view('admin.user/index', $dt->render($request));
     }
 
+    //改变反水状态
+    function ajaxfsup(){
+        $data = array();
+        $data['fanshui'] = $_POST['type'];
+        return \App\Models\Account::where('id',$_POST['id'])->update($data);
+    }
+
     /**
      * 会员存取反水列表
      * [detail description]
@@ -128,6 +136,7 @@ class UserController extends Controller
         $order = Request::has('order') ? Request::get('order') : 'desc';
         $status = Request::has('status') ? Request::get('status') : '';
         $agent_name = Request::has('agent_name') ? Request::get('agent_name') : '';
+        $fanshui = Request::has('fanshui') ? Request::get('fanshui') : '';
 
         $account = Request::has('account') ? Request::get('account') : '';
         $select_type = Request::has('select_type') ? trim(Request::get('select_type')) : '';
@@ -202,7 +211,6 @@ class UserController extends Controller
         if (!empty($invite)) {
             $where .= " AND open_invitation='" . $invite . "'";
         }
-
         if(!empty($group)){
             $where .= " AND group_code like '%,".$group. ",%'";
         }
@@ -236,6 +244,10 @@ class UserController extends Controller
             $where .= " AND status=" . $status;
             $where .= " or status=" . '2';
         }
+
+        if(!empty($fanshui)){
+            $where .= " AND fanshui=" . $fanshui;
+        }
         if (!empty($cash_small)) {
             $where .= " AND cash>=" . $cash_small;
         }
@@ -275,7 +287,7 @@ class UserController extends Controller
         } else {
             $where .= ')';
         }
-
+// var_dump($where);die;
         $db = new \App\Models\Account;
         $data = $db->account($list, $page, $where, $field, $order, $rflag, $tflag);
         $gradelist = $db->getUserGrade();

+ 1 - 1
app/Http/Controllers/Admin/WagentController.php

@@ -97,7 +97,7 @@ class WagentController extends Controller {
         $dt->addColsFields('ordernumber', array('templet' => '#newtime', 'sort' => false, 'width' => 300));
         $dt->addColsFields('tradeamount', array('templet' => '#newtime', 'sort' => false, 'width' => 80));
         $dt->addColsFields('blance', array('templet' => '#newtime', 'sort' => false, 'width' => 80));
-        $dt->addColsFields('addtime', array('templet' => '#newtime', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('addtime', array('templet' => '#newtime', 'sort' => false, 'width' => 160));
         $dt->addColsFields('agent_name', array('templet' => '#newtime', 'sort' => false, 'width' => 80));
         $dt->enableCheckBox();
 		return view('admin.wagent/xxrecord', $dt->render($request));

+ 18 - 0
app/Http/Controllers/Api/SettlementController.php

@@ -0,0 +1,18 @@
+<?php
+namespace App\Http\Controllers\Api;
+use App\Http\Controllers\Controller;
+use App\Lib\Settlement\SettlementSql;
+use App\Lib\Settlement\Adapter\ZqRule;
+
+
+
+class SettlementController extends Controller{
+    public function index(){
+        $dd = new ZqRule();
+
+        dd($dd->bodanRule(1,2,1));
+    }
+    public function dd(){
+        dd(1111);
+    }
+}

+ 14 - 0
app/Lib/Settlement/Adapter/BqRule.php

@@ -0,0 +1,14 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/4/25
+ * Time: 14:10
+ */
+
+namespace App\Lib\Settlement\Adapter;
+
+class BqRule
+{
+
+}

+ 14 - 0
app/Lib/Settlement/Adapter/LqRule.php

@@ -0,0 +1,14 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/4/25
+ * Time: 14:09
+ */
+
+namespace App\Lib\Settlement\Adapter;
+
+class LqRule
+{
+
+}

+ 15 - 0
app/Lib/Settlement/Adapter/WqRule.php

@@ -0,0 +1,15 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/4/25
+ * Time: 14:10
+ */
+
+namespace App\Lib\Settlement\Adapter;
+
+
+class WqRule
+{
+
+}

+ 158 - 0
app/Lib/Settlement/Adapter/ZqRule.php

@@ -0,0 +1,158 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/4/25
+ * Time: 14:10
+ */
+
+namespace App\Lib\Settlement\Adapter;
+use Illuminate\Support\Facades\DB;
+
+
+class ZqRule
+
+{
+
+    ////////////////////////根据规则判断输赢
+    //让球大小
+     public  function    concede_size($model,$resultModel,$resultRecords){
+
+
+     }
+
+     //全场|主队|让球
+    public  function   concede_home($model,$resultModel,$resultRecords){
+            $zhiball = intval($resultModel->home_score) ;
+            $keballs = intval($resultModel->guest_score) ;
+            $cond = intval($model->condition) ;
+            $cha = $zhiball - $keballs - $cond ;
+
+            if ($cha  >0 ){ return 1; }
+            if($cha ==0 ) { return 2 ;}
+            return -1 ;
+     }
+
+     //主队全场让球条件
+    public  function  concede_home_rule($model,$resultModel,$resultRecords){
+
+    }
+
+
+    //  first_last_ball最先/最后进球 开始-----------------------
+    //主队|最先进球
+    public  function  first_ball_home($model,$resultModel,$resultRecords){
+        if ($resultModel->all_goal >0){
+            if  ($resultModel->first_score === $resultModel->home_team){
+                return 1;
+            }else{
+                return -1 ;
+            }
+		}
+        return 2 ;
+    }
+    //客队|最先进球
+    public  function  first_ball_guest($model,$resultModel,$resultRecords){
+        if ($resultModel->all_goal >0){
+            if  ($resultModel->first_score === $resultModel->guest_team){
+                return 1;
+            }else{
+                return -1 ;
+            }
+		}
+        return 2 ;
+    }
+    //主队|最后进球
+    public  function  last_ball_home($model,$resultModel,$resultRecords){
+        if ($resultModel->all_goal >0){
+            if  ($resultModel->last_score === $resultModel->home_team){
+                return 1;
+            }else{
+                return -1 ;
+            }
+		}
+        return 2 ;
+
+    }
+    //客队|最后进球
+    public  function  last_ball_guest($model,$resultModel,$resultRecords){
+        if ($resultModel->all_goal >0){
+            if  ($resultModel->last_score === $resultModel->guest_team){
+                return 1;
+            }else{
+                return -1 ;
+            }
+		}
+        return 2 ;
+    }
+    //没有进球
+    public  function  not_ball($model,$resultModel,$resultRecords){
+        if ($resultModel->all_goal <=0){
+            return 1 ;
+        }else{
+            return -1 ;
+        }
+
+    }
+    //////////  first_last_ball最先/最后进球 结束-----------------------
+
+    /**
+     * 足球波胆 规则
+     * @param $bet_match  投注赛事数据
+     * @param $result_match  最终结果
+     * @param $result_match_r  结果记录
+     */
+    public function bodanRule($bet_match,$result_match,$result_match_r){
+//        $bet_match = DB::table('money_buy_match')->where('match_id', 3144414)->first();
+//        $result_match = DB::table('st_zq_result')->where('match_id', 3144414)->first();
+//        $result_match_r = DB::table('st_zq_result_record')->where('match_id', 3144414)->get()->toArray();
+
+        //获取父/子级赔率代码
+        $p_code = $bet_match->p_code;
+        $odds_code = $bet_match->odds_code;
+
+        //获取主客队投注比分
+        $bet_score = explode('-', $bet_match->condition);
+        $bet_home_score = (int)$bet_score[0];
+        $bet_guest_score = (int)$bet_score[1];
+        if($p_code == 'bodan'){
+            if(strstr($odds_code,"half")){//上半场
+                $half_data = [];
+                foreach ($result_match_r as $k=>$v){
+                    //取出上半场数据
+                    if($v->match_process == '上半场'){
+                        $half_data[] = $v;
+                    }
+                }
+                //根据id倒序排列
+                $half_data_sorc = array_column($half_data,'id');
+                array_multisort($half_data_sorc,SORT_DESC,$half_data);
+
+                //获取id最大的一条数据
+                foreach ($half_data as $k=>$v){
+                    if($v->id == $half_data_sorc[0]){
+                        $last_half_data = $v;
+                    }
+                }
+                //获取主客队上半场得分
+                $home_score = $last_half_data->home_score;
+                $guest_score = $last_half_data->guest_score;
+            }else{//全场
+                //获取主客队全场得分
+                $home_score = $result_match->home_score;
+                $guest_score = $result_match->guest_score;
+            }
+
+            //判断结果
+            if($bet_home_score == $home_score and $bet_guest_score == $guest_score)
+            {
+                $result = 1;//赢
+            }else{
+                $result = -1;//输
+            }
+        }
+        return $result;
+    }
+
+
+}

+ 295 - 0
app/Lib/Settlement/SettlementBase.php

@@ -0,0 +1,295 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/4/25
+ * Time: 14:10
+ */
+
+namespace App\Lib\Settlement;
+set_time_limit(600);
+ini_set('memory_limit', '256M');
+
+
+class SettlementBase
+{
+     const  USER_WIN  = 1 ;   //用户赢钱
+     const  USER_LOSE = -1;   //用户输钱
+     const  USER_FLAT = 2 ;   //持平,用户钱原路返回
+
+     public $match_id  = 0 ;     //比赛场次ID
+     public $matchModel = null ;  //比赛场次Model对像
+
+     public $lg_id = 0  ;    //联赛ID
+     public $lgModel = null ;  //联赛Model对像
+
+     public $resultId = 0 ; //比赛最终结果ID
+     public $resultModel = null ; //比赛最终结果对像MODEL
+     public $resultRecords = [] ; //比赛中间结果对像数组;
+
+     public $buyArrays = [] ;   //订单记录表
+
+     public $gameType = '' ;  //类型
+    //类型映射
+     public $gameAllMap = [
+         'zq'=>'ZqRule',
+         'lq'=>'LqRule',
+         'wq'=>'WqRule',
+         'bq'=>'BqRule',
+     ];
+    private  $AdapterObj = null ;
+
+
+    public  function __construct()
+    {
+        C()->set('BqRule','App\Lib\Settlement\Adapter\BqRule');
+        C()->set('LqRule','App\Lib\Settlement\Adapter\LqRule');
+        C()->set('WqRule','App\Lib\Settlement\Adapter\WqRule');
+        C()->set('ZqRule','App\Lib\Settlement\Adapter\ZqRule');
+
+        return true;
+    }
+
+    //返回数据
+    private function  makeData($status=1,$message='success',$data=''){
+        return [
+            'status' => $status ,
+            'message' =>$message,
+            'data' => $data ,
+        ] ;
+    }
+
+    //开始结算处理
+    public function  doSettlement(){
+            $model = $this->getNoticeData();
+            if ($model) {    return $this->makeData(1,'no data to process') ;  }
+
+            try{
+                _beginTransaction();
+                $ret1 = $this->doInit($model->type,$model->competionid);
+                if (!$ret1){   _rollBack(); return $this->makeData(0,'false_1') ;  }
+
+                $ret2 = $this->writeStatusBegin($model);
+                if (!$ret2){   _rollBack(); return $this->makeData(0,'false_2') ;  }
+
+                $ret3 = $this->getOrdersByMatchid($this->gameType,$this->match_id);
+                if (!$ret3){
+                    //没有下单数据,本场赛事结算处理完毕
+                    $this->writeStatusEndOk($model);
+                    _commit();
+                    return  $this->makeData();
+                }
+
+                $ret4 = $this->BatchModesResult($ret3);
+                if (!$ret4){
+                    _rollBack(); return $this->makeData(0,'false_4') ;
+                }
+
+
+
+
+
+
+
+                _commit();
+                return  $this->makeData();
+
+            }catch(\Exception $e){
+                _rollBack();
+                return $this->makeData(0,'false',['msg'=>$e->getMessage(),'code'=>$e->getCode()]) ;
+            }
+
+    }
+
+
+    //写处理状态
+    public function  writeStatusBegin($comendnticeModel){
+        $comendnticeModel->status = 1 ;
+        $comendnticeModel->pupdatetime = date("Y-m-d H:i:s");
+        $comendnticeModel->pcount ++ ;
+        $comendnticeModel->logs = 'begin|';
+        $ret = $comendnticeModel->save();
+        return  $ret;
+    }
+
+    //写处理状态结束
+    public function  writeStatusEndOk($comendnticeModel){
+        $comendnticeModel->status = 4 ;
+        $comendnticeModel->pret = 1 ;
+        $comendnticeModel->puodateendtime = date("Y-m-d H:i:s");
+        $comendnticeModel->logs = $comendnticeModel->logs.'end ok';
+        $ret = $comendnticeModel->save();
+        return  $ret;
+    }
+
+
+    //查询是否有未处理的数据
+    public function  getNoticeData($where = ['status'=>0]){
+        $model = lm('Comendnotice','Commons')->where($where)->first();
+        if (!$model){
+            return false;
+        }
+        return $model ;
+    }
+
+    //实现结算功能
+    public function   doInit($type,$match_id){
+            if ( isset($this->gameAllMap)){  throw  new \Exception('赛事类型错误',4002);   return false;  }
+
+            switch ($type){
+                case 'bq':
+                    $this->AdapterObj = C()->get('BqRule');
+                    break;
+                case  'lq':
+                    $this->AdapterObj = C()->get('LqRule');
+                    break;
+                case  'wq':
+                    $this->AdapterObj = C()->get('WqRule');
+                    break;
+                case  'zq':
+                    $this->AdapterObj = C()->get('ZqRule');
+                    break;
+            }
+
+            $this->gameType = $type ;
+            $this->match_id = $match_id ;
+
+            $this->getCompetitionData($type,$match_id);
+            $this->getCompResult($type,$match_id);
+
+            return true ;
+    }
+
+    //获取比赛数据模型
+    public function  getCompetitionData($type,$match_id){
+
+        $model = null ;
+        switch ($type){
+            case 'bq':
+                $model = lm('St_bq_competition','Commons')->where('match_id',$match_id)->first();
+                break;
+            case  'lq':
+                $model = lm('St_lq_competition','Commons')->where('match_id',$match_id)->first();
+                break;
+            case  'wq':
+                $model = lm('St_wq_competition','Commons')->where('match_id',$match_id)->first();
+                break;
+            case  'zq':
+                $model = lm('St_zq_competition','Commons')->where('match_id',$match_id)->first();
+                break;
+        }
+        if (empty($model)){
+            throw  new   \Exception('无效match_id_'.$type.'-'.$match_id,4004);
+            return false;
+        }
+
+        $this->matchModel = $model;
+        return $model ;
+    }
+
+
+    //查询此比较有下单记录
+    public function  getOrdersByMatchid($type,$marchid){
+            $modes = lm('Money_buy_match','Commons')->getByTypeMatch($type,$marchid);
+            return $$modes;
+    }
+
+    //批量结算处理 [只处理状态]
+    public function  BatchModesResult($type,$models){
+             $pclass = $this->AdapterObj ;
+             $RefClass = new  \ReflectionClass($pclass) ;
+            foreach ($models as $model){
+                  $oddscode = $model->odds_code;
+                  if ( $RefClass->hasMethod($oddscode)){
+                      $model->result  = $pclass->$oddscode($model,$this->resultModel,$this->resultRecords);
+                      $model->utime = date("Y-m-d H:i:s");
+                      $ret  = $model->save();
+                      if (!$ret){
+                          throw  new  \Exception('更新记录buy_match失败!',4006);
+                      }
+                      $this->getBuyDatas($model->order_id);
+
+                }else{
+                    throw  new  \Exception('找不到此玩法的胜负规则逻辑!',4005);
+                }
+            }
+            return true;
+    }
+
+
+
+
+
+
+    //某个订单下面的所有比赛是否全部处理完成
+    public function   OrderIsPressFinish($orderId){
+
+
+    }
+
+
+    //得到比赛最终结果记录 和 中间结果记录
+    public function  getCompResult($type,$match_id){
+        $model = null ;
+        switch ($type){
+            case 'bq':
+                $model = lm('St_bq_result','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_bq_result_record','Commons')->where('match_id',$match_id)->find();
+                break;
+            case  'lq':
+                $model = lm('St_lq_resultn','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_lq_result_record','Commons')->where('match_id',$match_id)->find();
+                break;
+            case  'wq':
+                $model = lm('St_wq_result','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_wq_result_record','Commons')->where('match_id',$match_id)->find();
+                break;
+            case  'zq':
+                $model = lm('St_zq_result','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_zq_result_record','Commons')->where('match_id',$match_id)->find();
+                break;
+        }
+        if (empty($model)){
+            throw  new   \Exception('没找到比赛结果记录match_id_'.$type.'-'.$match_id,4007);
+            return false;
+        }
+
+        $this->resultModel = $model;
+        $this->resultRecords = $models ;
+
+        $ret = [
+            'result' => $model,
+            'records' => $models ,
+        ];
+        return $ret;
+
+    }
+
+    //得到订单信息
+    public function  getBuyDatas($orderId){
+         if ( isset($this->buyArrays[$orderId]) ){
+             return $this->buyArrays[$orderId];
+         }
+
+         $model = lm("Money_buy")->where(['order_id',$orderId])->first();
+         if (!$model){
+             throw new  \Exception('没有订单基本信息_'.$orderId, 4008);
+         }
+
+         $details = lm("Money_buy_detail")->where(['order_id',$orderId])->find();
+         if (!$details){
+             throw new  \Exception('没有订单detail信息_'.$orderId, 4009);
+         }
+
+         $ret = [
+             'buy' =>$model ,
+             'details' => $details ,
+         ];
+
+        $this->buyArrays[$orderId] = $ret  ;
+        return $ret;
+    }
+
+
+
+}

+ 297 - 0
app/Lib/Settlement/SettlementSql.php

@@ -0,0 +1,297 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/4/25
+ * Time: 14:10
+ */
+
+namespace App\Lib\Settlement;
+set_time_limit(600);
+ini_set('memory_limit', '256M');
+
+
+class SettlementSql
+{
+
+    //用户的期末基本资料表 [uid]['account'=>$obj,'detail'=>$obj];
+     public  $AccountArrays = []  ;
+
+     //buy_match 里batch_id 相同的数据
+     public  $MatchBatchIdArrays = [] ;
+
+     //buy_str 批次号相同的记录
+    public  $BuyStrBatchIdArrays = [] ;
+
+    //所有比赛场次号相同的记录
+    public  $AllMatchIdArrays = [];
+
+    //比赛结束消息通知模型
+    public  $ComendNoticModel = null  ;
+
+    //返回的sql数组
+    private  $sqlArray = [] ;
+
+    public $gameType = '' ;  //类型
+    public $resultId = 0 ; //比赛最终结果ID
+    public $resultModel = null ; //比赛最终结果对像MODEL
+    public $resultRecords = [] ; //比赛中间结果对像数组;
+
+    //类型映射
+    public $gameAllMap = [
+        'zq'=>'ZqRule',
+        'lq'=>'LqRule',
+        'wq'=>'WqRule',
+        'bq'=>'BqRule',
+    ];
+    private  $AdapterObj = null ;
+
+    private   $RefClass = null  ;
+
+
+    public function   doRun(){
+
+
+        try {
+            _beginTransaction();
+
+            $ComendNoticModel = $this->getComendNoticeModel();
+            if (!$ComendNoticModel) {
+                _commit();
+                return  $this->makeData();
+            }
+            $this->writeStatusBegin($ComendNoticModel);
+
+            $allmatchs = $this->getAllMatchIdArrays($ComendNoticModel->game_code, $ComendNoticModel->match_id, 2);
+            $this->setAdapterObj( $ComendNoticModel->game_code );
+            $this->RefClass = new  \ReflectionClass(  $this->setAdapterObj ) ;
+            $this->getCompResult($ComendNoticModel->game_code,$ComendNoticModel->match_id);
+
+
+            if (!$allmatchs) {
+                $this->writeStatusEndOk($ComendNoticModel);
+                _commit();
+                return  $this->makeData();
+            }
+
+            foreach ($allmatchs  as $buymatchmodel){
+                    $this->doSettlement($buymatchmodel);
+            }
+
+            _commit();
+            return  $this->makeData();
+
+        }catch (\Exception $e){
+            _rollBack();
+            return $this->makeData(0,'false',['msg'=>$e->getMessage(),'code'=>$e->getCode()]) ;
+
+        }
+
+    }
+
+
+    //拼装  逻辑 sql;
+    private  function  doSettlement($model){
+        $fun = $model->odds_code ;
+        if ( $this->RefClass->hasMethod( $fun)){
+                $winorfalse = $this->AdapterObj->$fun($model,$this->resultModel,$this->resultRecords);
+                $this->makesql_up_buymatch_winorfalse($model->id,$winorfalse,date("Y-m-d H:i:s"));
+                if ($winorfalse == -1){
+                    $this->masql_up_buymatch_false($model->batch_id);
+                }
+
+
+
+
+
+
+        }else{
+            throw  new  \Exception('找不到此玩法的胜负规则逻辑!',4005);
+        }
+    }
+
+
+    private function  makesql_up_buymatch_winorfalse($id,$result,$utime){
+        $sql = " update  money_buy_match  set  result=$result,utime=$utime  where id=$id  limit 1";
+        $this->sqlArray[] = $sql;
+        return true;
+    }
+    private function masql_up_buymatch_false($batch_id){
+        $uptime = date("Y-m-d H:i:s");
+        $sql = " update  money_buy_match  set  result=-1 ,utime=$uptime,status=1  where batch_id=$batch_id  ";
+        $this->sqlArray[] = $sql;
+
+        $sql =  "update  money_buy_str  set   settle_status=1,game_status=3 ,wait_match_num=0  where  batch_id=$batch_id " ;
+        $this->sqlArray[] = $sql;
+
+        return true ;
+    }
+
+
+
+
+
+    private  function  setAdapterObj($game_type){
+
+        if ( isset($this->gameAllMap)){  throw  new \Exception('赛事类型错误',4002);   return false;  }
+
+        switch ($game_type){
+            case 'bq':
+                C()->set('BqRule','\Biz\Settlement\Adapter\BqRule');
+                $this->AdapterObj = C()->get('BqRule');
+                break;
+            case  'lq':
+                C()->set('LqRule','\Biz\Settlement\Adapter\LqRule');
+                $this->AdapterObj = C()->get('LqRule');
+                break;
+            case  'wq':
+                C()->set('WqRule','\Biz\Settlement\Adapter\WqRule');
+                $this->AdapterObj = C()->get('WqRule');
+                break;
+            case  'zq':
+                C()->set('ZqRule','\Biz\Settlement\Adapter\ZqRule');
+                $this->AdapterObj = C()->get('ZqRule');
+                break;
+        }
+        return  true ;
+    }
+
+
+    //返回数据
+    private function  makeData($status=1,$message='success',$data=''){
+        return [
+            'status' => $status ,
+            'message' =>$message,
+            'data' => $data ,
+        ] ;
+    }
+
+    //写处理状态
+    public function  writeStatusBegin($comendnticeModel){
+        $comendnticeModel->status = 1 ;
+        $comendnticeModel->pupdatetime = date("Y-m-d H:i:s");
+        $comendnticeModel->pcount ++ ;
+        $comendnticeModel->logs = 'begin|';
+        $ret = $comendnticeModel->save();
+        return  $ret;
+    }
+
+    //写处理状态结束
+    public function  writeStatusEndOk($comendnticeModel){
+        $comendnticeModel->status = 4 ;
+        $comendnticeModel->pret = 1 ;
+        $comendnticeModel->puodateendtime = date("Y-m-d H:i:s");
+        $comendnticeModel->logs = $comendnticeModel->logs.'end ok';
+        $ret = $comendnticeModel->save();
+        return  $ret;
+    }
+
+
+
+
+    public  function   getComendNoticeModel(){
+            $ret = lm('Comendnotice','Commons')->wherer('status',0)->order('id','asc')->first();
+            $this->ComendNoticModel = $ret;
+            return $ret;
+    }
+
+
+    public function  getAllMatchIdArrays( $type,$matchid ,$bet_type=2,$result = 0 ){
+            $ret = lm('Money_buy_match','Commons')->where(['game_code'=>$type,'match_id'=>$matchid,'bet_type'=>$bet_type,'result'=>$result])->find();
+            $this->AllMatchIdArrays = $ret;
+            return $ret;
+    }
+
+
+    public function  getUserInfo($account_name){
+         if (isset($this->AccountArrays[$account_name])){
+             return $this->AccountArrays['$account_name'];
+         }
+
+         $accountModel = lm('Account','Commons')->where(['account',$account_name])->first();
+         if (!$accountModel){
+             throw  new   \Exception('查无此用户数据account='.$account_name,41002);
+         }
+
+         $detailModel = lm('Account_detailed','Commons')->where(['account_identity',$accountModel->identity])->first();
+         if (!$detailModel){
+             throw  new   \Exception('查无此用户数据account_detail='.$accountModel->identity,41002);
+         }
+         $ret = [
+             'account'=>$detailModel,
+             'detail' => $detailModel ,
+         ];
+         $this->AccountArrays[$account_name] = $ret ;
+         $this->AccountArrays[$accountModel->identity] = $ret ;
+
+         return $ret;
+     }
+
+
+    public function  GetMatchBatchIdArrays($batch_id){
+            if (isset($this->MatchBatchIdArrays[$batch_id])){
+                return   $this->MatchBatchIdArrays[$batch_id];
+            }
+            $all = lm("Money_buy_match")->getByBatchId($batch_id);
+            if (!$all) {
+                throw  new  \Exception('无效的Money_buy_str->batch_id='.$batch_id , 41001);
+            }
+            $this->MatchBatchIdArrays[$batch_id] = $all ;
+            return $all ;
+    }
+
+
+    public function  GetBuyStrBatchIdArrays($batch_id){
+
+        if (isset($this->BuyStrBatchIdArrays[$batch_id])){
+            return   $this->BuyStrBatchIdArrays[$batch_id];
+        }
+        $all = lm("Money_buy_str")->getByBatchId($batch_id);
+        if (!$all) {
+            throw  new  \Exception('无效的Money_buy_str->batch_id='.$batch_id , 41001);
+        }
+        $this->BuyStrBatchIdArrays[$batch_id] = $all ;
+        return $all ;
+
+    }
+
+
+    //得到比赛最终结果记录 和 中间结果记录
+    public function  getCompResult($type,$match_id){
+        $model = null ;
+        switch ($type){
+            case 'bq':
+                $model = lm('St_bq_result','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_bq_result_record','Commons')->where('match_id',$match_id)->orderBy('id','asc')->get();
+                break;
+            case  'lq':
+                $model = lm('St_lq_resultn','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_lq_result_record','Commons')->where('match_id',$match_id)->orderBy('id','asc')->get();
+                break;
+            case  'wq':
+                $model = lm('St_wq_result','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_wq_result_record','Commons')->where('match_id',$match_id)->orderBy('id','asc')->get();
+                break;
+            case  'zq':
+                $model = lm('St_zq_result','Commons')->where('match_id',$match_id)->first();
+                $models = lm('St_zq_result_record','Commons')->where('match_id',$match_id)->orderBy('id','asc')->get();
+                break;
+        }
+        if (empty($model)){
+            throw  new   \Exception('没找到比赛结果记录match_id_'.$type.'-'.$match_id,4007);
+            return false;
+        }
+
+        $this->resultModel = $model;
+        $this->resultRecords = $models ;
+
+        $ret = [
+            'result' => $model,
+            'records' => $models ,
+        ];
+        return $ret;
+
+    }
+
+
+}

+ 1 - 1
app/Models/Account.php

@@ -25,7 +25,7 @@ class Account extends BaseModel
         $tjoin = ($tflag == -1) ? '' : ' LEFT JOIN (SELECT account_identity,count(id) AS take_num FROM money_details d ' . $takestatus . ' GROUP BY d.account_identity) AS tc ON tc.account_identity=account.identity ';
         // $agent_join = " LEFT JOIN nagent_detailed c ON b.parent_id=c.agent_identity";
 
-        $sql = "SELECT account.id, account.identity,account, b.grade, b.cash, b.name, b.register_time, b.qq,b.wechat,b.register_ip, b.last_ip, b.phone, b.email, b.statuss,open_invitation,b.register_url,b.last_url,to_char(last_time,'yyyy-mm-dd hh24:mi:ss') as last_time,account.status,b.statuss,b.parent_id" . $rnum . $tnum . " FROM account LEFT JOIN account_detailed b ON account.identity=b.account_identity" . $rjoin . $tjoin . " WHERE account.status<>4 " . $where . " ORDER BY " . $field . ' ' . $ads;
+        $sql = "SELECT account.id, account.identity,account.fanshui,account.account, b.grade, b.cash, b.name, b.register_time, b.qq,b.group_name,b.wechat,b.register_ip, b.last_ip, b.phone, b.email, b.statuss,open_invitation,b.register_url,b.last_url,to_char(last_time,'yyyy-mm-dd hh24:mi:ss') as last_time,account.status,b.statuss,b.parent_id" . $rnum . $tnum . " FROM account LEFT JOIN account_detailed b ON account.identity=b.account_identity" . $rjoin . $tjoin . " WHERE account.status<>4 " . $where . " ORDER BY " . $field . ' ' . $ads;
         if (!empty($list)) {
             $offset = $list * ($page - 1);
             $sql .= ' LIMIT ' . $list . ' OFFSET ' . $offset;

+ 58 - 27
app/Models/MoneyBuyStr.php

@@ -14,20 +14,25 @@ class MoneyBuyStr extends BaseModel {
     function getinfo($list = 10, $page, $where = '')
     {
         if (is_array ($where) && count ($where) > 0) {
-            $data = $this->join('money_details','money_details.info_identity','=','money_buy_str.info_identity')
-                ->select('money_buy_str.id','money_buy_str.order_id','money_buy_str.account_name','money_buy_str.game_name','money_buy_str.money','money_buy_str.prize_money','money_buy_str.water_status','money_buy_str.money_time','money_buy_str.settle_status','money_details.money_cash')
+            $data = $this
+                ->join('money_details','money_details.info_identity','=','money_buy_str.info_identity')
+                ->select('money_buy_str.id','money_buy_str.account_name','money_buy_str.order_id','money_buy_str.str_type','money_buy_str.money','money_buy_str.prize_money','money_buy_str.status','money_buy_str.money_time','money_buy_str.settle_status','money_buy_str.game_status','money_buy_str.gain_money','money_details.money_cash')
                 ->where($where)
                 ->orderby('money_buy_str.money_time','desc')
                 ->paginate ($list);
         } else {
-            $data = $this->join('money_details','money_details.info_identity','=','money_buy_str.info_identity')
-                ->select('money_buy_str.id','money_buy_str.order_id','money_buy_str.account_name','money_buy_str.game_name','money_buy_str.money','money_buy_str.prize_money','money_buy_str.water_status','money_buy_str.money_time','money_buy_str.settle_status','money_details.money_cash')
+            $data = $this
+                ->join('money_details','money_details.info_identity','=','money_buy_str.info_identity')
+                ->select('money_buy_str.id','money_buy_str.account_name','money_buy_str.order_id','money_buy_str.str_type','money_buy_str.money','money_buy_str.prize_money','money_buy_str.status','money_buy_str.money_time','money_buy_str.settle_status','money_buy_str.game_status','money_buy_str.gain_money','money_details.money_cash')
                 ->orderby('money_buy_str.money_time','desc')
                 ->paginate ($list);
         }
         if (!$data < 0) {
             return -2021052003; //
         }
+        //反水比例
+        $res = DB::table('setinfo')->where('infoname','放水赔率')->first();
+
         for($i=0;$i<count($data);$i++){
             if($data[$i]->status==1){
                 $data[$i]->status = '投注';
@@ -36,11 +41,6 @@ class MoneyBuyStr extends BaseModel {
             }else if($data[$i]->status==4){
                 $data[$i]->status = '撤单';
             }
-            if($data[$i]->water_status==1){
-                $data[$i]->water_status = '未回水';
-            }else if($data[$i]->water_status==2){
-                $data[$i]->water_status = '已回水';
-            }
             if($data[$i]->settle_status==1){
                 $data[$i]->settle_status = '未结算';
             }else if($data[$i]->settle_status==2){
@@ -53,24 +53,22 @@ class MoneyBuyStr extends BaseModel {
             }else if($data[$i]->game_status==2){
                 $data[$i]->game_status = '未中奖';
             }
-            if($data[$i]->member_type==1){
-                $data[$i]->member_type = '普通会员';
-            }else if($data[$i]->member_type==2){
-                $data[$i]->member_type = '超级会员';
-            }
-
-            $data[$i]->game_name = str_replace('*', '串', $data[$i]->game_name);
 
-            $mun = explode('串',$data[$i]->game_name);
+            //$str_type = str_replace('*', '串', $data[$i]->str_type);
+            $mun = explode('串',$data[$i]->str_type);
             $data[$i]->detail_content = $data[$i]->settle_status.':'.$mun[0].' [<a class="detail" lay-event="detail" pid="id" uri="/admin/SoccerStringNoteList/detail/?id=" href="/admin/SoccerStringNoteList/detail/?id='.$data[$i]->id.'"> 详情 </a>]';
 
+            //反水
+            $data[$i]->water_return = $data[$i]->money*$res->infocontent;
+            $data[$i]->result = $data[$i]->water_return+$data[$i]->gain_money;
+
             $data[$i]->money_match_time = '投注:'.$data[$i]->money_time;
 
             $data[$i]->frozen_cash = $data[$i]->money_cash;
             $data[$i]->available_cash = $data[$i]->money_cash+$data[$i]->money.'.00';
             $data[$i]->account = $data[$i]->available_cash.' <span>'.$data[$i]->account_name.' </span> '.$data[$i]->frozen_cash;
 
-            $data[$i]->settle_status = $data[$i]->settle_status.'<br><a class="layui-btn layui-btn-sm resettlement" lay-event="detail" pid="id" uri="/admin/SoccerStringNoteList/resettlement/?id=" href="/admin/SoccerStringNoteList/resettlement/?id='.$data[$i]->id.'"> 重新结算 </a>';
+            $data[$i]->settle_status = $data[$i]->settle_status.'<br><a class="layui-btn layui-btn-sm resettlement" lay-event="detail" pid="id" lay-filter = "resettlement" uri="/admin/SoccerStringNoteList/resettlement/?id=" href="/admin/SoccerStringNoteList/resettlement/?id='.$data[$i]->id.'"> 重新结算 </a>';
 
         }
         return $data->toArray();
@@ -93,18 +91,51 @@ class MoneyBuyStr extends BaseModel {
     //获取串关注单详情信息
     function getdetailinfo($id) {
         $res = $this->where('id',$id)->first();
-        $data = DB::table('st_bet_str')->where('id',$res->bet_str_id)->first();
-        $codes = json_decode($data->bet_str_all, true);
+        $data = DB::table('money_buy_match')->where('batch_id',$res->batch_id)->get();
+        $game_type = DB::table('st_game_type')->get();
+        for($i=0;$i<count($data);$i++){
+            $league = DB::table('st_'.$data[$i]->game_code.'_league')->where('lg_id',$data[$i]->lg_id)->first();
+            if(!empty($league)){
+                $data[$i]->league = $league->name_chinese;
+            }else{
+                $data[$i]->league = $data[$i]->lg_id;
+            }
+
+            $odds_code = DB::table('st_odds_code')->where('odds_code',$data[$i]->odds_code)->first();
+            if(!empty($odds_code)){
+                $data[$i]->odds_code = $odds_code->odds_name;
+            }
+
+            $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
+
+            for($j=0;$j<count($game_type);$j++){
+                if($data[$i]->game_code == $game_type[$j]->game_code){
+                    $data[$i]->game_type = $game_type[$j]->game_name;
+                }
+            }
 
-        for($i=0;$i<count($codes);$i++){
-            $codes[$i]['home_guest'] = $codes[$i]['home_team'].' VS '.$codes[$i]['guest_team'];
-            $oddscode = DB::table('st_odds_code')->where('odds_code',$codes[$i]['odds_code'])->first();
-            $codes[$i]['odds_code'] = $oddscode->odds_name;
-            $type = DB::table('st_game_type')->where('game_code',$codes[$i]['ballId'])->first();
-            $codes[$i]['game_type'] = $type->game_name;
+            if($data[$i]->status == 0){
+                $data[$i]->status = '未结算';
+            }else if($data[$i]->status == 1){
+                $data[$i]->status = '已结算';
+            }
 
+            if($data[$i]->result == -1){
+                $data[$i]->result = '输';
+            }else if($data[$i]->result == 0){
+                $data[$i]->result = '未处理';
+            }else if($data[$i]->result == 1){
+                $data[$i]->result = '赢';
+            }else if($data[$i]->result == 2){
+                $data[$i]->result = '平';
+            }else if($data[$i]->result == 3){
+                $data[$i]->result = '赢半平半';
+            }else if($data[$i]->result == 4){
+                $data[$i]->result = '输半平半';
+            }
         }
-        return $codes;
+
+        return $data->toArray();
     }
 
 

+ 7 - 0
app/Models/Setinfo.php

@@ -22,6 +22,13 @@ class Setinfo extends BaseModel {
         }
         return $data->toArray();
     }
+    function fsnum(){
+        $data=$this->where('id',1001)->first();
+        if(!$data){
+            return -6010000222;//没有弹框信息
+        }
+        return $data->toArray();
+    }
     //获取客服qq信息
     function getQQnumber(){
         $data=$this->where('infotype',16)->first();

+ 20 - 33
app/Models/SportsNoteList.php

@@ -8,31 +8,25 @@
 namespace App\Models;
 use Illuminate\Support\Facades\DB;
 class SportsNoteList extends BaseModel {
-    protected $table = "money_buy";
+    protected $table = "money_buy_simplex";
     public $timestamps = false;
 
     function getinfo($list = 10, $page, $where = '',$type)
     {
-        if (is_array ($where) && count ($where) > 0) {
-            $data = $this
-                ->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy.match_id')
-                ->join('money_details','money_details.info_identity','=','money_buy.info_identity')
-                //->join('st_game_type','st_game_type.game_code','=','money_buy.game_name')
-                ->where($where)
-                ->where('money_buy.game_name', $type)
-                ->orderby('money_buy.money_time','desc')
-                ->paginate ($list);
-        } else {
-            $data = $this
-                ->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy.match_id')
-                ->join('money_details','money_details.info_identity','=','money_buy.info_identity')
-                ->where('money_buy.game_name', $type)
-                ->orderby('money_buy.money_time','desc')
-                ->paginate ($list);
-        }
+        $data = $this
+            ->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')
+            ->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')
+            //->join('money_buy_match','money_buy_match.order_id','=','money_buy.order_id')
+            //->join('st_'.$type.'_league','st_'.$type.'_league.lg_id','=','money_buy_match.lg_id')
+            ->where($where)
+            ->orderby('money_buy_simplex.money_time','desc')
+            ->paginate ($list);
         if (!$data < 0) {
             return -2021052003; //
         }
+        //反水比例
+        $res = DB::table('setinfo')->where('infoname','放水赔率')->first();
+
         for($i=0;$i<count($data);$i++){
             if($data[$i]->status==1){
                 $data[$i]->status = '投注';
@@ -41,11 +35,6 @@ class SportsNoteList extends BaseModel {
             }else if($data[$i]->status==4){
                 $data[$i]->status = '撤单';
             }
-            if($data[$i]->water_status==1){
-                $data[$i]->water_status = '未回水';
-            }else if($data[$i]->water_status==2){
-                $data[$i]->water_status = '已回水';
-            }
             if($data[$i]->settle_status==1){
                 $data[$i]->settle_status = '未结算';
             }else if($data[$i]->settle_status==2){
@@ -58,13 +47,12 @@ class SportsNoteList extends BaseModel {
             }else if($data[$i]->game_status==2){
                 $data[$i]->game_status = '未中奖';
             }
-            if($data[$i]->member_type==1){
-                $data[$i]->member_type = '普通会员';
-            }else if($data[$i]->member_type==2){
-                $data[$i]->member_type = '超级会员';
-            }
             $data[$i]->match_id_order = '<span>'.$data[$i]->match_id.'</span><br>'.$data[$i]->order_id;
 
+            //反水
+            $data[$i]->water_return = $data[$i]->money*$res->infocontent;
+            $data[$i]->result = $data[$i]->water_return+$data[$i]->gain_money;
+
             $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
             $data[$i]->match_time = '开赛:'.$data[$i]->match_date.' '.$data[$i]->match_time;
             $data[$i]->money_match_time = '投注:'.$data[$i]->money_time.'<br>'.$data[$i]->match_time;
@@ -81,17 +69,16 @@ class SportsNoteList extends BaseModel {
             $data[$i]->available_cash = $data[$i]->money+$data[$i]->money_cash.'.00';
             $data[$i]->account = $data[$i]->available_cash.'<br><span>'.$data[$i]->account_name.'</span><br>'.$data[$i]->frozen_cash;
 
-            $codes = json_decode($data[$i]->codes, true);
-            $data[$i]->content = '';
-            for($j=0;$j<count($codes);$j++){
-                $odds_code = $codes[$j]['odds_code'];
+            $content = DB::table('money_buy_match')->where('batch_id',$data[$i]->batch_id)->get();
+            for($j=0;$j<count($content);$j++){
+                $odds_code = $content[$j]->odds_code;
                 $result = DB::table('st_odds_code')->where('odds_code',$odds_code)->first();
                 if(!empty($result)){
                     $odds_name = $result->odds_name;
                 }else{
                     $odds_name = $odds_code;
                 }
-                $data[$i]->content = $data[$i]->content.$odds_name.  '¥'.$codes[$j]['bet_amount'].'<br>';
+                $data[$i]->content = $data[$i]->content.$odds_name.  '¥'.$content[$j]->bet_money.'@'.$content[$j]->odds.'<br>';
 
             }
 

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
public/frame/layui/css/layui.css


+ 4 - 1
resources/lang/zh-cn/sportsnotelist.php

@@ -15,10 +15,13 @@ return array(
     'prize_note' => '中奖注数',
     'money' => '投注金额',
     'prize_money' => '可赢金额',
+    'pay_money' => '投注金额',
+    'expect_money' => '可赢金额',
     'result' => '结果',
     'status' => '状态',
     'content' => '投注详细信息',
     'water_status' => '回水',
+    'water_return' => '反水',
     'money_time' => '下注时间',
     'prize' => '开奖号码',
     'settle_status' => '状态',
@@ -26,7 +29,7 @@ return array(
     'member_type' => '会员类型',
     'edit' => '修改',
 
-    'game_name' => '模式',
+    'str_type' => '模式',
     'detail_content' => '结算详细信息',
 
     'notelist_type' => '投注球类',

+ 6 - 0
resources/lang/zh-cn/status.php

@@ -371,5 +371,11 @@ return array(
 			'2' => '重新结算上半场',
 		),
 	),
+	'isfs'=>array(
+		'fanshui' => array(
+			'1' => '不反水',
+			'2' => '反水',
+		),
+	),
 	
 );

+ 2 - 0
resources/lang/zh-cn/user.php

@@ -20,6 +20,7 @@ return array(
 	'email' => '邮箱',
 	'statuss' => '状态',
 	'agent_name' => '代理邀请码',
+	'isfs' => '是否反水',
 	'register_last_time'=>'注册/登录时间',
 
 	'type' => '操作内容',
@@ -40,6 +41,7 @@ return array(
 	'cash_area' => '余额区间',
 	'select_status' => '请选择状态',
 	'select_statuss' => '请选择会员登录状态',
+	'select_isfs' => '请选择反水状态',
 	'select_trade_type' => '请选择交易类型',
 	'select_replytype' => '请选择反馈类型',
 	'select_grade' => '请选择会员等级',

+ 37 - 19
resources/views/admin/baseSet/index.blade.php

@@ -69,7 +69,7 @@
         </div>
     </div>
 
-    <div class="layui-colla-item">
+   <!--  <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{$tan_box['infotype']}}">PC弹窗设置[6]</h2>
         <div class="layui-colla-content">
 
@@ -122,7 +122,7 @@
             </form>
 
         </div>
-    </div>
+    </div> -->
 
     <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{$startup['infotype']}}">APP启动图设置<span
@@ -142,7 +142,25 @@
             </form>
         </div>
     </div>
-
+    
+    <div class="layui-colla-item">
+        <h2 class="layui-colla-title" data-type="{{$fsnum['infotype']}}">反水赔率<span
+                    style="font-size: 10px;"></span></h2>
+        <div class="layui-colla-content">
+            <form class="layui-form" action="">
+                <input type="hidden" name="id" value="9000">
+                <input type="hidden" name="type" value="{{$fsnum['infotype']}}">
+                <input type="hidden" name="infoname" value="放水赔率">
+                <div class="layui-form-item">
+                    <label class="layui-form-label">赔率比例</label>
+                    <div class="layui-input-block">
+                        <input type="text" name="infocontent" lay-verify="title" autocomplete="off" placeholder=""
+                               class="layui-input" value="{{$fsnum['infocontent']}}">
+                    </div>
+                </div>
+            </form>
+        </div>
+    </div>
 
     <!--新版弹窗设置-->
     <div class="layui-colla-item">
@@ -204,7 +222,7 @@
         </div>
     </div>
 
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{$qq['infotype']}}">客服QQ设置[16]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -230,7 +248,7 @@
 
         </div>
     </div>
-
+ -->
     <!--联系我们设置-->
     <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($connectioninfo['con_tel']['infotype'])?$connectioninfo['con_tel']['infotype']:1017}}">
@@ -325,7 +343,7 @@
             </form>
         </div>
     </div>
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{$plat['infotype']}}">平台维护[0]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -350,7 +368,7 @@
 
             </form>
         </div>
-    </div>
+    </div> -->
 
 
     <div class="layui-colla-item">
@@ -374,7 +392,7 @@
         </div>
     </div>
 
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{$game['infotype']}}">虚拟中奖信息设置[15]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -391,7 +409,7 @@
 
             </form>
         </div>
-    </div>
+    </div> -->
     <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{$run['infotype']}}">跑马灯设置[9]<span style="font-size: 10px;">[9/id-1006]</span>
         </h2>
@@ -835,7 +853,7 @@
     </div>
 
     <!--ip限制设置-->
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($ip['infotype'])?$ip['infotype']:23}}">IP限制设置[23/id-1014]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -853,7 +871,7 @@
 
             </form>
         </div>
-    </div>
+    </div> -->
     <!--网站设置-->
     <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($net['netname']['infotype'])?$net['netname']['infotype']:24}}">
@@ -964,7 +982,7 @@
     </div>
 
     <!--websocket ip设置-->
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($wsport['infotype'])?$wsport['infotype']:9501}}">聊天服务器IP设置[9501]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -996,10 +1014,10 @@
 
             </form>
         </div>
-    </div>
+    </div> -->
 
     <!--加拿大28维护-->
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($jnd['infotype'])?$jnd['infotype']:40}}">加拿大28维护[40/id-1113]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -1026,7 +1044,7 @@
 
             </form>
         </div>
-    </div>
+    </div> -->
 
     <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($playtest['infotype'])?$playtest['infotype']:2000}}">试玩账号时间设置[2000/id-2000]</h2>
@@ -1089,7 +1107,7 @@
         </div>
     </div>
 
-     <div class="layui-colla-item">
+     <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($liao['infotype'])?$liao['infotype']:2002}}">聊天室白名单[2002/id-2002]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -1110,9 +1128,9 @@
                 </div>
             </form>
         </div>
-    </div>
+    </div> -->
 
-    <div class="layui-colla-item">
+    <!-- <div class="layui-colla-item">
         <h2 class="layui-colla-title" data-type="{{isset($word['infotype'])?$word['infotype']:2002}}">聊天室敏感字列表[2003/id-2003]</h2>
         <div class="layui-colla-content">
             <form class="layui-form" action="">
@@ -1132,7 +1150,7 @@
                 </div>
             </form>
         </div>
-    </div>
+    </div> -->
     <!---图片服务器地址-->
     <div class="layui-colla-item">
         <h2 class="layui-colla-title">图片服务器地址[2004]</h2>

+ 4 - 0
resources/views/admin/sportsfoot/outcome.blade.php

@@ -181,6 +181,7 @@
                 url: '/admin/Sportsfoot/updatenum',
                 data: {id:id,num:num,type:1},
                 success: function(data) {
+                    location. reload()//刷新当前页面
                 }
             })
         }
@@ -201,6 +202,7 @@
                 url: '/admin/Sportsfoot/updatenum',
                 data: {id:id,num:num,type:2},
                 success: function(data) {
+                    location. reload()//刷新当前页面
                 }
             })
         }
@@ -218,6 +220,7 @@
                 url: '/admin/Sportsfoot/updatenum',
                 data: {id:id,num:num,type:3},
                 success: function(data) {
+                    location. reload()//刷新当前页面
                 }
             })
         }
@@ -235,6 +238,7 @@
                 url: '/admin/Sportsfoot/updatenum',
                 data: {id:id,num:num,type:4},
                 success: function(data) {
+                    location. reload()//刷新当前页面
                 }
             })
         }

+ 43 - 5
resources/views/admin/user/index.blade.php

@@ -45,11 +45,16 @@
 			line-height: 2em;
 		}
     </style>
+
 	<script type="text/html" id="agent">
-		@{{#if(d.invite==''){ }}
-			无上级
+		@{{#if(d.fanshui==1){ }}
+			<div onclick="isfs(2,@{{d.id}})" class="layui-input-inline checkbox">
+				<input type="checkbox" lay-skin="switch" lay-text="是|否" class="layui-input" eventType=event-query>
+			</div>
 		@{{#}else{ }}
-			<a class="" href="/admin/nagentChild/index?identity=@{{ d.parent_id }}">@{{d.invite}}</a>
+			<div onclick="isfs(1,@{{d.id}})" class="layui-input-inline checkbox">
+				<input type="checkbox" lay-skin="switch" lay-text="否|是" class="layui-input" eventType=event-query>
+			</div>
 		@{{#} }}
 	</script>	
     <script type="text/html" id="waterTool">
@@ -94,7 +99,7 @@
 	<script type="text/html" id="userdetail">
 	  <a href="/admin/user/view?identity=@{{d.identity}}">@{{ d.account}}</a><br>
 	  
-	  @{{d.grade_name}}
+	  @{{d.group_name}}
 	</script>
 
 	<!--<script type="text/html" id="moneynum">
@@ -243,6 +248,22 @@
 								</select>
 							</div>
 						</div>
+						
+						<div class="layui-inline" style="width: 360px">
+							<label class="layui-form-label">{{ trans('user.isfs') }}</label>
+							<div class="layui-input-inline" style="width: 200px">
+								<select name="fanshui" id="form_fanshui" lay-verify="" autocomplete="off" class="layui-input" eventType=event-query>
+									<option value="">{{ trans('user.select_isfs') }}</option>
+									@foreach(trans('status.isfs.fanshui') as $k=>$v):
+										@if($fanshui==$k))
+											<option value="{{$k}}" selected="selected">{{$v}}</option>
+										@else
+											<option value="{{$k}}">{{$v}}</option>
+										@endif
+									@endforeach
+								</select>
+							</div>
+						</div>
 
 					</div>
 
@@ -305,7 +326,7 @@
             </form>
         </div>
     </div>
-    <script>
+    <script type="text/javascript">
         $(function () {
             $('body').on('click', 'a[eventtype="event-delete"]', function () {
                 var span = $(this).prev();
@@ -332,6 +353,18 @@
 			});
 		}
 
+		function isfs(type,id){
+			$.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url: '/admin/User/ajaxfsup',
+                data: {id:id,type:type},
+                success: function(data) {
+                	location. reload()//刷新当前页面
+                }
+            })
+		}
+
     </script>
     @push('dataTableJS')
         /*var active = {
@@ -374,6 +407,7 @@
 		$('.registtoday').on('click', function(){
 			$('input').val('');
 			$('#form_statuss').val('');
+			$('#form_fanshui').val('');
 			$('#form_grade').val('');
 			$('#form_select_type').val('');
 			$('#form_regist_startime').val($(this).attr('data-id'));
@@ -385,6 +419,7 @@
 		$('.onlinetoday').on('click', function(){
 			$('input').val('');
 			$('#form_statuss').val('');
+			$('#form_fanshui').val('');
 			$('#form_grade').val('');
 			$('#form_select_type').val('');
 			$('#form_last_startime').val($(this).attr('data-id'));
@@ -398,6 +433,7 @@
 		$('.online').on('click', function(){
 			$('input').val('');
 			$('#form_statuss').val('');
+			$('#form_fanshui').val('');
 			$('#form_grade').val('');
 			$('#form_select_type').val('');
 			$('#form_statuss').val(1);
@@ -409,6 +445,7 @@
 		$('.onlines').on('click', function(){
 		$('input').val('');
 		$('#form_statuss').val('');
+			$('#form_fanshui').val('');
 		$('#form_grade').val('');
 		$('#form_select_type').val('');
 		$('#status').val(5);
@@ -431,6 +468,7 @@
         $('.reset').on('click',function(){
 			$('input').val('');
 			$('#form_statuss').val('');
+			$('#form_fanshui').val('');
 			$('#form_grade').val('');
 			$('#form_select_type').val('');
 			//var type = $(this).data('type');

+ 13 - 2
resources/views/sports/base_match.blade.php

@@ -9,13 +9,24 @@
         }
 
         .layui-form-switch em {
-            width: 36px;
+            width: auto;
         }
 
         .layui-form-switch {
-            width: 53px;
+            width: 44px;
+            line-height: 23px;
+        }
+        table .layui-form-switch em {
+            width: 36px;
+        }
+
+        table .layui-form-switch {
+            width: 56px;
             line-height: 23px;
         }
+        table .layui-form-onswitch i{
+            left:44px;
+        }
 
         .layui-form-item .checkbox {
             width: auto;

+ 13 - 2
resources/views/sports/basket_match.blade.php

@@ -9,13 +9,24 @@
         }
 
         .layui-form-switch em {
-            width: 36px;
+            width: auto;
         }
 
         .layui-form-switch {
-            width: 53px;
+            width: 44px;
+            line-height: 23px;
+        }
+        table .layui-form-switch em {
+            width: 36px;
+        }
+
+        table .layui-form-switch {
+            width: 56px;
             line-height: 23px;
         }
+        table .layui-form-onswitch i{
+            left:44px;
+        }
 
         .layui-form-item .checkbox {
             width: auto;

+ 13 - 2
resources/views/sports/soccer_match.blade.php

@@ -9,13 +9,24 @@
         }
 
         .layui-form-switch em {
-            width: 36px;
+            width: auto;
         }
 
         .layui-form-switch {
-            width: 53px;
+            width: 44px;
+            line-height: 23px;
+        }
+        table .layui-form-switch em {
+            width: 36px;
+        }
+
+        table .layui-form-switch {
+            width: 56px;
             line-height: 23px;
         }
+        table .layui-form-onswitch i{
+            left:44px;
+        }
 
         .layui-form-item .checkbox {
             width: auto;

+ 0 - 3
resources/views/sports/sports_notelist.blade.php

@@ -11,16 +11,13 @@
         .layui-form-switch em {
             width: auto;
         }
-
         .layui-form-switch {
             width: 44px;
             line-height: 23px;
         }
-
         .layui-form-item .checkbox {
             width: auto;
         }
-
         .red{
             color: red;
         }

+ 14 - 17
resources/views/sports/sports_notelistdetail.blade.php

@@ -11,16 +11,13 @@
         .layui-form-switch em {
             width: auto;
         }
-
         .layui-form-switch {
             width: 44px;
             line-height: 23px;
         }
-
         .layui-form-item .checkbox {
             width: auto;
         }
-
         .red{
             color: red;
         }
@@ -75,25 +72,25 @@
             <form class="layui-form rewrite" eventType="eventForm"  action="" method="get">
                 <div class="layui-form-item">
 
-                    <div class="layui-inline">
-                        <label class="layui-form-label">{{ trans('sportsnotelist.match_id') }}</label>
-                        <div class="layui-input-inline">
-                            <input type="text" name="match_id" id="match_id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input">
-                        </div>
-                        <div class="layui-input-inline checkbox">
-                            <input type="checkbox" name="sureblur" id="form_sureblur" lay-skin="switch" lay-text="精确|模糊" @if(!isset($sureblurs) || $sureblurs=='on') checked @endif  class="layui-input" eventType=event-query>
-                            <input type="hidden" name="sureblurs" id="form_sureblurs" lay-verify="required" autocomplete="off" class="layui-input" eventType=event-query  value="{{ $sureblurs }}">
-                        </div>
-                    </div>
+                    {{--<div class="layui-inline">--}}
+                        {{--<label class="layui-form-label">{{ trans('sportsnotelist.match_id') }}</label>--}}
+                        {{--<div class="layui-input-inline">--}}
+                            {{--<input type="text" name="match_id" id="match_id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input">--}}
+                        {{--</div>--}}
+                        {{--<div class="layui-input-inline checkbox">--}}
+                            {{--<input type="checkbox" name="sureblur" id="form_sureblur" lay-skin="switch" lay-text="精确|模糊" @if(!isset($sureblurs) || $sureblurs=='on') checked @endif  class="layui-input" eventType=event-query>--}}
+                            {{--<input type="hidden" name="sureblurs" id="form_sureblurs" lay-verify="required" autocomplete="off" class="layui-input" eventType=event-query  value="{{ $sureblurs }}">--}}
+                        {{--</div>--}}
+                    {{--</div>--}}
 
                     <div class="layui-inline">
                         <a class="layui-btn layui-btn-sm lay-btn-diy" href="javascript:history.go(-1)" style="background-color:#1E9FFF;">返回</a>
-                        <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
-                        <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
-                        <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
+                        {{--<a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>--}}
+                        {{--<a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>--}}
+                        {{--<a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>--}}
                         {{--@if(checkRriv('/admin/SportsSoccer/add'))<a href="/admin/SportsSoccer/add" class="layui-btn layui-btn-sm ">添加</a>@endif--}}
                         {{--@if(checkRriv('/admin/SoccerNoteList/orderstatus'))<a href="/admin/SoccerNoteList/orderstatus" class="layui-btn layui-btn-sm ">订单状态审核</a>@endif--}}
-                        @if(checkRriv('/admin/SoccerNoteList/delete'))<a href="javascript:delWin('/admin/SoccerNoteList/delete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
+                        {{--@if(checkRriv('/admin/SoccerNoteList/delete'))<a href="javascript:delWin('/admin/SoccerNoteList/delete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif--}}
                     </div>
 
                     <!-- &nbsp;&nbsp;&nbsp;&nbsp;<div class="layui-inline"><a href="javascript:openWin('/admin/user/infoAdd','{{ trans('menu.menu_add') }}','700px','500px')" class="layui-btn layui-btn-sm  ">添加</a></div>

+ 0 - 12
resources/views/sports/sports_stringnotelist.blade.php

@@ -11,12 +11,10 @@
         .layui-form-switch em {
             width: auto;
         }
-
         .layui-form-switch {
             width: 44px;
             line-height: 23px;
         }
-
         .layui-form-item .checkbox {
             width: auto;
         }
@@ -84,15 +82,6 @@
                         </div>
                     </div>
 
-                    <div class="layui-inline">
-                        <label class="layui-form-label">{{ trans('money.apply_startime') }}</label>
-                        <div class="layui-input-inline">
-                            <input type="text" name="apply_startime" id="form_apply_startime" placeholder=" - " lay-verify="" autocomplete="off" class="layui-input test-item" eventType=event-query  value="">
-                        </div>
-                    </div>
-
-
-
                     <div class="layui-inline">
                         <label class="layui-form-label">{{ trans('sportsnotelist.date') }}</label>
                         <div class="layui-input-inline">
@@ -212,7 +201,6 @@
     data[i]=parseFloat(data[i]);
     }
     str+='<p class="bottom-txt">总投注金额:<span class="blue">'+data.all_money+'</span> , 总可赢金额:<span class="green">'+data.all_prize_money+'</span></p>'
-    {{--str+='<p class="bottom-txt">总金额:<span class="blue">'+data.all_money+'</span> , 成功:<span class="green">'+data.success_money+'</span> , 手续费:<span class="red">'+data.service_money+'</span> , 处理中:<span class="yellow">'+data.handing+'</span></p>'--}}
     $('#statistics').html(str);
     var height1=$('.layui-table-view').height();
     var height2=$('#statistics').height();

+ 13 - 2
resources/views/sports/tennis_match.blade.php

@@ -9,13 +9,24 @@
         }
 
         .layui-form-switch em {
-            width: 36px;
+            width: auto;
         }
 
         .layui-form-switch {
-            width: 53px;
+            width: 44px;
+            line-height: 23px;
+        }
+        table .layui-form-switch em {
+            width: 36px;
+        }
+
+        table .layui-form-switch {
+            width: 56px;
             line-height: 23px;
         }
+        table .layui-form-onswitch i{
+            left:44px;
+        }
 
         .layui-form-item .checkbox {
             width: auto;

+ 5 - 0
routes/web.php

@@ -20,6 +20,11 @@ Route::get('/', function () {
     // return redirect('/admin/default/index');
 })->middleware('admin');
 
+//测试结算规则
+ Route::get('api/Settlement/index', function () {
+     return appExec('api', 'Settlement', 'index');
+ });
+
 
 /**
  * 得到指定游戏的当前期信息

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor