@@ -39,8 +39,12 @@ public function __construct(protected array $json, protected string $method = 'G
3939
4040 public function handle (bool $ isQueryMany = false , array $ extendData = []): array
4141 {
42+ if (empty ($ extendData )) {
43+ $ extendData = $ this ->json ; //引入原json
44+ }
4245 $ result = [];
4346 foreach ($ this ->json as $ tableName => $ condition ) { //可以优化成协程行为(如果没有依赖赋值的前提下)
47+ if (is_null ($ condition )) continue ;
4448 if (in_array ($ tableName , $ this ->filterKey ())) {
4549 $ this ->tagColumn [$ tableName ] = $ condition ;
4650 continue ;
@@ -56,9 +60,9 @@ public function handle(bool $isQueryMany = false, array $extendData = []): array
5660 if (str_ends_with ($ tableName , '[] ' )) {
5761 $ isQueryMany = true ;
5862 }
59- // if (!preg_match("/^[A-Za-z]+$ /", $tableName) || !is_array($condition)) {
60- // continue; //不满足表名规范 跳出不往下执行
61- // }
63+ if (!preg_match ("/^[A-Z].+ / " , $ tableName ) || !is_array ($ condition )) {
64+ continue ; //不满足表名规范 跳出不往下执行
65+ }
6266 $ this ->tableEntities [$ tableName ] = new TableEntity ($ tableName , $ this ->json , $ this ->getGlobalArgs (), array_merge ($ result , $ extendData ));
6367 foreach ($ this ->supMethod as $ methodClass ) {
6468 /** @var AbstractMethod $method */
@@ -93,6 +97,10 @@ protected function handleArray(array $jsonData, array $extendData = []): array
9397 {
9498 $ result = [[]];
9599 foreach ($ jsonData as $ tableName => $ condition ) { //可以优化成协程行为(如果没有依赖赋值的前提下)
100+ if (is_null ($ condition )) continue ;
101+ if (!preg_match ("/^[A-Z].+/ " , $ tableName ) || !is_array ($ condition )) {
102+ continue ; //不满足表名规范 跳出不往下执行
103+ }
96104 foreach ($ result as $ key => $ item ) {
97105 if (in_array ($ tableName , $ this ->filterKey ())) {
98106 $ this ->tagColumn [$ tableName ] = $ condition ;
0 commit comments