我使用下面的查询插入出价信息,但它抛出了一个基数违反错误。
错误抛出如下
SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row, query was: INSERT INTO `auction_bidders` (`property_id`, `customer_id`, `total_bid_amount`, `bid_amount`, `bid_placed_time`, `title_service_charge`, `is_bid_withdrawn`, `is_proxy`) VALUES (?, ?, ?, ?, '2018-01-13 16:53:32', ?, ?, ?)
我使用的代码如下
public function placeAuctionBid($property_id, $customer_id, $bid_amount){
$bidder_data = array(
'property_id' => $property_id,
'customer_id' => $customer_id,
'total_bid_amount' => $bid_amount,
'bid_amount' => $bid_amount,
'bid_placed_time' => date('Y-m-d H:i:s'),
'title_service_charge' => 0,
'is_bid_withdrawn' => 0,
'is_proxy'=>1
);
$this->biddersModel->setData($bidder_data);
$this->biddersModel->save();
$this->initiateBiddingWar();
return true;
}
这是magento 2.1代码
有什么想法吗?
暂无答案!
目前还没有任何答案,快来回答吧!