无主键表使用model->destroy()问题

浏览:830 发布日期:2016/12/01 分类:技术分享 关键字: model destroy
我又来填坑了。

option打印出来后where条件会丢失</pre><pre>array(17) {
  ["table"] => string(17) "pp_event_guardian"
  ["where"] => array(0) {
  }
  ["field"] => string(1) "*"
  ["strict"] => bool(true)
  ["master"] => bool(false)
  ["lock"] => bool(false)
  ["fetch_class"] => bool(false)
  ["fetch_sql"] => bool(false)
  ["distinct"] => bool(false)
  ["join"] => string(0) ""
  ["union"] => string(0) ""
  ["group"] => string(0) ""
  ["having"] => string(0) ""
  ["limit"] => string(0) ""
  ["order"] => string(0) ""
  ["force"] => string(0) ""
  ["comment"] => string(0) ""
}
提示'delete without condition'
需要在模型中自定义一个字段为主键protected $pk = 'event_id';
就可以正常删除了
最佳答案
评论( 相关
后面还有条评论,点击查看>>