Ver Fonte

追加推送 5/27

彭俊 há 6 anos atrás
pai
commit
0195e4833c

+ 3 - 3
Application/Api/Controller/UserBuy.php

@@ -175,7 +175,7 @@ class UserBuy extends BaseController {
     public function index() {
         $code = 0;
         $msg = lang('Common','Api') -> get('error');
-        /*try{*/
+        try{
             $MoneyBuyModel = new MoneyBuy();
             // 数据获取
             $result = $MoneyBuyModel -> monthRecord();
@@ -183,9 +183,9 @@ class UserBuy extends BaseController {
             $msg = lang('Index','Api') -> get('success');
 
             Render($result, $code, $msg);
-        /*} catch (Exception $e) {
+        } catch (Exception $e) {
             Render([], $code, $msg);
             //Render([], $code, $e->getMessage());
-        }*/
+        }
     }
 }

+ 4 - 2
Application/Api/Model/MoneyBuy.php

@@ -331,8 +331,6 @@ class MoneyBuy extends Model {
      */
     public function moneyRecord()
     {
-        /*$moneyRecord = lm('Money_buy_simplex', "commons");
-        $moneyRecord->aa();*/
         // 获取用户信息
         $accountManagerClass = new AccountManager;
         $userInfo = $accountManagerClass -> getCurrentUser();
@@ -343,6 +341,10 @@ class MoneyBuy extends Model {
         // 用户ID
         $moneyRecordWhere['account_identity'] = $userInfo['identity'];
         $moneyRecordWhere['status'] = 1;
+        $moneyRecordWhere['settle_status'] = 2;
+        if (empty($_POST['result']) === false) {
+            $moneyRecordWhere['game_status'] = empty($_POST['result']);
+        }
         // 时间区间
         $startTime = isset($_POST['startTime'])? $_POST['startTime'] : '1900-01-01 00:00:00';
         $endTime = isset($_POST['endTime'])? $_POST['endTime'] : '3000-12-12 00:00:00';

+ 3 - 1
Application/Commons/Model/Money_buy_match.php

@@ -28,7 +28,9 @@ class Money_buy_match extends Model {
     public function moneyBuyMatch($select, $where = '', $orWhere = '', $begin = '', $pageSize = '', $orderBy = ['batch_id' => 'desc']) {
         // 查询字段
         $result = $this -> select($select)
-                -> join('st_odds_code', 'money_buy_match.odds_code', 'st_odds_code.odds_code');
+        ->join('st_odds_code', function ($join) {
+            $join->on('money_buy_match.odds_code', '=','st_odds_code.odds_code')->on('money_buy_match.game_code', '=','st_odds_code.game_code');
+        });
         // 查询条件
         if (!empty($where)) {
             $result = $result -> where($where);

+ 1 - 1
Application/Commons/Model/Money_buy_simplex.php

@@ -86,7 +86,7 @@ class Money_buy_simplex extends Model {
      * @return array JsonString
      */
     public function winLoseRecord($where, $between, $begin = '', $pageSize = '') {
-        $select = ['money_time', 'gain_money', 'money'];
+        $select = ['money_time', 'gain_money', 'money', 'order_id'];
         $mnyBuyStrMdl = lm('Money_buy_str', "commons");
         $mnyBuyStrSql = $mnyBuyStrMdl->select($select)->where($where);
         $mnyBuySpxSql = $this

+ 25 - 4
Application/Sports/Controller/MatchListWeb.php

@@ -70,6 +70,25 @@ class MatchListWeb extends Controller{
         }
 
         $game = lm('GameType', 'Sports')->select('game_code')->where('status',1)->get()->toArray();
+//        $gameData = [];
+//        foreach ($game as $k=>$v){
+//            if($v['game_code'] !='gj'){
+//                $where = $this->commonFunction->getState($type);
+//                $models = $this->commonFunction->getModels($v['game_code'],1);
+//                $matchNum = lm($models['model_league'],"Sports")
+//                    ->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.lg_id')
+//                    ->where($models['model_match'].'.source',$this->source['source'])
+//                    ->where($where)
+//                    ->count("*");
+//                //获取满足状态的球类
+//                if($matchNum != 0){
+//                    $gameData[$v['game_code']] = $matchNum;
+//                }
+//            }
+//        }
+//        $gameData['all_num'] = array_sum($gameData);
+//        $data[] = $gameData;
+//        Render($data, '1', lang('Tips','Sports')->get('success'));
         $gameData = [];
         foreach ($game as $k=>$v){
             if($v['game_code'] !='gj'){
@@ -82,13 +101,15 @@ class MatchListWeb extends Controller{
                     ->count("*");
                 //获取满足状态的球类
                 if($matchNum != 0){
-                    $gameData[$v['game_code']] = $matchNum;
+                    $gameData[$k]['game_code'] = $v['game_code'];
+                    $gameData[$k]['game_num'] = $matchNum;
                 }
             }
         }
-        $gameData['all_num'] = array_sum($gameData);
-        $data[] = $gameData;
-        Render($data, '1', lang('Tips','Sports')->get('success'));
+        sort($gameData);
+        $gameData[]['all_num'] = array_sum($gameData);
+
+        Render($gameData, '1', lang('Tips','Sports')->get('success'));
     }
     //获取非滚球数据
     public function Other($type,$game_code,$p_code){

+ 1 - 1
Application/Sports/Controller/WriteSports.php

@@ -92,7 +92,7 @@ class WriteSports extends Controller{
         $set_lg['country_id'] = $belong['country_id'];
 
         //查询中间表 是否已记录
-        $g_id = lm($model['model_local_league'],'Sports')
+        $lg_id = lm($model['model_local_league'],'Sports')
             ->select('lg_id')
             ->where(['others_lg_id'=>$data['lg_id'],'source'=>$data['source']])
             ->first()->lg_id;