Guest User

Untitled

a guest
Jul 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.22 KB | None | 0 0
  1. Mysql::Error: Not unique table/alias: 'customer_profiles': SELECT `users`.`id` AS t0_r0, `users`.`name` AS t0_r1, `users`.`login` AS t0_r2, `users`.`email` AS t0_r3, `users`.`crypted_password` AS t0_r4, `users`.`password_salt` AS t0_r5, `users`.`persistence_token` AS t0_r6, `users`.`single_access_token` AS t0_r7, `users`.`perishable_token` AS t0_r8, `users`.`openid_identifier` AS t0_r9, `users`.`login_count` AS t0_r10, `users`.`failed_login_count` AS t0_r11, `users`.`last_request_at` AS t0_r12, `users`.`current_login_at` AS t0_r13, `users`.`last_login_at` AS t0_r14, `users`.`current_login_ip` AS t0_r15, `users`.`last_login_ip` AS t0_r16, `users`.`state` AS t0_r17, `users`.`deleted_at` AS t0_r18, `users`.`main_branch_id` AS t0_r19, `users`.`registered_at` AS t0_r20, `users`.`auto_created` AS t0_r21, `users`.`new_email` AS t0_r22, `users`.`new_email_token` AS t0_r23, `users`.`advertiser_id` AS t0_r24, `roles`.`id` AS t1_r0, `roles`.`name` AS t1_r1, `roles`.`title` AS t1_r2, `roles`.`description` AS t1_r3, `roles`.`created_at` AS t1_r4, `roles`.`updated_at` AS t1_r5, `customer_profiles`.`id` AS t2_r0, `customer_profiles`.`birthday` AS t2_r1, `customer_profiles`.`street` AS t2_r2, `customer_profiles`.`postal_code` AS t2_r3, `customer_profiles`.`locality` AS t2_r4, `customer_profiles`.`region` AS t2_r5, `customer_profiles`.`country` AS t2_r6, `customer_profiles`.`title` AS t2_r7, `customer_profiles`.`firstname` AS t2_r8, `customer_profiles`.`lastname` AS t2_r9, `customer_profiles`.`avatar_file_name` AS t2_r10, `customer_profiles`.`avatar_content_type` AS t2_r11, `customer_profiles`.`avatar_file_size` AS t2_r12, `customer_profiles`.`avatar_updated_at` AS t2_r13, `customer_profiles`.`user_id` AS t2_r14, `customer_profiles`.`created_at` AS t2_r15, `customer_profiles`.`updated_at` AS t2_r16, `geocodings`.`id` AS t3_r0, `geocodings`.`geocodable_id` AS t3_r1, `geocodings`.`geocode_id` AS t3_r2, `geocodings`.`geocodable_type` AS t3_r3, `geocodes`.`id` AS t4_r0, `geocodes`.`latitude` AS t4_r1, `geocodes`.`longitude` AS t4_r2, `geocodes`.`query` AS t4_r3, `geocodes`.`street` AS t4_r4, `geocodes`.`locality` AS t4_r5, `geocodes`.`region` AS t4_r6, `geocodes`.`postal_code` AS t4_r7, `geocodes`.`country` AS t4_r8, `geocodes`.`precision` AS t4_r9, `discretions`.`id` AS t5_r0, `discretions`.`user_id` AS t5_r1, `discretions`.`send_sms` AS t5_r2, `discretions`.`send_email` AS t5_r3, `discretions`.`max_sms` AS t5_r4, `discretions`.`max_email` AS t5_r5, `discretions`.`send_sms_at_week` AS t5_r6, `discretions`.`send_sms_at_weekend` AS t5_r7, `discretions`.`invite_to_meetings` AS t5_r8, `discretions`.`mail_on_forum_response` AS t5_r9, `discretions`.`send_again_counter` AS t5_r10, `discretions`.`start_sms_at_week` AS t5_r11, `discretions`.`end_sms_at_week` AS t5_r12, `discretions`.`start_sms_at_weekend` AS t5_r13, `discretions`.`end_sms_at_weekend` AS t5_r14, `discretions`.`send_birthday_message` AS t5_r15, `discretions`.`send_newsletter` AS t5_r16, `discretions`.`mobile_number` AS t5_r17, `discretions`.`state` AS t5_r18, `discretions`.`created_at` AS t5_r19, `discretions`.`updated_at` AS t5_r20, `branches`.`id` AS t6_r0, `branches`.`name` AS t6_r1, `branches`.`short_description` AS t6_r2, `branches`.`description` AS t6_r3, `branches`.`website` AS t6_r4, `branches`.`phone` AS t6_r5, `branches`.`opening_hours` AS t6_r6, `branches`.`contact_person` AS t6_r7, `branches`.`street` AS t6_r8, `branches`.`postal_code` AS t6_r9, `branches`.`locality` AS t6_r10, `branches`.`region` AS t6_r11, `branches`.`country` AS t6_r12, `branches`.`state` AS t6_r13, `branches`.`avatar_file_name` AS t6_r14, `branches`.`avatar_content_type` AS t6_r15, `branches`.`avatar_file_size` AS t6_r16, `branches`.`avatar_updated_at` AS t6_r17, `branches`.`user_id` AS t6_r18, `branches`.`created_at` AS t6_r19, `branches`.`updated_at` AS t6_r20, `tasks`.`id` AS t7_r0, `tasks`.`name` AS t7_r1, `tasks`.`for_role` AS t7_r2, `tasks`.`main` AS t7_r3, `tasks`.`from_start` AS t7_r4, `tasks`.`created_at` AS t7_r5, `tasks`.`updated_at` AS t7_r6, `send_distributions`.`id` AS t8_r0, `send_distributions`.`user_id` AS t8_r1, `send_distributions`.`distribution_id` AS t8_r2, `send_distributions`.`coupon_id` AS t8_r3, `send_distributions`.`sms_send_at` AS t8_r4, `send_distributions`.`email_send_at` AS t8_r5, `send_distributions`.`message_send_at` AS t8_r6, `send_distributions`.`sms_return` AS t8_r7, `send_distributions`.`email_return` AS t8_r8, `send_distributions`.`rating` AS t8_r9, `send_distributions`.`comment` AS t8_r10, `send_distributions`.`create_comment` AS t8_r11, `send_distributions`.`created_at` AS t8_r12, `send_distributions`.`updated_at` AS t8_r13, `customer_interests`.`id` AS t9_r0, `customer_interests`.`user_id` AS t9_r1, `customer_interests`.`interest_id` AS t9_r2, `customer_interests`.`radius` AS t9_r3, `customer_interests`.`created_at` AS t9_r4, `customer_interests`.`updated_at` AS t9_r5, `interests`.`id` AS t10_r0, `interests`.`name` AS t10_r1, `interests`.`default_radius` AS t10_r2, `interests`.`distance_factor` AS t10_r3, `interests`.`background_color` AS t10_r4, `interests`.`parent_id` AS t10_r5, `interests`.`lft` AS t10_r6, `interests`.`rgt` AS t10_r7, `interests`.`created_at` AS t10_r8, `interests`.`updated_at` AS t10_r9, `interests_users`.`id` AS t11_r0, `interests_users`.`name` AS t11_r1, `interests_users`.`default_radius` AS t11_r2, `interests_users`.`distance_factor` AS t11_r3, `interests_users`.`background_color` AS t11_r4, `interests_users`.`parent_id` AS t11_r5, `interests_users`.`lft` AS t11_r6, `interests_users`.`rgt` AS t11_r7, `interests_users`.`created_at` AS t11_r8, `interests_users`.`updated_at` AS t11_r9, `loved_branches_users`.`id` AS t12_r0, `loved_branches_users`.`name` AS t12_r1, `loved_branches_users`.`short_description` AS t12_r2, `loved_branches_users`.`description` AS t12_r3, `loved_branches_users`.`website` AS t12_r4, `loved_branches_users`.`phone` AS t12_r5, `loved_branches_users`.`opening_hours` AS t12_r6, `loved_branches_users`.`contact_person` AS t12_r7, `loved_branches_users`.`street` AS t12_r8, `loved_branches_users`.`postal_code` AS t12_r9, `loved_branches_users`.`locality` AS t12_r10, `loved_branches_users`.`region` AS t12_r11, `loved_branches_users`.`country` AS t12_r12, `loved_branches_users`.`state` AS t12_r13, `loved_branches_users`.`avatar_file_name` AS t12_r14, `loved_branches_users`.`avatar_content_type` AS t12_r15, `loved_branches_users`.`avatar_file_size` AS t12_r16, `loved_branches_users`.`avatar_updated_at` AS t12_r17, `loved_branches_users`.`user_id` AS t12_r18, `loved_branches_users`.`created_at` AS t12_r19, `loved_branches_users`.`updated_at` AS t12_r20 FROM `users` LEFT OUTER JOIN `user_roles` ON `user_roles`.user_id = `users`.id LEFT OUTER JOIN `roles` ON `roles`.id = `user_roles`.role_id LEFT OUTER JOIN `customer_profiles` ON customer_profiles.user_id = users.id LEFT OUTER JOIN `geocodings` ON `geocodings`.geocodable_id = `customer_profiles`.id AND `geocodings`.geocodable_type = 'CustomerProfile' LEFT OUTER JOIN `geocodes` ON `geocodes`.id = `geocodings`.geocode_id LEFT OUTER JOIN `discretions` ON discretions.user_id = users.id LEFT OUTER JOIN `customer_denied_branches` ON (`users`.`id` = `customer_denied_branches`.`user_id`) LEFT OUTER JOIN `branches` ON (`branches`.`id` = `customer_denied_branches`.`branch_id`) LEFT OUTER JOIN `todos` ON (`users`.`id` = `todos`.`user_id`) LEFT OUTER JOIN `tasks` ON (`tasks`.`id` = `todos`.`task_id`) LEFT OUTER JOIN `send_distributions` ON send_distributions.user_id = users.id LEFT OUTER JOIN `customer_interests` ON customer_interests.user_id = users.id LEFT OUTER JOIN `interests` ON `interests`.id = `customer_interests`.interest_id LEFT OUTER JOIN `customer_interests` interests_users_join ON (`users`.`id` = `interests_users_join`.`user_id`) LEFT OUTER JOIN `interests` interests_users ON (`interests_users`.`id` = `interests_users_join`.`interest_id`) LEFT OUTER JOIN `customer_loved_branches` ON (`users`.`id` = `customer_loved_branches`.`user_id`) LEFT OUTER JOIN `branches` loved_branches_users ON (`loved_branches_users`.`id` = `customer_loved_branches`.`branch_id`) INNER JOIN `customer_profiles` ON customer_profiles.user_id = users.id WHERE ((customer_profiles.birthday < '1991-10-28 11:09:26') AND ((customer_profiles.birthday > '1910-10-28 11:09:25') AND ((users.state = 'active') AND (`roles`.`name` = 'customer'))))
Add Comment
Please, Sign In to add comment