0

I am using the following query to insert bidding info but it throws an Cardinality violation error.

Error thrown as follows

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', ?, ?, ?)

Code i used as follows

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;
    }

Its a magento 2.1 code

Any ideas?

Karthik Nk
  • 377
  • 1
  • 8
  • 25

0 Answers0