From 69c982b3e9cef63ef4fa758a15a15bad9e6d3b7c Mon Sep 17 00:00:00 2001 From: kj Date: Thu, 3 Dec 2020 11:13:30 -0400 Subject: [PATCH] Fix join orden on query. --- src/Libs/ModelMySQL.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Libs/ModelMySQL.php b/src/Libs/ModelMySQL.php index da80f51..f66c9d3 100644 --- a/src/Libs/ModelMySQL.php +++ b/src/Libs/ModelMySQL.php @@ -112,6 +112,10 @@ class ModelMySQL { } else { $sql .= ' FROM '.static::table(); } + + if(static::$querySelect['innerJoin'] != '') { + $sql .= static::$querySelect['innerJoin']; + } if (static::$querySelect['leftJoin'] != '') { $sql .= static::$querySelect['leftJoin']; @@ -121,10 +125,6 @@ class ModelMySQL { $sql .= static::$querySelect['rightJoin']; } - if(static::$querySelect['innerJoin'] != '') { - $sql .= static::$querySelect['innerJoin']; - } - if (static::$querySelect['where'] != '') { $sql .= ' WHERE '.static::$querySelect['where'];