博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Thinkphp
阅读量:5150 次
发布时间:2019-06-13

本文共 3217 字,大约阅读时间需要 10 分钟。

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 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/lvyno/p/3727120.html

你可能感兴趣的文章
导航,头部,CSS基础
查看>>
[USACO 2017 Feb Gold] Tutorial
查看>>
gzip
查看>>
转负二进制(个人模版)
查看>>
LintCode-Backpack
查看>>
查询数据库锁
查看>>
我对于脚本程序的理解——百度轻应用有感
查看>>
面试时被问到的问题
查看>>
注解小结
查看>>
list control控件的一些操作
查看>>
判断字符串在字符串中
查看>>
oracle 创建暂时表
查看>>
201421410014蒋佳奇
查看>>
Xcode5和ObjC新特性
查看>>
Centos 7.0 安装Mono 3.4 和 Jexus 5.6
查看>>
CSS属性值currentColor
查看>>
java可重入锁reentrantlock
查看>>
浅谈卷积神经网络及matlab实现
查看>>
解决ajax请求cors跨域问题
查看>>
《收获,不止Oracle》pdf
查看>>