@@ -98,14 +98,14 @@ |
||
98 | 98 | ?string $alias = null |
99 | 99 | ): Builder { |
100 | 100 | $reactionType = ReactionType::fromName($reactionTypeName); |
101 | - $alias = is_null($alias) ? strtolower($reactionType->getName()) . '_reactions': $alias; |
|
101 | + $alias = is_null($alias) ? strtolower($reactionType->getName()) . '_reactions' : $alias; |
|
102 | 102 | |
103 | 103 | $select = $query->getQuery()->columns ?? ["{$this->getTable()}.*"]; |
104 | 104 | $select[] = DB::raw("COALESCE({$alias}.count, 0) as {$alias}_count"); |
105 | 105 | $select[] = DB::raw("COALESCE({$alias}.weight, 0) as {$alias}_weight"); |
106 | 106 | |
107 | 107 | return $query |
108 | - ->leftJoin((new ReactionCounter())->getTable() . ' as '. $alias, function (JoinClause $join) use ($reactionType, $alias) { |
|
108 | + ->leftJoin((new ReactionCounter())->getTable() . ' as ' . $alias, function (JoinClause $join) use ($reactionType, $alias) { |
|
109 | 109 | $join->on("{$alias}.reactant_id", '=', "{$this->getTable()}.love_reactant_id"); |
110 | 110 | $join->where("{$alias}.reaction_type_id", $reactionType->getId()); |
111 | 111 | }) |