magento 1.9 – Get all information related to a customer

I wanted to retrieve all the information about a particular customer (giving the account number).

I mean, I would like name, surname, e-mail, billing / delivery addresses (including the ORIG_SYSTEM_REFERENCE for each) city, region, country and so on.

I tried different queries, but nobody really helped me.

CHOOSE
E-mail,
a.entity_id AS addressId,
IF (def_billing_address.value = a.entity_id, 1,0) AS isDefaultBillingAddress,
IF (def_shipping_address.value = a.entity_id, 1,0) AS isDefaultSippingAddress,
addr_firstname.value AS first name,
addr_lastname.value AS Last Name,
addr_street.value AS street,
addr_city.value AS city,
addr_region_code.code AS stateCode,
addr_region.value AS state,
addr_zipcode.value AS postalCode,
addr_country.value AS countryCode,
addr_telephone.value AS phone
FROM mg_customer_entity AS c
INNER JOIN mg_customer_address_entity AS ON ON.parent_id = c.entity_id

LEFT JOIN mg_customer_entity_int AS def_billing_address ON
(def_billing_address.entity_id = c.entity_id) AND
(def_billing_address.attribute_id = (SELECT attribut_ID FROM mg_eav_attribute AS as WHow eav.attribute_code = # default_billing # and eav.entity_type_id = 1))
LEFT JOIN mg_customer_entity_int AS def_shipping_address ON
(def_shipping_address.entity_id = c.entity_id) AND
(def_shipping_address.attribute_id = (SELECT attribut_ID FROM mg_eav_attribute AS as WHv eav.attribute_code = # default_shipping # and eav.entity_type_id = 1))
LEFT JOIN mg_customer_address_entity_varchar AS addr_zipcode ON
a.entity_id = addr_zipcode.entity_id AND
addr_zipcode.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = & # 39; postcode & # 39; and eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_varchar AS addr_city ON
a.entity_id = addr_city.entity_id AND
addr_city.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = & # 39; city & # 39 ;, and eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_varchar AS addr_country ON
a.entity_id = addr_country.entity_id AND
addr_country.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = & # 39; country_id & # 39; and eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_varchar AS addr_firstname ON
a.entity_id = addr_firstname.entity_id AND
addr_firstname.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = # firstname # and eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_varchar AS addr_lastname ON
a.entity_id = addr_lastname.entity_id AND
addr_lastname.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = & # 39; lastname & ea; and eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_text AS addr_street ON
a.entity_id = addr_street.entity_id AND
addr_street.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = & # 39; street & ea; and eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_varchar AS addr_telephone ON
a.entity_id = addr_telephone.entity_id AND
addr_telephone.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = # telephone and # eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_varchar AS addr_region ON
a.entity_id = addr_region.entity_id AND
addr_region.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS eav WHERE eav.attribute_code = # region and # eav.entity_type_id = 2)
LEFT JOIN mg_customer_address_entity_int AS addr_region_id ON
a.entity_id = addr_region_id.entity_id AND
addr_region_id.attribute_id = (SELECT attribute_id FROM mg_eav_attribute AS as WHow eav.attribute_code = # region_id # and eav.entity_type_id = 2)
LEFT JOIN mg_directory_country_region AS addr_region_code ON
addr_region_id.value = addr_region_code.region_id

This is the MAGENTO database diagram:

Can help me with this?

image

See related tables mvc5 asp.net

Hi, I'm trying to show in a view list all the messages and their author, it has to be said that the messages have a foreign key of the user, the code I have is like that

This is a view model for the two tables

    public class noticiasViewModels
{
public AspNetUsers user {get; Set; }
public news messages {get; Set; }


}

the controller that establishes the connection
public ActionResult index ()
{


using (loginEntities db = new loginEntities ())
{
var result = (from x in db.AspNetUsers
Join i in db.noticias on x.Id equals i.Autor
Select new NewsViewModels
{
Title = i.Title,
Description = i.Description,
Date = i.Date,
Author = x.UserName,
}). ToList ();

Show result (result);
}
}

and in the view I get like that

@Model News.Models.noticiasViewModels

say that the code is incomplete and error-prone if someone can clear up a bit, greetings

Related Links, Guest Posts GAMBLING CASINO BLOG DA40

Embed

HTML:

BBCode:

Link picture:

Perfect fitness industry domain and related brand name for sale.

Domain for sale, no website.

Bought for a personal project that never happened. Sell ​​now.
SEMrush

theathletic.me is a domain that perfectly embraces the idea of ​​the healthcare industry. The domain tells users that this is where they turn into their athletic versions.

This domain and associated brand name are perfect for a fitness blog or app.

Could a second special lawyer find FBI / DOJ misconduct related to FISA abuse and Hillary Clinton?

Probably not. The FBI has already investigated Clinton and found that she has not made her emails illegal. Which is good for Trump because his family members did the same.

The supposed "FISA arrest warrant" was debunked long ago. In essence, the Republicans claimed that a FISA arrest warrant for monitoring Carter Page was a politically motivated attempt to spy on the Trump campaign and fraud. In particular, they insisted that the FISA arrest warrant was based entirely on information from Christopher Steele, who had compiled this information while working indirectly for the Clinton campaign. They also claimed that the FBI did not disclose this fact to the FISA court. But every one of these claims is wrong. First, Carter Page had resigned from the Trump campaign when the FBI wanted to monitor him. So it can not be considered spying on the Trump campaign. Second, the information provided by Steele made up only a tiny portion of the information supporting the arrest warrant (IIRC a few paragraphs in a dozen pages of application). Finally, the FBI stated that Steele had come across the information when working as an opposition researcher for a Trump political rival (according to legal practice, they do not actually call Clinton an innocent third party, but it is obvious who she is from the Description). The underlying Republican assumption is also wrong: if the court had known that Steele's information stemmed from political opposition research, they would not have approved the arrest warrant. Apart from the other information against Page (who were previously subjected to a FISA arrest warrant in 2013 because the FBI caught Russian spies in the recruitment of supporters), the fact remains that an informer who has the motivation to attack someone remains not in and out of itself means that the information they give is wrong. People with insider information about criminal companies or foreign spy espionage usually do not inform the authorities of the kindness of their hearts. Usually, they either do this because they've been caught and want to make a deal, or because they have beef with the person they're saying goodbye to, and who want to fool them. However, this does not mean that every informant is lying or that warrants can not rely on information provided by an informant.

,

Domain Model – Can an entity contain "technical" (non-business related) information?

Domain-controlled design would cause you to organize your business objects in the way the company talks about them.

So if the company talks about "the user OS …" you should do that User.Os

However, I think that you are rightly careful. Companies talk about "the user operating system," but when they get challenged, they'll say, "Oh, I mean the operating system of the user device or the user's device browser, of course.

One way to work around this is to have multiple user objects, depending on whether they are used by the web team or the app team or other objects. But I find that confusing soon.

My advice would be to take the business language with a pinch of salt and add technical objects that they believe will help.

Buying pets related items [ Titles described ]

Hello WebDeveloperSah

I saw your ad on the job board of Problogger and would like to apply. I think writing fits your website well because I have a passion for creating high quality and engaging articles on a variety of topics.

I also have a blog that I usually use to develop my blogging skills and provide informative yet accessible content. You can watch it here http://wellnesshero1.blogspot.com/. I can write about almost any topic. If you hire me, you can be sure that the articles will do that

· A very interesting introduction

· A striking headline. Statistics, examples and resources if necessary.

· A call to action for your readers.

· A fun and engaging voice.

My prices are $ 0.02 per word. Looking forward to hear from you. Seize me through

Yours

Aggrey

Invoke functions to set the status before testing a related function

I think the consensus on unit testing is that every single test interacts with the smallest possible surface (?).

I have a feature that I want to test, but it depends on the settings that are performed by other functions.

Should I call this other function in my test or manually set the status as expected from the function being tested?

This means

test function_remove_item:
// set up the test
state = clone (initial state)
item = new article (& # 39; to id & # 39;
// !!! Call another function to set the test status
add_item (state, item) // assume blindly that add_item works correctly (test it in another test)

// perform the test
remove_item (state, item)
Expect (state.items) .notToInclude (item)
Expect (state.ordered) .NotToInclude (& # 39; my-id & # 39;)
Expect (state.some_other_complex_state) .toPass ()

vs

test function_remove_item
state = clone (initial state)
// Manually run the status setup without clicking add_item
state.items.push (new article (& # 39; my-id & # 39;))
state.ordered.push (& # 39; my-id & # 39;)
state.some_other_complex_state = true
// Imagine that remove_item can call other functions that you rely on
// another state
state.nested_flag_for_function_check_item_status = true

// perform the test
remove_item (state, item)
Expect (state.items) .notToInclude (item)
Expect (state.ordered) .NotToInclude (& # 39; my-id & # 39;)
Expect (state.some_other_complex_state) .toPass ()

It looks like you're calling add article in my test, it means the test is likely to be more serviceable, as it's harder to misconfigure the status (and the requirements for that status may get very large), but the test feels somehow "dirty"?