setting model alias definition has no effect =!
Model:
public function cate(){
return $this->hasOne("TestCategory","id","category",["id"=>"category_id","title"=>"category_title"]);
}
Controller:
$books = TestBookModel::get($id);
$books->cate;
dump($books->toarray());
Table: thinkphp_test_book
:thinkphp_test_category
:
:
: