1.在cmd中切换到根目录下输入以下语句 php think make:model student 红色为想要创建的数据库表
以上表示创建成功
2.在控制器Controller下要使用的文件目录中添加use app\model\student;
3.添加后直接可以使用模型model,输入model语句格式如下
$select1=Student::whereRaw('id<10 AND status="健康"')->select();
dump($select1);
4.模型model页面运行结果