我在Model里有两个类文件,分别为A.php和B.php
其中A.php 是连接的数据库模型文件
在B.php中引用了A文件
try {
$temp = A::where('username', '测试')->findOrFail();
//处理事件
A::update($temp);
}catch(\Exception $e){
$temp = [
//数据
]
A::create($temp);
}
我的问题是,数据库明明可以查询到相应的数据,为什么还会跳转到catch里执行创建新数据了呢