=render :partial => "public/my_account/menu" .center.padding %h1 Mes affiliés -i = 0 -if current_annonce_account.mlm_children_id_by_levels[1].size > 0 .white %table.table.table-striped %tr %th Génération %th Nombre d'affiliés %th Affiliés ayant acheté des crédits %th Affiliés n'ayant pas encore acheté de crédits %th Nombre d'annonces publiées =#%th commissions touchées -while i != 10 do -i += 1 -if current_annonce_account.mlm_children_id_by_levels[i].size > 0 %tr %td =i %td =current_annonce_account.mlm_children_id_by_levels[i].size %td =payants = AnnonceAccount.where(:id => current_annonce_account.mlm_children_id_by_levels[i]).where("binary_parent_id is not NULL").count %td =current_annonce_account.mlm_children_id_by_levels[i].size - payants %td =Annonce.valid_to_show.where(:annonce_account_id => current_annonce_account.mlm_children_id_by_levels[i]).count =#%td =#current_annonce_account.commissions.joins(:order).where("orders.annonce_account_id IN (?)", current_annonce_account.mlm_children_id_by_levels[i] ).sum(:amount) -else .white %p Vous n'avez pas encore d'affiliés, n'hésitez pas à donner votre lien de recommandation à vos amis ! %p Votre code de recommandation : %span{:style => "font-size:1.2em;"} =current_annonce_account.mlm_token.upcase %p Votre lien de recommandation : =link_to mlm_token_url(current_annonce_account.mlm_token), mlm_token_url(current_annonce_account.mlm_token) %p Lorsque que quelqu'un s'inscrit avec votre lien de recommandation nous lui offrons 10 crédits gratuits et nous vous en offrons 5, utilisables pour mettre en valeur vos annonces. -i = 0 - parents_id = current_annonce_account.id %table.table.table-striped -while i != 10 do -i += 1 -filleuls = AnnonceAccount.where(:parent_id => parents_id) -parents_id = filleuls.select(:id).map{ |v| v.id} -if filleuls.count > 0 %h2 Génération =i %table.table %tr %th %th Nom %th Coffrets achetés %th Affiliés %th Annonces %th Code de recommandation %th -filleuls.each do |filleul| %tr.filleul %td{:style => "width:50px;"} =image_tag(filleul.avatar_url) if filleul.not_blocked %td{:style => "vertical-align:middle;"}= filleul.pseudo %td{:style => "vertical-align:middle;"} -if filleul.orders.where(:paid => true).count > 0 =filleul.orders.where(:paid => true).count %td{:style => "vertical-align:middle;"} =filleul.children.count %td =filleul.annonces.valid_to_show.count %td =link_to filleul.mlm_token.upcase, mlm_token_url(filleul.mlm_token) if filleul.not_blocked %td{:style => "vertical-align:middle;text-align:right"} =link_to i(:eye)+" détail", show_details_public_annonce_account_path(filleul), :class => "btn btn-primary" =link_to i(:envelope)+" envoyer un message privé", mail_public_annonce_account_path(filleul), :class => "btn btn-primary" if i == 1 =#link_to i(:sitemap)+" voir la position dans le binaire", public_binary_path(:parrain_id => filleul.id), :class => "btn btn-primary" if filleul.binary_parent_id