File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -841,14 +841,24 @@ protected function getJoinTable($join, &$alias = null)
841
841
if (false !== strpos ($ join , '( ' )) {
842
842
// 使用子查询
843
843
$ table = $ join ;
844
- } elseif (strpos ($ join , ' ' )) {
845
- // 使用别名
846
- list ($ table , $ alias ) = explode (' ' , $ join );
847
844
} else {
848
- $ table = $ join ;
845
+ // 使用别名
846
+ if (strpos ($ join , ' ' )) {
847
+ // 使用别名
848
+ list ($ table , $ alias ) = explode (' ' , $ join );
849
+ } else {
850
+ $ table = $ join ;
851
+ if (false === strpos ($ join , '. ' )) {
852
+ $ alias = $ join ;
853
+ }
854
+ }
855
+
856
+ if ($ this ->prefix && false === strpos ($ table , '. ' ) && 0 !== strpos ($ table , $ this ->prefix )) {
857
+ $ table = $ this ->getTable ($ table );
858
+ }
849
859
}
850
860
851
- if (isset ($ alias ) && $ table != $ alias ) {
861
+ if (! empty ($ alias ) && $ table != $ alias ) {
852
862
$ table = [$ table => $ alias ];
853
863
}
854
864
You can’t perform that action at this time.
0 commit comments