seven 2 veckor sedan
förälder
incheckning
1a81465439
1 ändrade filer med 20 tillägg och 7 borttagningar
  1. 20 7
      app/Services/BetService.php

+ 20 - 7
app/Services/BetService.php

@@ -453,16 +453,29 @@ class BetService extends BaseService
         }
 
         if ($issue_no) {
-            $text = "当前期号:{$issue_no} \n";
-            $text .= "\n";
-            $text .= "----------\n";
+            $text = "期数{$issue_no} \n";
+            // $text .= "\n";
+            // $text .= "----------\n";
             $list = self::findAll(['member_id' => $memberId, 'issue_no' => $issue_no]);
-            foreach ($list->toArray() as $k => $v) {
-                $text .= "{$v['keywords']}{$v['amount']} \n";
+            $list = $list->toArray();
+            if(empty($list)){
+                $text .= "本期暂未下注! \n";
+            }else{
+                $keywords = implode(',',array_column($list, 'keywords'));
+                $amounts = implode(',',array_column($list, 'amount'));
+
+
+                $text .= "下注类型:[".$keywords."] \n";
+                $text .= "下注金额:".$amounts." \n";
+                $text .= "下注总额:".array_sum(array_column($list, 'amount'))." \n";
+                $text .= "开奖状态:等待开奖 \n";
             }
+            // foreach ($list->toArray() as $k => $v) {
+            //     $text .= "{$v['keywords']}{$v['amount']} \n";
+            // }
 
-            $text .= "\n";
-            $text .= "----------\n";
+            // $text .= "\n";
+            // $text .= "----------\n";
             $msg['text'] = $text;
         } else {
             $msg['text'] = "当前没有开放的投注期数! \n";