对于我的生活,我无法弄清楚出了什么问题。当我调试$order->save
操作的值时,我得到一个1
(我假设它是true
)。这就是我正在做的事情:
$order = $this->Order->find('first', array(
'conditions' => array('Order.token' => urldecode($token))
));
debug($order);
$this->Order->id = $order['Order']['id'];
$orderData = array('Order' => array(
'id' => $order['Order']['id'],
'billing_email' => urldecode($payPalResponse['EMAIL']),
'billing_name' => urldecode($payPalResponse['PAYMENTREQUEST_0_SHIPTONAME']),
'billing_address' => urldecode($payPalResponse['PAYMENTREQUEST_0_SHIPTOSTREET']),
'billing_city' => urldecode($payPalResponse['PAYMENTREQUEST_0_SHIPTOCITY']),
'billing_state' => $payPalResponse['PAYMENTREQUEST_0_SHIPTOSTATE'],
'billing_zipcode' => $payPalResponse['PAYMENTREQUEST_0_SHIPTOZIP']
));
debug($orderData);
$this->Order->save($orderData);
这就是我得到的:
controllers/markets_controller.php (line 149)
Array
(
[Order] => Array
(
[id] => 13
[token] => **************
[player_id] => 1
[status_id] => 1
[timestamp] => 2012-02-15 12:09:24
[date_filled] => February 15, 2012
)
[OrderItem] => Array
(
)
)
controllers/markets_controller.php (line 161)
Array
(
[Order] => Array
(
[id] => 13
[billing_email] => *********@************.com
[billing_name] => Test User
[billing_address] => 1 Main St
[billing_city] => San Jose
[billing_state] => CA
[billing_zipcode] => 95131
)
)
为什么告诉我它正在储蓄,但事实并非如此?
答案 0 :(得分:0)
好吧,之前我曾试图清除缓存,但由于某些原因它没有采取。我终于清除了Order模型的缓存文件,并修复了它。