use thinkpaginatordriverBootstrap;
$page=request()->get('page');
$num = 10; //分页个数
$page = $page ? $page : 1; //当前页
$limit=($page-1)*10;
$sql = "SELECT * from ywy_call_log a where id in (SELECT max(id) from ywy_call_log group by user_id,shop_id ) LIMIT {$limit},{$num}";
$count_sql = "SELECT * from ".config('database.prefix')."call_log a where id in (SELECT max(id) from ywy_call_log group by user_id,shop_id )";
$back = Db::query($sql);
$count_back = Db::query($count_sql);
$count = count($back);
$need = Bootstrap::make($back, $num, $page, $count, false, ['path' => Bootstrap::getCurrentPath(), 'query' => request()->param()]);