Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $oc_item_synchro_tbl = $this->getRs()->getTableName('oc_item_synchro');
- $oc_other_config = mysql_escape_string($serialized);
- $id = 255;
- $this->getConnection()->rawQuery("UPDATE $oc_item_synchro_tbl SET oc_other_config = '$oc_other_config' WHERE oc_product_id = '$id'");
- public function addProduct($data)
- {
- $oc_item_synchro = $this->getRs()->getTableName('oc_item_synchro');
- $id = (int)$data['oc_product_id'];
- $now = strtotime("Y-m-d h:ia");
- $conn = $this->getConnection('core_write');
- $sql = "INSERT INTO $oc_item_synchro SET ";
- $sql .= "oc_product_id = :OC_PRODUCT_ID, ";
- $sql .= "oc_item_category_id = :OC_ITEM_CATEGORY_ID, ";
- $sql .= "oc_item_duration = :OC_ITEM_DURATION, ";
- $sql .= "item_delivery_time = :ITEM_DELIVERY_TIME, ";
- $sql .= "is_posted = :IS_POSTED, ";
- $sql .= "oc_synchro_time = :NOW";
- $binds = array(
- 'OC_PRODUCT_ID' => $id,
- 'OC_ITEM_CATEGORY_ID' => (int)$data['oc_item_category_id'],
- 'OC_ITEM_DURATION' => $data['oc_item_duration'],
- 'ITEM_DELIVERY_TIME' => $data['item_delivery_time'],
- 'IS_POSTED' => (!empty($data['is_posted']) ? 1 : 0),
- 'NOW' => $now
- );
- $conn->query($sql, $binds);
- $sql2 = "UPDATE $oc_item_synchro SET ";
- $sql2 .= "oc_other_config = :OC_OTHER_CONFIG ";
- $sql2 .= "WHERE oc_product_id = :OC_PRODUCT_ID";
- $binds2 = array(
- 'OC_OTHER_CONFIG' => serialize($data['oc_other_config']),
- 'OC_PRODUCT_ID' => $id
- );
- $conn->query($sql2, $binds2);
- }
- $objectManager = MagentoFrameworkAppObjectManager::getInstance();
- $resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
- $connection = $resource->getConnection();
- $sql = "select * from mymodule_shipping where mymodule_shipping_id=$_REQUEST[m_shipping_id]";
- $sql = $connection->quote($sql);
- $connection->query($sql);
Add Comment
Please, Sign In to add comment