标签:model orm select bsp cti mod count color fun
此处以Model::get()方法和Model::first()方法为例
public static function get($data=[]){//默认是空数组 if(count($data)==0){
$this->getAll();
}else{
$this->getSelect($data);
} }
public function getAll(){
$sql="select * form".$this->tables
$this->dao->getAll($sql);
}
1 public function getSelect($data){
$column=implode(‘,‘$data);
$sql=‘select‘.$column.‘form‘.$this->table;
$this->dao->getSelect($sql);
2 }
依次类推first方法还是同样的道理
在这里就不一一的叙述了
标签:model orm select bsp cti mod count color fun
原文地址:https://www.cnblogs.com/xsatc5211314/p/9205315.html