Explorar o código

提交极速游戏

lip hai 2 semanas
pai
achega
cbcceb2e13
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      app/Http/Controllers/admin/JisuLottery.php

+ 9 - 0
app/Http/Controllers/admin/JisuLottery.php

@@ -83,6 +83,15 @@ class JisuLottery extends Controller
             if (!empty($info->advance_code)) {
                 throw new Exception('已设置');
             }
+            if ($info->type == 2) {
+                if (count($params['advance_code']) != 5) {
+                    throw new Exception('开奖号码必须是5个数');
+                }
+            } else {
+                if (count($params['advance_code']) != 10) {
+                    throw new Exception('开奖号码必须是10个数');
+                }
+            }
             $info->advance_code = implode(",",$params['advance_code']);
             $info->save();
             return $this->success();