Browse Source

后台调试

彭俊 6 years ago
parent
commit
5d57332e10

+ 6 - 1
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -228,7 +228,6 @@ class SoccerNoteListController extends Controller
             $newa[0]['home_score'] = $req->home_score;//主队进球
             $newa[0]['guest_score'] = $req->guest_score;//客队进球
             $newa[0]['all_goal'] = intval($req->guest_score)+intval($req->home_score);//总进球
-            $newa[0]['first_score'] = $req->firstscore;//最先进球球队
             $newa[0]['last_score'] = $req->lastscore;//最后进球球队
             $newa[0]['match_winer'] = $req->matchwiner;//赢球球队
             $newa[0]['update_time'] = time();//更新时间
@@ -246,6 +245,12 @@ class SoccerNoteListController extends Controller
                 'home_half'=>$req->homehalfcorner,
                 'guest_half'=>$req->guesthalfcorner,
             );
+            //最新进球
+            $newa[0]['first_score'] = array(
+                'teamscore'=>$req->firstscore,//最先进球球队
+                'scoretime'=> $req->onescoretime,//进球时间
+                'scoretype'=> $req->firststye,//进球方式
+            );
 
             $model->single_result = json_encode($newa);
             $model->result_flag = 1;

+ 44 - 35
app/Http/Controllers/Api/SettlementController.php

@@ -11,16 +11,17 @@ use App\Lib\Settlement\Adapter\ZqRule;
 use App\Lib\Settlement\SettlementWinFail;
 use  Illuminate\Routing\Controller as Controller;
 use Illuminate\Support\Facades\DB;
-
+use App\Lib\Biz\Sport\WagentProxy;
 
 
 class SettlementController extends Controller
 {
     use RulePlus;
+
     public function index()
     {
         $dd = new ZqRule();
-        dd($dd->bodan(1,2,1));
+        dd($dd->bodan(1, 2, 1));
     }
 
     public function dd()
@@ -33,6 +34,33 @@ class SettlementController extends Controller
     public function debug()
     {
 
+        ///$config = ['name' => 'test1agent', 'key' => 'abcdefg', 'secret' => 'asdfasdfasd', 'domain' => 'http://sports.bocai108.com', 'cachefile' => ''];
+        $config = ['name' => 'test1agent', 'key' => 'abcdefg', 'secret' => 'asdfasdfasd', 'domain' => 'http://www.kaiyou-dev.com'];
+        $proxy = new WagentProxy();
+        $proxy->Init($config);
+
+
+        $ret1 = $proxy->todaycr();
+        print_r($ret1);
+
+
+        //$ret2 = $proxy->caie('onmygod');
+        //print_r($ret2);
+
+
+        exit;
+
+
+        $ret1 = DB::table('mtest')->get();
+        print_r($ret1);
+
+        $new = DB::table('mtest')->insert(['id' => rand(10000, 20000), 'cont' => json_encode(['name' => rand(100, 200), 'age' => rand(10, 30)])]);
+
+
+        echo "asfa";
+        exit;
+
+
         /*
         $pdo = DB::getPdo();
         $mict = microtime(true);
@@ -49,7 +77,6 @@ class SettlementController extends Controller
         */
 
 
-
         /*
             $id = 3 ;
             $obj = new  SettlementWinFail();
@@ -60,30 +87,16 @@ class SettlementController extends Controller
         */
 
 
-        $oida = $this->getIds(1,455,'zq');
-        $swf =  new SettlementOrder();
-        $ret = $swf->reSettlement($oida,1,2,'zq',455);
+        $oida = $this->getIds(1, 455, 'zq');
+        $swf = new SettlementOrder();
+        $ret = $swf->reSettlement($oida, 1, 2, 'zq', 455);
         var_dump($ret);
         echo "<hr/>";
-        echo "cost:" . (microtime(true) - floatval($_SERVER['REQUEST_TIME_FLOAT'])) .' 秒!';
+        echo "cost:" . (microtime(true) - floatval($_SERVER['REQUEST_TIME_FLOAT'])) . ' 秒!';
 
         exit;
 
 
-
-
-
-
-        $cond = '+2.5/3';
-        $cond = '+3/3.5';
-
-        $ret = $this->zq_letball(3,$cond,'xxx');
-        print_r($ret);
-        exit ;
-
-
-
-
         /*
         $rule = new ZqRule();
         $model = DB::table('money_buy_match')->where(['id' => 320])->first();
@@ -96,10 +109,9 @@ class SettlementController extends Controller
         */
 
 
-
         $noticeid = 3592444;
         $matchid = 900;
-        $order_ids = $this->getIds(1, $matchid,'zq');
+        $order_ids = $this->getIds(1, $matchid, 'zq');
 
         $winorfalse = new  SettlementWinFail();
         $ret1 = $winorfalse->doRun($noticeid);
@@ -113,8 +125,6 @@ class SettlementController extends Controller
         exit;
 
 
-
-
         $model = DB::table('st_zq_result')->where(['id' => 1317823])->first();
         echo json_decode($model->corner_ball);
 
@@ -122,29 +132,28 @@ class SettlementController extends Controller
         exit;
 
 
-
     }
 
 
-    private function getIds($type, $match_id, $game_code='')
+    private function getIds($type, $match_id, $game_code = '')
     {
-        $return  = [] ;
+        $return = [];
         if ($type == 1) {
             $ret = DB::table('money_buy_simplex')->where(['match_id' => $match_id])->get();
-            if ($ret){
-                foreach ($ret as $val){
+            if ($ret) {
+                foreach ($ret as $val) {
                     $return[] = $val->order_id;
                 }
             }
             return $return;
-        }else{
-            $ret = DB::table('money_buy_str')->leftJoin('money_buy_match','money_buy_match.batch_id','=','money_buy_str.batch_id')->where(['money_buy_match.match_id'=>$match_id,'money_buy_match.game_code'=>$game_code])->get();
-            if ($ret){
-                foreach ($ret as $val){
+        } else {
+            $ret = DB::table('money_buy_str')->leftJoin('money_buy_match', 'money_buy_match.batch_id', '=', 'money_buy_str.batch_id')->where(['money_buy_match.match_id' => $match_id, 'money_buy_match.game_code' => $game_code])->get();
+            if ($ret) {
+                foreach ($ret as $val) {
                     $return[] = $val->order_id;
                 }
             }
-            return $return ;
+            return $return;
         }
     }
 

+ 17 - 0
app/Lib/Biz/Sport/WagentProxy.php

@@ -124,8 +124,10 @@ class WagentProxy
 
         $url = $domain . '/InApi-index/getToken';
         $tokenTmp = $this->request_post($url, ['wagent_name' => $name, 'wagent_key' => $key, 'wagent_secret' => $secret], 1);
+
         if ($tokenTmp) {
             $tokenData = json_decode($tokenTmp, true);
+
             if (isset($tokenData['status']) && $tokenData['status'] == 1 && isset($tokenData['data']['token']) && ($tokenData['data']['token'] != '')) {
                 $this->writeTokenCache(['ctime' => time(), 'token' => $tokenData['data']['token'], 'domain' => $domain]);
                 $this->token = $tokenData['data']['token'];
@@ -156,6 +158,7 @@ class WagentProxy
 
         $this->configs = ['name' => $name, 'key' => $key, 'secret' => $secret, 'domain' => $domain];
         $this->setCacheFile($cachefile);
+
         return true;
     }
 
@@ -167,11 +170,16 @@ class WagentProxy
             $str .= "&" . $nkey . '=' . $val;
         }
         $param = base64_encode(substr($str, 1));
+        if (empty($this->token)) {
+            throw  new  \Exception("token 不能为空!", 1007);
+        }
+
         $Key = md5($param . $this->token);
 
         if ($arrayRet) {
             return ['url' => $this->domain . $route, 'param' => $param, 'key' => $Key];
         }
+
         $url = $this->domain . $route . '?params=' . $param . '&Key=' . $Key;
 
         return $url;
@@ -184,6 +192,7 @@ class WagentProxy
         if ($this->getToken()) {
             return true;
         }
+
         $this->refreshTokenData($this->configs);
         return true;
     }
@@ -197,11 +206,13 @@ class WagentProxy
         $arrcomm = ['agent' => $this->configs['name'], 'method' => $datas['method']];
         unset ($datas['method']);
         $urlData = $this->makeUrl('/InApi-index/dobusiness', array_merge($datas, $arrcomm), $isPost);
+
         if ($isPost) {
             $ret = $this->request_post($urlData['url'], ['params' => $urlData['param'], 'Key' => $urlData['key']], 1);
         } else {
             $ret = $this->request_post($urlData);
         }
+
         return $ret;
     }
 
@@ -268,6 +279,12 @@ class WagentProxy
         return $this->commfun(['method' => 'gsbrbv', 'vendorid' => $billno, 'isjs' => $isjs]);
     }
 
+    // 3.1 获取用户当天赚钱排行榜 (30分钟缓存)
+    public function todaycr()
+    {
+        return $this->commfun(['method' => 'todaycr']);
+    }
+
 
     //...............
 }

+ 26 - 7
resources/views/sports/sports_notelist.blade.php

@@ -310,16 +310,24 @@
                 <div class="modal-body">
                     <p style="text-align:left;color:#5f7788;">请认真填写赛事结果,将会按照改结果结算</p><br>
                     <div style="text-align:left;">
+                        <div style="display: flex;">
+                            <li>最后进球球队:</li>
+                            <select name="lastscore" id="lastscore">
+                            </select>
+                        </div>
                         <div style="display: flex;">
                             <li>最先进球球队:</li>
                             <select name="firstscore" id="firstscore">
                             </select>
                         </div>
                         <div style="display: flex;">
-                            <li>最后进球球队:</li>
-                            <select name="lastscore" id="lastscore">
+                            <li> 进 &nbsp; 球&nbsp; 方&nbsp;式&nbsp;:</li>
+                            <select name="firststye" id="firststye">
                             </select>
                         </div>
+                        <div style="display: flex;">
+                            <li>最先进球时间:</li><input type="text" id="onescoretime" name="onescoretime" value="" autocomplete="off">分钟
+                        </div>
                         <div style="display: flex;">
                             <li> 获 &nbsp;胜&nbsp; 球&nbsp; 队&nbsp;:</li><input type="text" id="matchwiner" name="matchwiner" value="">
                         </div>
@@ -410,16 +418,26 @@
                     document.getElementById("guestallcorner").value=data[0].corner_ball.guest;
                     document.getElementById("homehalfcorner").value=data[0].corner_ball.home_half;
                     document.getElementById("guesthalfcorner").value=data[0].corner_ball.guest_half;
+                    document.getElementById("onescoretime").value=data[0].first_score.scoretime;//首进球时间
 
-                    firstscore = "<option value='"+ data[0].first_score +"' selected=''> ";
-                    if (data[0].first_score.length>0){
-                        firstscore += data[0].first_score ;
+                    firstscore = "<option value='"+ data[0].first_score.teamscore +"' selected=''> ";
+                    if (data[0].first_score.teamscore.length>0){
+                        firstscore += data[0].first_score.teamscore;
                     }else{
                         firstscore += '请选择最先进球';
                     }
                     firstscore += " </option><option value=" +data[0].home_team + ">" + data[0].home_team + "</option><option value=" +data[0].guest_team + ">" + data[0].guest_team + "</option>";
                     $("#firstscore").html(firstscore);
 
+                    firststye = "<option value='"+ data[0].first_score.scoretype +"' selected=''> ";
+                    if (data[0].first_score.scoretype.length>0){
+                        firststye += data[0].first_score.scoretype;
+                    }else{
+                        firststye += '请选择最先进球方式';
+                    }
+                    firststye += " </option><option value='射门'>射门</option><option value='头球'>头球</option><option value='无进球'>无进球</option><option value='点球'>点球</option><option value='任意球'>任意球</option><option value='乌龙球'>乌龙球</option>";
+                    $("#firststye").html(firststye);
+
                     lastscore = "<option value='"+data[0].last_score+"' selected=''>";
                     if (data[0].last_score.length>0){
                         lastscore += data[0].last_score;
@@ -471,6 +489,8 @@
             var did = $("#did").val();
             var qlgame = 2;
             var firstscore = $("#firstscore").val();
+            var onescoretime = $("#onescoretime").val();
+            var firststye = $("#firststye").val();
             var lastscore = $("#lastscore").val();
             var matchwiner = $("#matchwiner").val();
             var homeallcard = $("#homeallcard").val();
@@ -490,9 +510,8 @@
                 type: 'POST',
                 dataType: 'json',
                 url: '/admin/SoccerNoteList/addend',
-                data: {did:did,firstscore:firstscore,lastscore:lastscore,matchwiner:matchwiner,homeallcard:homeallcard,guestallcard:guestallcard,homehalfcard:homehalfcard,guesthalfcard:guesthalfcard,homeallcorner:homeallcorner,guestallcorner:guestallcorner,homehalfcorner:homehalfcorner,guesthalfcorner:guesthalfcorner,home_score:home_score,guest_score:guest_score,u_guest_score:u_guest_score,u_home_score:u_home_score},
+                data: {did:did,firstscore:firstscore,onescoretime:onescoretime,firststye:firststye,lastscore:lastscore,matchwiner:matchwiner,homeallcard:homeallcard,guestallcard:guestallcard,homehalfcard:homehalfcard,guesthalfcard:guesthalfcard,homeallcorner:homeallcorner,guestallcorner:guestallcorner,homehalfcorner:homehalfcorner,guesthalfcorner:guesthalfcorner,home_score:home_score,guest_score:guest_score,u_guest_score:u_guest_score,u_home_score:u_home_score},
                 success: function(data) {
-                    // alert(data);
                     layer.msg(data.msg);
                     location. reload()//刷新当前页面
                 }

+ 48 - 48
resources/views/vip/index.blade.php

@@ -257,51 +257,51 @@
         }
     }, 4000)
 
-    function updateNum() {
-        $.ajax({
-            type: 'get',
-            url: '/admin/money/getNum',
-            data: {},
-            async: false,
-            dataType: 'json',
-            success: function (json) {
-                var val = json.data;
-                // if (liarr['/admin/rgame/egamerecord?type=3'] != 'undefined')
-                //     setNotifyNum(liarr['/admin/rgame/egamerecord?type=3'], val.back);
-                if (liarr['/admin/remittance/index?status=0'] != 'undefined')
-                    setNotifyNum(liarr['/admin/remittance/index?status=0'], val.rimit);
-                if (liarr['/admin/take/index'] != 'undefined')
-                    setNotifyNum(liarr['/admin/take/index'], val.take);
-                if (liarr['/admin/lottery_money_log/index'] != 'undefined')
-                    setNotifyNum(liarr['/admin/lottery_money_log/index'], val.lotteryMoney);
-                if (liarr['/admin/uservip/index'] != 'undefined')
-                    setNotifyNum(liarr['/admin/uservip/index'], val.vip);
-                // if (liarr['/admin/agent/approval'] != 'undefined')
-                //     setNotifyNum(liarr['/admin/agent/approval'], val.agent);
-                // if (liarr['/admin/Index/welcome'] != 'undefined')
-                //     setNotifyNum(liarr['/admin/Index/welcome'], val.msg);
-
-                if (val.rimit > 0) {
-                    if (val.rimit != music.numCount.recharge) {
-                        playMusic('recharge');
-                    }
-
-                }
-                music.numCount.recharge = val.rimit;
-                if (val.take > 0) {
-                    if (val.take != music.numCount.take) {
-                        playMusic('take');
-                    }
-
-                }
-                music.numCount.take = val.take;
-            }
-        });
-    }
+    // function updateNum() {
+    //     $.ajax({
+    //         type: 'get',
+    //         url: '/admin/money/getNum',
+    //         data: {},
+    //         async: false,
+    //         dataType: 'json',
+    //         success: function (json) {
+    //             var val = json.data;
+    //             // if (liarr['/admin/rgame/egamerecord?type=3'] != 'undefined')
+    //             //     setNotifyNum(liarr['/admin/rgame/egamerecord?type=3'], val.back);
+    //             if (liarr['/admin/remittance/index?status=0'] != 'undefined')
+    //                 setNotifyNum(liarr['/admin/remittance/index?status=0'], val.rimit);
+    //             if (liarr['/admin/take/index'] != 'undefined')
+    //                 setNotifyNum(liarr['/admin/take/index'], val.take);
+    //             if (liarr['/admin/lottery_money_log/index'] != 'undefined')
+    //                 setNotifyNum(liarr['/admin/lottery_money_log/index'], val.lotteryMoney);
+    //             if (liarr['/admin/uservip/index'] != 'undefined')
+    //                 setNotifyNum(liarr['/admin/uservip/index'], val.vip);
+    //             // if (liarr['/admin/agent/approval'] != 'undefined')
+    //             //     setNotifyNum(liarr['/admin/agent/approval'], val.agent);
+    //             // if (liarr['/admin/Index/welcome'] != 'undefined')
+    //             //     setNotifyNum(liarr['/admin/Index/welcome'], val.msg);
+
+    //             if (val.rimit > 0) {
+    //                 if (val.rimit != music.numCount.recharge) {
+    //                     playMusic('recharge');
+    //                 }
+
+    //             }
+    //             music.numCount.recharge = val.rimit;
+    //             if (val.take > 0) {
+    //                 if (val.take != music.numCount.take) {
+    //                     playMusic('take');
+    //                 }
+
+    //             }
+    //             music.numCount.take = val.take;
+    //         }
+    //     });
+    // }
 
-    setInterval(function () {
-        updateNum();
-    }, 5000);
+    // setInterval(function () {
+    //     updateNum();
+    // }, 5000);
 
     // function updatem() {
     //     $.ajax({
@@ -318,9 +318,9 @@
     //     });
     // }
 
-    setInterval(function () {
-        updatem();
-    }, 10000);
+    // setInterval(function () {
+    //     updatem();
+    // }, 10000);
 
     $(document).ready(function () {
 
@@ -444,7 +444,7 @@
         updateNum();
     };
     window.onload = function () {
-        updatem();
+        // updatem();
     };
     $.ajax({
         url: '/admin/baseSet/getWebTitle',