![](https://box.kancloud.cn/e65f23a169a733e482b072f8b325333b_914x532.png)
[字段名称存在大写字母时候],尽量采用闭包查询:
用例:orderId
~~~
//更新验证及发放状态
//
$record = Verify::get(function ($query) use ($transaction_id) {
$query->where('orderId', $transaction_id);
});
~~~
下面是错误的写法:
~~~
//更新验证及发放状态
//
$record = Verify::getByOrderId($transaction_id);
~~~
因为驼峰字段的字符串将会被自动转换成下划线:
~~~
SELECT * FROM `Verify` WHERE `order_id` = '1000000383771410';
~~~