Home  >  Article  >  Backend Development  >  Is the thinkphp statistics problem a miracle or a problem with my code? .

Is the thinkphp statistics problem a miracle or a problem with my code? .

PHP中文网
PHP中文网Original
2016-08-10 09:07:211100browse

thinkphp statistics problem is it a miracle or a problem with my code. .

Is the thinkphp statistics problem a miracle or a problem with my code? .

Is the thinkphp statistics problem a miracle or a problem with my code? .

Reply content:


This has nothing to do with TP, it is a problem with SQL - you have grouped, and count counts the number of rows in each group...

You can use fetchSql to fetch the SQL, and then try to execute it in the database yourself.


Dear, this is normal, it’s not some magic and your code is fine. If you use the framework method to see sql, there is no big difference. You can output sql and take a look, and you will find that you are thinking too much. Everything works fine


should be 102 records that meet the conditions with 20 unique uids.

The above is the statistics problem of thinkphp. Is it a miracle or a problem with my code? . For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn