doutuo7609 2014-07-16 13:24
浏览 38
已采纳

yii在adyen回调类中查询buid错误

So I have the following scenario:

A user recharges his account via Adyen API and when the payment is processed I have a ProcessOrder method that receives the callback and does the following:

public function ProcessOrder($order)
{
    //some order processing
    $order_total = Yii::app()->db->createCommand()
                    ->select('sum(`amount`) as total')
                    ->from('`order_table`')
                    ->where('`uid` = ' . $order->user->id)
                    ->queryRow(); 
//send email with data
}

And I know the $order_total is failing but I don't know why...

I want to check logs but I don't know where they are (I'm new to this project) and I am trying to send me a email with the result. I cannot var_dump() the result and then die() because the class method is called via Adyen callback...

So basically my question is:

Where are the logs in a yii app OR

Why is the query failing? :-?

More Info

  • This class is the Order Module file under protected.
  • The var $order->user->id has the correct value, I checked this with email :D
  • I also tried foreach($order_total as $row) { //send result } and nothing... It's like the system does not have access to perform query s in that part

Please ask in comments if more information is needed

  • 写回答

1条回答 默认 最新

  • duancao2082 2014-07-17 07:58
    关注

    :)) This is stupid...

    So I figured out why this does NOT work and the problem is this:

    order_table and uid MUST NOT HAVE apostrophes ``! Without them, the query executes and everything works fine.

    And yii app logs are in runtime folder :)

    (And for those of you new to Yii and what to know how to call something from a query like this, the value is is $order_total['total'])*

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错