ruby Comandos varios para los contadores de Networking

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby Comandos varios para los contadores de Networking相关的知识,希望对你有一定的参考价值。

conference_id = 286
BusinessConference.find(conference_id).business_conference_participants.each do |participant|
  accepted_to_me = BusinessConferenceMeeting.where(archived: false, status: 2, business_conference_id: conference_id, host_participant_id: participant.id).size
  rejected_to_me = BusinessConferenceMeeting.where(status: 3, business_conference_id: conference_id, host_participant_id: participant.id).size
  requested_to_me = BusinessConferenceMeeting.where(archived: false, status: 1, business_conference_id: conference_id, host_participant_id: participant.id).size

  accepted_by_me = BusinessConferenceMeeting.where(archived: false, status: 2, business_conference_id: conference_id, participant_id: participant.id).size
  rejected_by_me = BusinessConferenceMeeting.where(status: 3, business_conference_id: conference_id, participant_id: participant.id).size
  requested_by_me = BusinessConferenceMeeting.where(archived: false, status: 1, business_conference_id: conference_id, participant_id: participant.id).size
  participant.update_columns(meetings_confirmed_requested_to_me: accepted_to_me,
                            meetings_rejected_requested_to_me: rejected_to_me,
                            meetings_pending_confirmation_requested_to_me: requested_to_me,
                            meetings_confirmed_requested_by_me: accepted_by_me,
                            meetings_rejected_requested_by_me: rejected_by_me,
                            meetings_pending_confirmation_requested_by_me: requested_by_me
                          )
end


UPDATE business_conference_participants
SET meetings_confirmed_requested_to_me = 0,
    meetings_rejected_requested_to_me = 0,
    meetings_pending_confirmation_requested_to_me = 0,
    meetings_confirmed_requested_by_me = 0,
    meetings_rejected_requested_by_me = 0,
    meetings_pending_confirmation_requested_by_me = 0
WHERE business_conference_id = 286;

以上是关于ruby Comandos varios para los contadores de Networking的主要内容,如果未能解决你的问题,请参考以下文章

text comandos git para revertir cambios

markdown Trucos para linea de comandos

markdown Comandos para creacion de base de datos

sh Atalhos e comandos importantes para usar o Git

powershell [Manipulandousuários通过PowerShell执行Office 365] Comandos para manipular o Office 365.

CSS Opacidad CSS para varios navegadores a la vez