Я расскажу вам то, что я знаю для 1.4.0.1, для которой я сейчас разрабатываю версию, она может или не может быть одинаковой для любой используемой вами версии.
Кроме того, почему вы находитесь вбаза данных в любом случае?Magento создал модели для вас, чтобы вы не работали в базе данных.Независимо от того, я опишу, как найти любой атрибут, который я ищу ...
Для начала я предполагаю, что вы уже вошли в базу данных через клиент MySQL, запустите
SELECT `entity_type_id`,`entity_type_code`,`entity_table` FROM `eav_entity_type`
который даст вам что-то вроде ...
+----------------+----------------------+----------------------------------+
| entity_type_id | entity_type_code | entity_table |
+----------------+----------------------+----------------------------------+
| 1 | customer | customer/entity |
| 2 | customer_address | customer/address_entity |
| 3 | catalog_category | catalog/category |
| 4 | catalog_product | catalog/product |
| 5 | quote | sales/quote |
| 6 | quote_item | sales/quote_item |
| 7 | quote_address | sales/quote_address |
| 8 | quote_address_item | sales/quote_entity |
| 9 | quote_address_rate | sales/quote_entity |
| 10 | quote_payment | sales/quote_entity |
| 11 | order | sales/order |
| 12 | order_address | sales/order_entity |
| 13 | order_item | sales/order_entity |
| 14 | order_payment | sales/order_entity |
| 15 | order_status_history | sales/order_entity |
| 16 | invoice | sales/order_entity |
| 17 | invoice_item | sales/order_entity |
| 18 | invoice_comment | sales/order_entity |
| 19 | shipment | sales/order_entity |
| 20 | shipment_item | sales/order_entity |
| 21 | shipment_comment | sales/order_entity |
| 22 | shipment_track | sales/order_entity |
| 23 | creditmemo | sales/order_entity |
| 24 | creditmemo_item | sales/order_entity |
| 25 | creditmemo_comment | sales/order_entity |
+----------------+----------------------+----------------------------------+
Мы хотим узнать больше о сущности invoice_item, поэтому давайте посмотрим, какие атрибуты у нее есть ... run
SELECT `attribute_id`,`entity_type_id`,`attribute_code`,`backend_type` FROM `eav_attribute` WHERE `entity_type_id`=17;
и вы получите что-то вроде ...
+--------------+----------------+----------------------------------+--------------+
| attribute_id | entity_type_id | attribute_code | backend_type |
+--------------+----------------+----------------------------------+--------------+
| 349 | 17 | additional_data | text |
| 340 | 17 | base_cost | decimal |
| 346 | 17 | base_discount_amount | decimal |
| 345 | 17 | base_price | decimal |
| 679 | 17 | base_price_incl_tax | decimal |
| 348 | 17 | base_row_total | decimal |
| 681 | 17 | base_row_total_incl_tax | decimal |
| 347 | 17 | base_tax_amount | decimal |
| 567 | 17 | base_weee_tax_applied_amount | decimal |
| 568 | 17 | base_weee_tax_applied_row_amount | decimal |
| 579 | 17 | base_weee_tax_disposition | decimal |
| 580 | 17 | base_weee_tax_row_disposition | decimal |
| 337 | 17 | description | text |
| 342 | 17 | discount_amount | decimal |
| 336 | 17 | name | varchar |
| 334 | 17 | order_item_id | int |
| 333 | 17 | parent_id | static |
| 341 | 17 | price | decimal |
| 678 | 17 | price_incl_tax | decimal |
| 335 | 17 | product_id | int |
| 339 | 17 | qty | decimal |
| 344 | 17 | row_total | decimal |
| 680 | 17 | row_total_incl_tax | decimal |
| 338 | 17 | sku | varchar |
| 343 | 17 | tax_amount | decimal |
| 571 | 17 | weee_tax_applied | text |
| 569 | 17 | weee_tax_applied_amount | decimal |
| 570 | 17 | weee_tax_applied_row_amount | decimal |
| 577 | 17 | weee_tax_disposition | decimal |
| 578 | 17 | weee_tax_row_disposition | decimal |
+--------------+----------------+----------------------------------+--------------+
последний столбец (backend_type), объединенный с таблицей для объекта (entity_table), где атрибут для этого объекта будет таким, что атрибут "Additional_data" долженнаходиться в sales_order_entity_text с attribute_id 349.
Вооружившись этой информацией, теперь нам просто нужно найти счет, я буду использовать пример из моей тестовой установки.Давайте посмотрим на «base_price» элемента счета.
Сначала давайте найдем все элементы, которые связаны с счетом (в моем случае это entity_id счета 1303954)
SELECT * FROM `sales_order_entity` WHERE `entity_type_id`=17 AND `parent_id`=1303954;
, который дает2 предмета
+-----------+----------------+------------------+--------------+-----------+----------+---------------------+---------------------+-----------+
| entity_id | entity_type_id | attribute_set_id | increment_id | parent_id | store_id | created_at | updated_at | is_active |
+-----------+----------------+------------------+--------------+-----------+----------+---------------------+---------------------+-----------+
| 1303955 | 17 | 0 | | 1303954 | NULL | 2011-06-01 14:10:48 | 2011-06-01 14:10:48 | 1 |
| 1303956 | 17 | 0 | | 1303954 | NULL | 2011-06-01 14:10:48 | 2011-06-01 14:10:48 | 1 |
+-----------+----------------+------------------+--------------+-----------+----------+---------------------+---------------------+-----------+
Давайте выберем первый и найдем 'base_price'
SELECT * FROM `sales_order_entity_decimal` WHERE `attribute_id`=345 AND `entity_id`=1303955;
, который дает нам ....
+----------+----------------+--------------+-----------+---------+
| value_id | entity_type_id | attribute_id | entity_id | value |
+----------+----------------+--------------+-----------+---------+
| 7361390 | 17 | 345 | 1303955 | 31.2500 |
+----------+----------------+--------------+-----------+---------+
Что, конечноэто просто простое обновление, чтобы изменить его.
Опять же, если вы можете сделать это с помощью модели Magento, я настоятельно рекомендую вам сделать это таким образом, но если руководство - единственный путь, то, надеюсь, это помогло:)