function getRandTable($nums, $tables, array $where = null)
{
$num = $nums;
$table = $tables;
$pk = $this->app->db->name("$table")->getPk();
$countcus = $this->app->db->name("$table")->where($where)->field($pk)->select();
$con = '';
foreach ($countcus as $v => $val) {
$con .= $val[$pk] . '|';
}
$array = explode("|", $con);
$data = [];
foreach ($array as $v) {
if (!empty($v)) {
$data[$v] = $v;
};
}
$a = array_rand($data, $num);
$list = $this->app->db->name("$table")->where($pk, 'in', $a)->select()->toArray();
return $list;
}