原生sql操作:
Db::query('select * from think_user where id=?',[8]);
user模型
namespace appindexmodel;
use thinkModel;
class User extends Model{
public function profile(){
return $this->hasOne('Profile');
}
}
然后在控制器怎么
用原生查询关联模型??
原生sql操作:
Db::query('select * from think_user where id=?',[8]);
user模型
namespace appindexmodel;
use thinkModel;
class User extends Model{
public function profile(){
return $this->hasOne('Profile');
}
}
然后在控制器怎么
用原生查询关联模型??