Ver Fonte

异常处理

彭俊 há 6 anos atrás
pai
commit
19aeddac60
1 ficheiros alterados com 51 adições e 6 exclusões
  1. 51 6
      app/Models/SportsNoteList.php

+ 51 - 6
app/Models/SportsNoteList.php

@@ -131,14 +131,37 @@ class SportsNoteList extends BaseModel
            //money_match_time
 
             //追加输赢结果 /投注详情
-            $v->content = $this->getOrderC($content,$v);
+            $contentData = $this->getOrderC($content,$v);
+            $v->content = $contentData['content'];
             
             //未作废/撤单 数据
             if($v->status < 2){
                 //反水
                 $v->water_return = commonFunction::filter_by_value($water_return_money,'trade_id',$v->order_id)['money'];
-                //结果金额  反水+中奖金额
-                $v->result = $v->water_return + $v->gain_money;
+                //根据输赢 拼接结果金额  
+                //默认 结果为反水
+                // dd($v);
+                $v->result = $v->water_return;
+                if($contentData['result'] == '赢'){
+                    //反水+实际中奖金额
+                    $v->result = $v->water_return + $v->gain_money;
+                }
+                if($contentData['result'] == '赢半平半'){
+                    //投注金额+投注金额的1/2*赔率+返水
+                    $v->result = $v->water_return + ($v->gain_money/2);
+                }
+                if($contentData['result'] == '输半平半'){
+                    //投注金额的1/2+返水
+                    $v->result = $v->water_return + ($v->money/2);
+                }
+                if($contentData['result'] == '平'){
+                    //投注金额
+                    $v->result = $v->money;
+                }
+                if($contentData['result'] == '输'){
+                    //投注金额
+                    $v->result = $v->water_return;
+                }
 
                 //用户投注前账户金额
                 $v->available_cash = number_format(($v->money_cash + $v->money),2);
@@ -232,6 +255,8 @@ class SportsNoteList extends BaseModel
         if ($content_str['result'] == 4) {
             $content_str['result'] = '输半平半';
         }
+
+        /*
         //普通赛事注单 详情
         if($order->is_champion == 0){
             if ($content_str['result'] == '未处理' || $order->status > 1) {
@@ -241,7 +266,7 @@ class SportsNoteList extends BaseModel
                 $content = $content1.$content_str['content']. '<span>' . $content_str['result'] . '</span>(' . $content_str['matchresult'] . ')<br>';
             }
         }
-        //冠军联赛 注单
+        //冠军联赛注单 详情
         else{
             if ($content_str['result'] == '未处理' || $order->status > 1) {
                 $content = $content_str['home_team'] . '<br>' . $order->content . $content_str['odds_code'] . '<br>' . $content_str['condition'] . ' ' . $order->team . '@' . $content_str['odds'] . ' ¥' . $content_str['bet_money'] . '<br>';
@@ -249,9 +274,29 @@ class SportsNoteList extends BaseModel
                 $content = $content_str['home_team'] . '<br>' . $order->content . $content_str['odds_code'] . '<br>' . $content_str['condition'] . ' ' . $order->team . '@' . $content_str['odds'] . ' ¥' . $content_str['bet_money'] . '<br><span>' . $content_str['result'] . '</span>(' . $content_str['matchresult'] . ')<br>';
             }
         }
-       
-
         return $content;
+        */
+
+         //普通赛事注单 详情
+         if($order->is_champion == 0){
+            if ($content_str['result'] == '未处理' || $order->status > 1) {
+                $content_str['content'] = $content1.$content_str['content'];
+            }
+            else if($order->status == 1) {
+                $content_str['content'] = $content1.$content_str['content']. '<span>' . $content_str['result'] . '</span>(' . $content_str['matchresult'] . ')<br>';
+            }
+        }
+        //冠军联赛注单 详情
+        else{
+            if ($content_str['result'] == '未处理' || $order->status > 1) {
+                $content_str['content'] = $content_str['home_team'] . '<br>' . $order->content . $content_str['odds_code'] . '<br>' . $content_str['condition'] . ' ' . $order->team . '@' . $content_str['odds'] . ' ¥' . $content_str['bet_money'] . '<br>';
+            } else {
+                $content_str['content'] = $content_str['home_team'] . '<br>' . $order->content . $content_str['odds_code'] . '<br>' . $content_str['condition'] . ' ' . $order->team . '@' . $content_str['odds'] . ' ¥' . $content_str['bet_money'] . '<br><span>' . $content_str['result'] . '</span>(' . $content_str['matchresult'] . ')<br>';
+            }
+        }
+
+    
+        return $content_str;
     }