public function revise($options) { $sql = "UPDATE `user_products` SET `VendorPrice` = '{$options['vendor-price']}',\n `VendorQty` = '{$options['vendor_quantity']}',\n `ProfitRatio` = '" . $options['profit-pc'] * 100 . "',\n `Qty` = '{$options['ebay_quantity']}',\n `price` = '{$options['price']}',\n `max_quantity` = '{$options['max_quantity']}'\n WHERE `user_products`.`ItemID` ='{$this->item_id}'"; $this->query($sql); if ($options['price'] != $this->local_data['Price'] || $options['max_quantity'] != $options['ebay_quantity']) { $response = Ebay::revise_item($this->item_id, array('quantity' => $options['max_quantity'], 'price' => $options['price'])); $this->log("Updated: price: {$options['price']}, quantity: {$options['max_quantity']}"); } $this->local_data = DB::query_row("SELECT * from `user_products` where ItemID='{$this->item_id}'"); }