@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | |
28 | 28 | $query = ("DELETE rla FROM " . static::$table_relations . " rla ") . |
29 | 29 | |
30 | - ("JOIN " . static::$table_relations . " rlb ON rlb.descendant = rla.descendant ") . |
|
30 | + ("JOIN " . static::$table_relations . " rlb ON rlb.descendant = rla.descendant ") . |
|
31 | 31 | |
32 | - ("LEFT JOIN " . static::$table_relations . " rlx ") . |
|
32 | + ("LEFT JOIN " . static::$table_relations . " rlx ") . |
|
33 | 33 | |
34 | - ("ON rlx.ancestor = rlb.ancestor AND rlx.descendant = rla.ancestor ") . |
|
34 | + ("ON rlx.ancestor = rlb.ancestor AND rlx.descendant = rla.ancestor ") . |
|
35 | 35 | |
36 | - ("WHERE rlb.ancestor = " . $this->id . " AND rlx.ancestor IS NULL"); |
|
36 | + ("WHERE rlb.ancestor = " . $this->id . " AND rlx.ancestor IS NULL"); |
|
37 | 37 | |
38 | 38 | if (!(DB::send($query) && DB::last()->status)) return false; |
39 | 39 | |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | |
53 | 53 | $query = ("INSERT INTO " . static::$table_relations . " (ancestor, descendant, depth) ") . |
54 | 54 | |
55 | - ("SELECT sup.ancestor, sub.descendant, sup.depth + sub.depth + 1 ") . |
|
55 | + ("SELECT sup.ancestor, sub.descendant, sup.depth + sub.depth + 1 ") . |
|
56 | 56 | |
57 | - ("FROM " . static::$table_relations . " sup ") . |
|
57 | + ("FROM " . static::$table_relations . " sup ") . |
|
58 | 58 | |
59 | - ("JOIN " . static::$table_relations . " sub ") . |
|
59 | + ("JOIN " . static::$table_relations . " sub ") . |
|
60 | 60 | |
61 | - ("WHERE sub.ancestor = " . $this->id . " AND sup.descendant = " . $parent_id); |
|
61 | + ("WHERE sub.ancestor = " . $this->id . " AND sup.descendant = " . $parent_id); |
|
62 | 62 | |
63 | 63 | if (!(DB::send($query) && DB::last()->status)) return false; |
64 | 64 |