thinkphp随机获取一条数据
代码
public function getLikeList($catalog_id,$size = 20){
$res = $this
->field('id,title')
->where('catalog_id',$catalog_id)
->orderRaw("RAND()")//随机取
->paginate($size);
return $res;
}