2024年1月19日

摘要: 关联模型 namespace app\model; use think\Model; class Users extends Model { // 模型中定义一对一关系的方法 用于建立当前模型与另一个模型之间的关系, 例如: 当前数据表对应的外键表 // abc 自定义方法名 Profile::cl 阅读全文
posted @ 2024-01-19 03:23 完美前端 阅读(21) 评论(0) 推荐(0)
摘要: 数据表 添加外键失败 SQL错误(1452):Cannot add or update a child row: a foreign key constraint 1, 表里已存在的值和关联表不匹配,如表里id为10,关联表没有10 阅读全文
posted @ 2024-01-19 02:44 完美前端 阅读(7) 评论(0) 推荐(0)
摘要: 软删除 namespace app\model; use think\Model; use think\model\concern\SoftDelete; class User extends Model { // 开启软删除 use SoftDelete; // 软删除 给数据标记已删除 但不是真 阅读全文
posted @ 2024-01-19 01:34 完美前端 阅读(114) 评论(0) 推荐(0)

导航