|
@@ -241,5 +241,43 @@ class BetService extends BaseService
|
|
return $msg;
|
|
return $msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @description: 当期下注
|
|
|
|
+ * @param {*} $memberId
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ public static function currentBet($memberId)
|
|
|
|
+ {
|
|
|
|
+ $msg['chat_id'] = $memberId;
|
|
|
|
+ // 期数验证
|
|
|
|
+ $issueInfo = IssueService::model()::where('status',IssueService::model()::STATUS_BETTING)->orderBy('id','desc')->first();
|
|
|
|
+ if(!empty($issueInfo)){
|
|
|
|
+ $issue_no = $issueInfo->issue_no;
|
|
|
|
+ }else{
|
|
|
|
+ $issueCloseInfo = IssueService::model()::where('status',IssueService::model()::STATUS_CLOSE)->orderBy('id','desc')->first();
|
|
|
|
+ if(empty($issueCloseInfo)){
|
|
|
|
+ $issue_no = $issueCloseInfo->issue_no;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($issue_no){
|
|
|
|
+ $text = "当前期号:{$issue_no}";
|
|
|
|
+ $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";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $text .= "\n";
|
|
|
|
+ $text .= "----------\n";
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ $msg['text'] = "当前没有开放的投注期数! \n";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|