eloquent

//建立一个模型

1.如果表名 和模型名字不符合 或者 主键不是ID 就要定义变量

2.timestamps 表中会有created_time 和 update_time 字段

3. 调用created_time 时  asDateTime 会返回日期data格式

4.getDateFormat 返回时间戳


5.指定是否允许批量赋值的字段



6.firstOrCreate

//如果没有查找的字段就创建一个

Table::firstOrCreate(['name'=>'ss'];

猜你喜欢

转载自blog.csdn.net/qq_33323831/article/details/80548319
今日推荐