1:在Thinkphp里面引用第三方类,PHPExcel的时候报错
vendor("PHPExcel.PHPExcel");$objPHPExcel = new PHPExcel();//正确的做法是 $objPHPExcel = new \PHPExcel();//thinkphp 里面使用了命名空间,所以在new的时候要加反斜杠【知其然不知其所以然】
2:有时候数据库查询没结果,想打印出sql语句看看问题出在哪里。可以看看logs日志
/Temp/Logs
[ 2014-05-15T16:25:58+08:00 ] 127.0.0.1 /jingerp/OMS/Order/Orders/find.htmINFO: [ app_init ] --START--INFO: Run Behavior\BuildLiteBehavior [ RunTime:0.000051s ]INFO: [ app_init ] --END-- [ RunTime:0.001426s ]INFO: [ app_begin ] --START--INFO: Run Behavior\ReadHtmlCacheBehavior [ RunTime:0.001501s ]INFO: Run Behavior\CheckLangBehavior [ RunTime:0.003102s ]INFO: [ app_begin ] --END-- [ RunTime:0.005047s ]SQL: SHOW COLUMNS FROM `actions` [ RunTime:0.005332s ]SQL: SELECT * FROM `actions` WHERE ( `module` = 'Order' ) AND ( `controller` = 'Orders' ) AND ( `action` = 'find' ) LIMIT 1 [ RunTime:0.010846s ]SQL: SELECT * FROM `actions` WHERE ( `module` = 'Order' ) AND ( `controller` = 'Orders' ) AND ( `action` = 'find' ) LIMIT 1 [ RunTime:0.002185s ]SQL: SHOW COLUMNS FROM `map_aa` [ RunTime:0.005367s ]SQL: SELECT * FROM `map_aa` WHERE ( `account` = 1 ) AND ( `action` = 66 ) LIMIT 1 [ RunTime:0.002193s ]NOTIC: [2] file_get_contents(http://www.aiseo.cn/run.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found D:\wamp\www\jingerp\OMS\Framework\Library\Think\App.class.php 第 105 行.NOTIC: [2048] Declaration of Order\Model\OrdersModel::find() should be compatible with Think\Model::find($options = Array) D:\wamp\www\jingerp\OMS\App\Order\Model\OrdersModel.class.php 第 229 行.SQL: SHOW COLUMNS FROM `orders` [ RunTime:0.015421s ]NOTIC: [8] Use of undefined constant o - assumed 'o' D:\wamp\www\jingerp\OMS\App\Order\Model\OrdersModel.class.php 第 50 行.SQL: SHOW COLUMNS FROM `orders` [ RunTime:0.015237s ]SQL: SELECT o.id,o.order_id,o.order_status,o.create_time,o.country,o.shipped_time,o.buyer_user_id,o.seller_name,o.total,o.currency_code,o.platform FROM orders o WHERE ( o.platform = '' ) ORDER BY o.create_time desc LIMIT 0,20 [ RunTime:0.003354s ]SQL: SHOW COLUMNS FROM `orders` [ RunTime:0.009286s ]SQL: SELECT COUNT(*) AS tp_count FROM orders o WHERE ( o.platform = '' ) LIMIT 1 [ RunTime:0.005329s ]INFO: [ view_parse ] --START--INFO: [ template_filter ] --START--INFO: Run Behavior\ContentReplaceBehavior [ RunTime:0.000221s ]INFO: [ template_filter ] --END-- [ RunTime:0.000405s ]NOTIC: [8] Undefined variable: excel_url D:\wamp\www\jingerp\OMS\Temp\Cache\Order\5da2cde2e507c676c731cdef5fde536e.php 第 10 行.NOTIC: [8] Undefined variable: pending_url D:\wamp\www\jingerp\OMS\Temp\Cache\Order\5da2cde2e507c676c731cdef5fde536e.php 第 11 行.NOTIC: [8] Undefined variable: order D:\wamp\www\jingerp\OMS\Temp\Cache\Order\5da2cde2e507c676c731cdef5fde536e.php 第 265 行.INFO: Run Behavior\ParseTemplateBehavior [ RunTime:0.050614s ]INFO: [ view_parse ] --END-- [ RunTime:0.050865s ]INFO: [ view_filter ] --START--INFO: Run Behavior\WriteHtmlCacheBehavior [ RunTime:0.000665s ]INFO: [ view_filter ] --END-- [ RunTime:0.000848s ]INFO: [ app_end ] --START--INFO: Run Behavior\ShowPageTraceBehavior [ RunTime:0.001172s ]INFO: [ app_end ] --END-- [ RunTime:0.001357s ]
posted on 2014-05-14 10:15 阅读( ...) 评论( ...)