Skip to content

Commit 0eb7c36

Browse files
author
ethan
committed
table
1 parent 5cc755b commit 0eb7c36

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Builder.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ public function getConnection()
7979
* @return static
8080
* @throws Exception
8181
*/
82-
public function table($tableName)
82+
public function table($tableName = '')
8383
{
84-
if (strpos($tableName, '{{') === false) {
85-
$tableName = '{{%' . $tableName . '}}';
86-
}
87-
if (!preg_match('/^\{\{%?[\w\-\.\$]+%?\}\}$/', $tableName)) {
88-
throw new Exception('表名错误');
84+
if (!empty($tableName)) {
85+
if (strpos($tableName, '{{') === false) {
86+
$tableName = '{{%' . $tableName . '}}';
87+
}
88+
if (!preg_match('/^\{\{%?[\w\-\.\$]+%?\}\}$/', $tableName)) {
89+
throw new Exception('表名错误');
90+
}
8991
}
9092
$this->table = $tableName;
9193
return $this;

0 commit comments

Comments
 (0)