Browse Source

Updated public

north 7 năm trước cách đây
mục cha
commit
dc89bac0b4
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      www/protected/modules/j/models/JCoupon.php

+ 6 - 2
www/protected/modules/j/models/JCoupon.php

@@ -33,9 +33,13 @@ class JCoupon extends MongoAr
     }
 
     function generateRandomString($length = 10) {
-        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+        $characters = '0123456789';//ABCDEFGHIJKLMNOPQRSTUVWXYZ
         $randomString = '';
-        for ($i = 0; $i < $length; $i++) {
+        for ($i = 0; $i < $length/2; $i++) {
+            $randomString .= $characters[rand(0, strlen($characters) - 1)];
+        }
+        $characters = 'abcdefghijklmnopqrstuvwxyz';
+        for ($i = 0; $i < $length/2; $i++) {
             $randomString .= $characters[rand(0, strlen($characters) - 1)];
         }
         return $randomString;