Coder Social home page Coder Social logo

Comments (6)

billge1205 avatar billge1205 commented on May 1, 2024

可能是你DAO对象没有配置pk字段导致的 参考下面这个例子
// testDAO.php 与类名保持一致
class testDAO extends baseDAO
{
// 表名
protected $table = 'Biny_Test';
// 键值 多键值用数组表示:['id', 'type']
protected $_pk = 'id';
}
http://www.billge.cc/#dao

from biny.

hecomlilong avatar hecomlilong commented on May 1, 2024

应该不是这个原因,我确定是设了pk了,而且TXCond中的where字段已经是"id=1"了。

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

我不确定是不是开发环境导致的
你可以尝试下直接用 $this->clientDAO->filter(['id'=>1])->update(['del'=>1]) 的形式,看看能不能成功
updateByPK 本质上也是走了上面这个方法 只是多了一层缓存的处理

from biny.

hecomlilong avatar hecomlilong commented on May 1, 2024

我用command函数了,不过得自己拼字符串啦。$this->DAO->filter(['id' => $id])->command("UPDATE :table SET $sets WHERE :where;");

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

不是很建议这么使用 毕竟会有sql注入的风险
我刚在mac上用php7.0.23 上是可以正常使用的
我晚些用docker模拟下你的运行环境调试下看看

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

不好意思 没有调试出来这个问题 而且command方法也同样用到了 func_get_args() 来获取TXCond对象 感觉应该不是这个方法导致的 如果有进一步的发现麻烦联系我 谢谢

from biny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.