thinkphp:M()和D()的比较

发布时间:2016-04-20 14:28:26编辑:丝画阁阅读(532)

D('category')执行时.

SQL: SHOW COLUMNS FROM `yzj_category` [ RunTime:0.0170s ]
SQL: SHOW COLUMNS FROM `yzj_category` [ RunTime:0.0140s ]


M('category')执行时.

SQL: SHOW COLUMNS FROM `yzj_category` [ RunTime:0.0180s ]


为什么?


2016-04-20

查看代码发现如果先M('category'),再D('category'),就会执行两次.

SQL: SHOW COLUMNS FROM `yzj_category` [ RunTime:0.0170s ]
SQL: SHOW COLUMNS FROM `yzj_category` [ RunTime:0.0140s ]


是编写代码时的规则问题.

关键字