tp5常用函数

//基础
$this->request->Post()//获取所有表单数据
//模型
protected $name = 'user';//定义表名
protected $field = true;//开启过滤数据库没有的字段
//关联表
hasone('关联模型名','关联表的外键ID','当前关联表的ID');
belongTo('关联模型名','关联表的外键ID','当前关联表的ID');
//插入数据
//hasone与belongTo区别hasone是没有关联两个表的外键时使用,belongTo时有关联两个表的外键时使用

猜你喜欢

转载自www.cnblogs.com/notesbooks/p/9346434.html
tp5
今日推荐