public function userappindex(){
$app=M("user_app as app");
$list=$app->field("app.*,cat.Name as catname")->join("left join language_category as cat on app.LanguageID=cat.ID")->select();
$this->assign("list",$list);
$this->display();
$app=M("user_app as app");
$list=$app->field("app.*,cat.Name as catname")->join("left join language_category as cat on app.LanguageID=cat.ID")->select();
$this->assign("list",$list);
$this->display();
}
有user_app父表和language_category子表,分别给父表和子表取一个别名,在field()里面再把其中的一个字段也取一个别名 比如cat.Name as catname。