public_extend = SimCardExtend.joins([sim_card: :agent]).where(agents: {agent_type: 'profit'}).pluck(:is_can_repeat, :renewable).uniq
    enterprise_extend = SimCardExtend.joins([sim_card: :agent]).where(agents: {agent_type: ["direct", "increase"]}).pluck( :is_allow_renew, :renewable).uniq
    public_allocation = AllocationSimCardRecord.joins(:agent).where(agents: {agent_type: 'profit'}).pluck(:is_can_repeat, :renewable).uniq
    enterprise_allocation = AllocationSimCardRecord.joins(:agent).where(agents: {agent_type: ["direct", "increase"]}).pluck( :is_allow_renew, :renewable).uniq

SimCardExtend.update_all(renewable: nil)
AllocationSimCardRecord.update_all(renewable: nil)
rake sim_card_extend:update_renewable                      # 合并是否可续期/续订套餐字段
rake allocation_sim_card_record:update_renewable           # 合并是否可续期/续订套餐字段
0条评论 顺序楼层
请先登录再回复