这里并没有采用很多引擎宣扬的级联,个人觉得把目的放最后很有问题,而且用对象相对有幸能损耗。
数据访问方式
DB::table($tableName)->getAll($condition)
DB::table($tableName)->getRow($condition)
DB::table($tableName)->getVal($filed, $condition)
DB::table($tableName)->insert($data)
DB::table($tableName)->update($data, $condition)
DB::table($tableName)->delete($condition)
条件格式
$condition = array(
'field'=>'id, name',
'userId'=>$userId,
'updateTime'=>array('GT', time()),
'state = 1',
'isDelect=0',
'order'=>'id desc'
'limit'=>'1,2'
)