Skip to content

Table name can not use the alias #831

Description

@jinmarcus
        $lists = $this->db->table('role as r')
                          ->select('r.name, u.username')
                          ->join('user as u', 'u.id = r.id')
                          ->where([
                              'r.status' => 1
                          ])
                          ->get()
                          ->getResult();

Table name can not use the alias
Wrong

print sql :

SELECT `hero_r`.`name`, `hero_u`.`username`
FROM `hero_role` as `r`
JOIN `hero_user` as `u` ON `hero_u`.`id` = `hero_r`.`id`
WHERE `hero_r`.`status` = 1

"hero_" is DBPrefix

I find system\Database\BaseConnection.php
in 1089 line
$this->qb_aliased_tables Should it be $this->QBAliasedTables ?

but I don't know how to go to fixed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions