作者:珈岩夏17_963 | 来源:互联网 | 2018-03-23 10:14
php代码
//万能单条件查询函数,由lisan制作
//函数代码请放于位于项目目录下Common/Common.php中
function Getx2x($table,$fields,$id,$str){
$aa=M($table);
if(empty($str)){
$expression='getByid';
}else{
$expression='getBy'.$str;
}
$thisaa=$aa->field($fields)->$expression($id);
$bb=explode(',',$fields);
if(count($bb)<=1){
return $thisaa[$fields];
}else{
return $thisaa;
}
}