Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 259 forks source link

TXDAO中update和command等方法是否能够增加参数$id以返回影响行数 #33

Closed lordGuan closed 6 years ago

lordGuan commented 6 years ago

因为发现update方法在执行update...where id>0这种语句的时候没法得知是否更新完成,不知增加后是否会有影响

billge1205 commented 6 years ago

谢谢你的建议 下个版本会添加一个配置选项 让用户自定义返回受影响行数 或者 true/false

billge1205 commented 6 years ago

已更新,可以在/config/config.php中修改对应配置来返回受影响行数, 默认false // 数据库相关配置 'database' => array( 'returnIntOrFloat' => true, // 是否返回int或者float类型 'returnAffectedRows' => false, // 是否返回受影响行数,false下返回成功true/失败false, true情况下-1为失败 ),