THINKPHP5.0 paginate count

problem description

because there are too many queries, the paginate page that comes with TP5.0 will execute a count sql, when querying. How to specify this sql when using paginate in model

related codes

/ / Please paste the code text below (do not replace the code with pictures)
$paginate = config ("paginate");

    $paginate["sql"] = "SELECT count(*) FROM `user`";
    config("paginate", $paginate);
    return $this->alias("u")
        ->field($field)
        ->join("vehicle v","u.user_id = v.user_id and v.is_delete = 1","left")
        ->join("ncd_user_wealth w","u.user_id = w.uid","left")
        ->where($map)
        ->group("u.user_id")
        ->order("u.user_id desc")
        ->paginate();

clipboard.png

what result do you expect? What is the error message actually seen?

how to replace sql, in a picture with SELECT count (*) FROM user to execute

Php
Mar.27,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaa421-47d96.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaa421-47d96.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?