@@ -39,8 +39,12 @@ public function __construct(protected array $json, protected string $method = 'G
39
39
40
40
public function handle (bool $ isQueryMany = false , array $ extendData = []): array
41
41
{
42
+ if (empty ($ extendData )) {
43
+ $ extendData = $ this ->json ; //引入原json
44
+ }
42
45
$ result = [];
43
46
foreach ($ this ->json as $ tableName => $ condition ) { //可以优化成协程行为(如果没有依赖赋值的前提下)
47
+ if (is_null ($ condition )) continue ;
44
48
if (in_array ($ tableName , $ this ->filterKey ())) {
45
49
$ this ->tagColumn [$ tableName ] = $ condition ;
46
50
continue ;
@@ -56,9 +60,9 @@ public function handle(bool $isQueryMany = false, array $extendData = []): array
56
60
if (str_ends_with ($ tableName , '[] ' )) {
57
61
$ isQueryMany = true ;
58
62
}
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
+ }
62
66
$ this ->tableEntities [$ tableName ] = new TableEntity ($ tableName , $ this ->json , $ this ->getGlobalArgs (), array_merge ($ result , $ extendData ));
63
67
foreach ($ this ->supMethod as $ methodClass ) {
64
68
/** @var AbstractMethod $method */
@@ -93,6 +97,10 @@ protected function handleArray(array $jsonData, array $extendData = []): array
93
97
{
94
98
$ result = [[]];
95
99
foreach ($ jsonData as $ tableName => $ condition ) { //可以优化成协程行为(如果没有依赖赋值的前提下)
100
+ if (is_null ($ condition )) continue ;
101
+ if (!preg_match ("/^[A-Z].+/ " , $ tableName ) || !is_array ($ condition )) {
102
+ continue ; //不满足表名规范 跳出不往下执行
103
+ }
96
104
foreach ($ result as $ key => $ item ) {
97
105
if (in_array ($ tableName , $ this ->filterKey ())) {
98
106
$ this ->tagColumn [$ tableName ] = $ condition ;
0 commit comments