彭俊 6 år sedan
förälder
incheckning
33f122280c

+ 10 - 1
app/Http/Controllers/Api/SettlementController.php

@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Api;
 
 use App\Http\Model\StSettlementMiddleDetail;
 use App\Lib\Settlement\Adapter\RulePlus;
-use App\Lib\Settlement\Adapter\ZqRule;
+use App\Lib\Settlement\Adapter\LqRule;
 use App\Lib\Settlement\SettlementAuto;
 use App\Lib\Settlement\SettlementOrder;
 use App\Lib\Settlement\Adapter\WqRule;
@@ -47,6 +47,15 @@ class SettlementController extends Controller
     public function debug(Req $req)
     {
 
+        $match = DB::table('money_buy_match')->where(['order_id' => 'S20191102170628894846203'])->first();
+        $result = DB::table('st_lq_result')->where(['match_id' => '161'])->get();
+        //$result = DB::table('st_wq_result')->where(['id' => '20'])->get();
+        $rule = new  LqRule();
+        $resultb = $rule->tnb($match, $result, []);
+        print_r($resultb);
+        exit ;
+
+
 
         $model = new ComendnoticeModel();
         $need = $model->getNeedSettelent() ;

+ 28 - 16
app/Models/MoneyBuyStr.php

@@ -129,10 +129,14 @@ class MoneyBuyStr extends BaseModel
             } else if ($data[$i]->status == 1 && $data[$i]->settle_status == 2) {
                 $data[$i]->order_status = '投注<br>' . $settle_status;
             } else if ($data[$i]->status == 2) {
-                $data[$i]->order_status = '作废<br>' . $settle_status;//.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已作废 </a>';
+                //$data[$i]->order_status = '作废<br>' . $settle_status;//.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已作废 </a>';
+                $data[$i]->order_status = '已作废';
             } else if ($data[$i]->status == 3) {
-                $data[$i]->order_status = '撤单<br>' . $settle_status;//'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已撤单 </a>';
+                //$data[$i]->order_status = '撤单<br>' . $settle_status;//'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已撤单 </a>';
+                $data[$i]->order_status = '已作废';
             }
+
+
             if ($data[$i]->game_status == 0) {
                 $data[$i]->game_status = '待开奖';
             } else if ($data[$i]->game_status == 1) {
@@ -143,9 +147,17 @@ class MoneyBuyStr extends BaseModel
                 $data[$i]->game_status = '未中奖';
             }
 
+
             $str_type = str_replace('*', '串', $data[$i]->str_type);
             $mun = explode('串', $data[$i]->str_type);
-            $data[$i]->detail_content  = $data[$i]->game_status . ' [<a class="detail" lay-event="detail" pid="id" uri="/admin/SoccerStringNoteList/detail/?id=" href="/admin/SoccerStringNoteList/detail/?id=' . $data[$i]->id . '"> 详情 </a>]';
+
+            if ($data[$i]->status != 3) {
+                $data[$i]->detail_content = $data[$i]->game_status . ' [<a class="detail" lay-event="detail" pid="id" uri="/admin/SoccerStringNoteList/detail/?id=" href="/admin/SoccerStringNoteList/detail/?id=' . $data[$i]->id . '"> 详情 </a>]';
+            } else {
+                $data[$i]->detail_content = '';
+            }
+
+
             //$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]->str_type = $data[$i]->str_type . '<br>(<span>' . $data[$i]->account_name . '</span>)';
 
@@ -213,10 +225,10 @@ class MoneyBuyStr extends BaseModel
     }
 
     //投注金额汇总统计
-    function MoneyCount($where = '',$match_id='',$game_code='')
+    function MoneyCount($where = '', $match_id = '', $game_code = '')
     {
         $data = array();
-        if(empty($match_id)){
+        if (empty($match_id)) {
             $data['all_money'] = $this->where('status', '1')->sum('money');
             $data['all_prize_money'] = $this->where('status', '1')->sum('prize_money');
             $data['alraedy_prize_money'] = $this->where('settle_status', '2')->where('status', '1')->sum('gain_money');
@@ -228,17 +240,17 @@ class MoneyBuyStr extends BaseModel
         }
 
         //追加 如果有赛事id+球类代码 则查询该赛事下所有串式投注
-        if(!empty($game_code) and !empty($match_id)){
-            $where_match = ['game_code'=>$game_code,'match_id'=>$match_id,'bet_type'=>2];
+        if (!empty($game_code) and !empty($match_id)) {
+            $where_match = ['game_code' => $game_code, 'match_id' => $match_id, 'bet_type' => 2];
             $moneyBuyMatch = new MoneyBuyMatchModel();
             $str_order_ids = $moneyBuyMatch->getByAttrs($where_match)->toArray();
-           
 
-            if(empty($str_order_ids)){
+
+            if (empty($str_order_ids)) {
                 $data['all_money'] = 0;
                 $data['all_prize_money'] = 0;
                 $data['alraedy_prize_money'] = 0;
-            }else{
+            } else {
                 $data['all_money'] = $this->where('status', '1')->sum('money');
                 $data['all_prize_money'] = $this->where('status', '1')->sum('prize_money');
                 $data['alraedy_prize_money'] = $this->where('settle_status', '2')->where('status', '1')->sum('gain_money');
@@ -249,7 +261,7 @@ class MoneyBuyStr extends BaseModel
                 }
             }
         }
-       
+
         return $data;
     }
 
@@ -375,12 +387,12 @@ class MoneyBuyStr extends BaseModel
     //获取串式注单信息
     public function strmatchs()
     {
-        $match = \App\Models\MoneyBuyMatch::select('match_id','batch_id')->where('bet_type',2)->get()->toArray ();
-        $str = $this->select('order_id','batch_id')->get()->toArray ();
-        for ($i=0; $i < count($str); $i++){
+        $match = \App\Models\MoneyBuyMatch::select('match_id', 'batch_id')->where('bet_type', 2)->get()->toArray();
+        $str = $this->select('order_id', 'batch_id')->get()->toArray();
+        for ($i = 0; $i < count($str); $i++) {
             $str[$i]['match_ids'] = array();
-            for ($j=0; $j < count($match); $j++){
-                if($str[$i]['batch_id'] == $match[$j]['batch_id']){
+            for ($j = 0; $j < count($match); $j++) {
+                if ($str[$i]['batch_id'] == $match[$j]['batch_id']) {
                     $str[$i]['match_ids'][] = $match[$j]['match_id'];
                 }
             }

+ 0 - 1
app/Models/SportsNoteList.php

@@ -35,7 +35,6 @@ class SportsNoteList extends BaseModel
      * 测试 使用
      */
     function getinfo($list = 10, $page, $where = '', $type){
-        // dd($where);
         $orderData = $this
             ->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
             ->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')

+ 1 - 1
resources/views/sports/sports_stringnotelist.blade.php

@@ -75,7 +75,7 @@
 
     <script type="text/html" id="myoption">
         @{{#if(d.status==1){ }}
-        <button onclick="invalid('/admin/SoccerStringNoteList/RevokeStrOrder','@{{d.order_id}}')" class="layui-btn layui-btn-sm settlement">撤单</button>
+        <button onclick="invalid('/admin/SoccerStringNoteList/RevokeStrOrder','@{{d.order_id}}')" class="layui-btn layui-btn-sm settlement">作废</button>
         @{{#} }}
     </script>