Call to a member function join() on a non-object

浏览:524 发布日期:2017/12/24 分类:求助交流 关键字: thinkphp3.2版本


【代码】:
public function getUserRoles($userName)
{
$table = M('user');
$where['username'] = $userName;
//self::__construct();

//Call to a member function join() on a non-object
$data = $Model
->join('smatrix_user ON smatrix_user_role.userid = smatrix_user.id')//指定的数据表必须是全称
->join('smatrix_role ON smatrix_user_role.roleid = smatrix_role.id')
->field('smatrix_user.*')
->select();

return $data;
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>