<div style= "Text-align:left;" ><span style= "font-family:arial, Helvetica, Sans-serif;" > #设置奖励信息 </span></div> def set_award_info (task_params,award_params) if task_params[:goods_i D].to_i = = sequel::model::table # update Sys_task_award_account award_params[:account].split (/;/). |params| Task_award = {} task_award[:account_id] = nil Task_award[:award_type] = nil Task_aw Ard[:base_amount] = nil Task_award[:min_amount] = nil Task_award[:max_amount] = Nil Task_award[:award_equation] = Nil params = params.split (/:/) Task_award.each_with_index do | (Key,value), index| Task_award[key] = Params[index] End task_award[:task_id] = task_params[:task_id] Ta Sk_award[:create_time] = Time.now Task_award[:update_time] = Time.now Sys_task_award_account = Caiqiuservice::coredao::systaskawardaccount.new Sys_task_award_account.save_hash (task_award) en D End #其他类型 TODO end
Hash traversal of ruby development Each_with_index