Browse Source

fix():数据库配置与php版本兼容问题

geek 4 years ago
parent
commit
f8ad08f9cc
2 changed files with 3 additions and 3 deletions
  1. 2 2
      application/database.php
  2. 1 1
      thinkphp/library/think/db/Query.php

+ 2 - 2
application/database.php

@@ -13,7 +13,7 @@ return [
     // 数据库类型
     'type'            => 'mysql',
     // 服务器地址
-    'hostname'        => '47.97.122.181',
+    'hostname'        => '127.0.0.1',
 //    'hostname'        => '127.0.0.1',
     // 数据库名
     'database'        => 'xinyi_test',
@@ -21,7 +21,7 @@ return [
     'username'        => 'root',
     // 密码
 //    'password'        => 'xinyimall',//Leoxie,root
-    'password'        => 'xinyimall',//Leoxie,root
+    'password'        => '649114390',//Leoxie,root
 //    'password'        => 'Leoxie',
     // 端口
     'hostport'        => '',

+ 1 - 1
thinkphp/library/think/db/Query.php

@@ -367,7 +367,7 @@ class Query
                         $seq = (ord(substr($type($value), 0, 1)) % $rule['num']) + 1;
                     } else {
                         // 按照字段的首字母的值分表
-                        $seq = (ord($value{0}) % $rule['num']) + 1;
+                        $seq = (ord($value[0]) % $rule['num']) + 1;
                     }
             }
             return $this->getTable() . '_' . $seq;