Browse Source

電話驗證拿掉 -

kyle 2 years ago
parent
commit
88b7b286fb
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      app/Rules/RegionLimitedRules.php

+ 6
- 6
app/Rules/RegionLimitedRules.php View File

8
 class RegionLimitedRules implements Rule, DataAwareRule
8
 class RegionLimitedRules implements Rule, DataAwareRule
9
 {
9
 {
10
     protected $data = [];
10
     protected $data = [];
11
-    
11
+
12
     /**
12
     /**
13
      * Create a new rule instance.
13
      * Create a new rule instance.
14
      *
14
      *
30
     {
30
     {
31
         //
31
         //
32
         if (substr($value, 0, 2)=='TP'||substr($value, 0, 2)=='HS') {
32
         if (substr($value, 0, 2)=='TP'||substr($value, 0, 2)=='HS') {
33
-            
33
+
34
             if (is_null($this->data['registeredSession'])) {
34
             if (is_null($this->data['registeredSession'])) {
35
                 return false;
35
                 return false;
36
             }
36
             }
37
-            
37
+
38
             if (is_null($this->data['lunchOptions'])) {
38
             if (is_null($this->data['lunchOptions'])) {
39
                 return false;
39
                 return false;
40
             }
40
             }
41
 
41
 
42
-            $pattern = '/09\d{2}-\d{3}-\d{3}/';
42
+            $pattern = '/09\d{2}\d{3}\d{3}/';
43
             $string = $this->data['phoneNumber'];
43
             $string = $this->data['phoneNumber'];
44
             if (!preg_match($pattern, $string, $matches)) {
44
             if (!preg_match($pattern, $string, $matches)) {
45
                 return false;
45
                 return false;
46
             }
46
             }
47
-            
47
+
48
         } elseif (substr($value, 0, 2)=='JP') {
48
         } elseif (substr($value, 0, 2)=='JP') {
49
 
49
 
50
             $pattern = '/^0[789]0-\d{4}-\d{4}/';
50
             $pattern = '/^0[789]0-\d{4}-\d{4}/';
72
     public function setData($data)
72
     public function setData($data)
73
     {
73
     {
74
         $this->data = $data;
74
         $this->data = $data;
75
- 
75
+
76
         return $this;
76
         return $this;
77
     }
77
     }
78
 
78