My tables
Category
id_category
name
Post
id_post
category_id
title
My query:
Post::find()
->select('post.*, c.name AS catname')
->leftJoin('category c', 'c.id_category = category_id')
->all();
The output just shown the table fields Post, is not the field catname.