Where do I find the customer ID in a Magento 2 database? - magento

I'm using the CreativeMinds Multi User Accounts plugin. In the cminds_multiuseraccounts_subaccount table it references customer_id and parent_customer_id. Where is the customer_id defined?

You can find customer id in 'customer_entity' Table

Related

Laravel - Please advise on table name

I am in trouble with the name of the pivot table.
products ... Product master table
shop ... Shop master table.
shop_sales ... A table that links products and dates. It leads to another table. The column is date and shop_id.
I want to add a table to shop_sales to manage products and the number sold.
shop_sale_products vs product_shop_sale
Does laravel recommend product_shop_sale?
thanks.

Laravel 5 from Pivot-Table to Many

how can I access in Laravel 5 from the pivot table the users if i have a relation like this:
users (id)
roles (id)
user_role (user_id, role_id)
I select the user_id's and now i want the users.
Thank you
You need to set up your relations in User model and Role model. Please refer to the laravel documantation.
https://laravel.com/docs/5.1/eloquent-relationships#many-to-many

Relational Ado Without Primary Foreign Key Relation in yii

I have 2 tables. one is groups and other is frames.
groups has id, name, owner as columns.
grouppage has id,name and user_id.
users can have group pages. users can edit page if they are owner of the group .Means user_id = owner. Otherwise users can not edit the group page.
Hence i have a public property called can_edit.this is true if user_id = owner.
now i want to connect these 2 table using relational ADO. But how do i do it? because i have to connect the user_id in grouppage table to owner in groups. Neither owner nor group_id are primary keys?
Any solution /ideas
Thanks to all
Smith

Magento: what is parent_id field on sales_flat_order_payment table?

What is the parent_id field on sales_flat_order_payment table for ?
I would guess it's the entity_id from sales_flat_order, but if I read it correctly then according to http://www.magereverse.com/index/magento-database-diagram/version/1-7-0-1 the actual entity_id on the sales_flat_order_payment table refers to the entity_id on the sales_flat_order table instead.
On our production machine, the parent_ids all match the entity_ids on the sales_flat_order_payment.
On our dev machine, some match and some do not. Is this to be expected ?
Using magento 1.7.0.1
Thanks
The output of show create table sales_flat_order_payment; is:
CONSTRAINT `FK_SALES_FLAT_ORDER_PAYMENT_PARENT_ID_SALES_FLAT_ORDER_ENTITY_ID`
FOREIGN KEY (`parent_id`) REFERENCES `sales_flat_order` (`entity_id`)
ON DELETE CASCADE ON UPDATE CASCADE
Means you are absolutely right, that parent_id references to entity_id in sales_flat_order

Tables involved in storing order information for a certain product in magento

What are the Tables involved in storing the information of an order.
For example: Customer - product purchased - etc.
I found the product purchases status etc.(invoice and sales tables) but having hard time in linking it to the customer. Could not find who bought what ? Any suggestions
Thanks
The table sales_flat_order has a field customer_id referring to a row in the customer_entity table. But remember that some orders are guest orders, and they are not associated to a customer account. In those cases customer_id is null.
The products (line items) for an order are stored in sales_flat_order_item. There's an order_id linking it to the order and a product_id linking it to the product.

Resources