【发布时间】:2011-07-17 06:40:57
【问题描述】:
$winnerBid = Bids::model()->find($criteria);
模型有下一个关系:
public function relations() {
return array(
'item' => array(self::BELONGS_TO, 'Goods', 'item_id'),
'room' => array(self::BELONGS_TO, 'Rooms', 'room_id'),
'seller' => array(self::BELONGS_TO, 'RoomPlayers', 'seller_id'),
'buyer' => array(self::BELONGS_TO, 'RoomPlayers', 'buyer_id'),
);
}
当我尝试保存时:
$this->seller->current_item++;
$this->seller->wins++;
$this->seller->save();
我收到错误:
重载的间接修改 属性 Bids::$seller 无效 (/var/www/auction/www/protected/models/Bids.php:16)
但在另一台服务器上一切正常吗? 如何解决?或者覆盖php指令?有任何想法吗? TNX
【问题讨论】:
标签: php activerecord yii