if ($result = $this->create())
{
$rows = $this->find($id);
if (empty($rows))
{
$result = $this->add();
}
else
{
$result = $this->save();
}
}
添加正常,更新却不正常,经检查是因为find方法会给$this->data赋值造成的。代码修改后正常:$rows = $this->find($id);
if ($result = $this->create())
{
if (empty($rows))
{
$result = $this->add();
}
else
{
$result = $this->save();
}
}
最佳答案
