public function where($where, $parse = null) { if (!isset($where["deleted"])) { if ($this->fields["_type"]["deleted"] and !$this->excludeDeletedMap) { if (!is_array($where)) { $tmp = explode("=", $where); $where = array(); $where[$tmp[0]] = $tmp[1]; } $where["deleted"] = "0"; } } return parent::where($where, $parse); }
public function update() { if (!IS_POST) { $this->message2('非法操作!', __APP__ . '/Admin'); } $id = I('id', NULL); if (!empty($id)) { $model = new AdvModel(); $adv = $model->where('id=' . $id)->find(); $data = $model->create(); if (false !== $model->save()) { $this->message('编辑成功', __URL__ . '/index'); } else { $this->message('编辑失败:' . $model->getError(), __URL__ . '/index'); } } else { $this->message('请选择编辑对象', __URL__ . '/index'); } }