业务数据如何封装?

#1 spitcold

在控制器中:
function addRecord(){
                $Lesson=spDB("xuexi11_lesson",'id');
                $Lesson->create($this->spArgs());
}

这个操作确实把用户填写的表单项插入数据库了。现在我需要程序自动新增一个字段,用于显示记录产生的时间。
根据教程 是说 在MOdel中新增一个spModel,不要用spDB,然后怎么操作呢?大哥给点提示,谢谢!!!

2011-06-24 22:38:53

#2 azwl

没怎么理解你的意思
是这样吗 :$Lesson->create($this->spArgs()+array('time'=>time()));

2011-06-24 22:53:41

#3 jake

手册中有例子:http://www.speedphp.com/model-override.html

2011-06-25 00:14:43