|
|
@@ -89,7 +89,7 @@ class IssueService extends BaseService
|
|
|
return ['total' => $paginator->total(), 'data' => $paginator->items()];
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* @description:
|
|
|
* @param {*} $params
|
|
|
* @return {*}
|
|
|
@@ -127,6 +127,48 @@ class IssueService extends BaseService
|
|
|
return $msg;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description: 开始下注
|
|
|
+ * @param {*} $id
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function betting($id)
|
|
|
+ {
|
|
|
+ $info = self::findOne(['id'=>$id]);
|
|
|
+ if(!$info){
|
|
|
+ return ['code'=>self::NOT, 'msg'=>'期号不存在'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!in_array($info->status, [self::model()::STATUS_DRAFT,self::model()::STATUS_BETTING])){
|
|
|
+ return ['code'=>self::NOT, 'msg'=>'期号状态不正确'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $info->status = self::model()::STATUS_BETTING;
|
|
|
+ $info->save();
|
|
|
+ return ['code'=>self::YES, 'msg'=>'开始下注'];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 封盘
|
|
|
+ * @param {*} $id
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function closeBetting($id)
|
|
|
+ {
|
|
|
+ $info = self::findOne(['id'=>$id]);
|
|
|
+ if(!$info){
|
|
|
+ return ['code'=>self::NOT, 'msg'=>'期号不存在'];
|
|
|
+ }
|
|
|
+
|
|
|
+ if($info->status != self::model()::STATUS_BETTING){
|
|
|
+ return ['code'=>self::NOT, 'msg'=>'期号状态不正确'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $info->status = self::model()::STATUS_CLOSED;
|
|
|
+ $info->save();
|
|
|
+ return ['code'=>self::YES, 'msg'=>'封盘成功'];
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @description: 获取中奖的奖项
|
|
|
* @param {*} $winning_numbers
|