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

createOrUpdate 只能依赖主键冲突? #86

Closed sn01615 closed 5 years ago

billge1205 commented 5 years ago

是的 主键冲突再更新的场景实际运用中比较频繁 insert第一个参数内容 当冲突时执行update第二个参数操作(第二个参数缺省等于第一个参数)

sn01615 commented 5 years ago

https://github.com/Tencent/Biny/blob/bb9fd471031c5297a17fdfc36c882f299dd0bda2/app/dao/base/baseDAO.php#L141 这个缓存好像没有过期时间

sn01615 commented 5 years ago

可以加个支持select后update or insert吗?

billge1205 commented 5 years ago

缓存这个可以在db配置中加个缓存时长配置 我晚点支持下

billge1205 commented 5 years ago

select后insert update 可以在业务代码中用事务逻辑自己实现 没必要封装在DAO中哈

sn01615 commented 5 years ago

另外好像都是mysqli的能封装下支持pdo或mysqli吗?

billge1205 commented 5 years ago

可以的 框架早期用的mysql 后来升级成mysqli pdo可以支持下的

sn01615 commented 5 years ago

可以支持orderDesc、orderAsc方法吗?

sn01615 commented 5 years ago

还有order by field()方法

fyfyfyfy11 commented 5 years ago

你能别发了么这就是一个随便传传的东西傻子都知道一堆错------------------ 原始邮件 ------------------ 发件人: "杨龙"notifications@github.com 发送时间: 2019年5月19日(星期天) 晚上9:06 收件人: "Tencent/Biny"Biny@noreply.github.com; 抄送: "Subscribed"subscribed@noreply.github.com; 主题: Re: [Tencent/Biny] createOrUpdate 只能依赖主键冲突? (#86)

可以支持orderDesc、orderAsc方法吗?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

billge1205 commented 5 years ago

已支持order by field() 用法