0

我有一个数组,其中包含从表中获取的一些记录。

示例记录:

rec = ReworkCycle id: 6634, issue_id: 2651, status_id: 3, project_id: 14, created_on: "2013-05-29 07:41:06", old_status_id: 2

n每个数组都有这样的记录issue_id

这里issue_idproject_id是独一无二的。

考虑我在数组中有以下状态的记录:格式=状态(id)

[assigned(2), testing(3), hold(13), assigned(2), testing(3), reopened(7), assigned(2), testing(3),reopened(7), assigned(2), hold(13), testing(3), approved(27)]

我想要的是通过以下方式减去两个状态的日期:

array << (assigned date - 1st reopened date) - hold date which is between assigned and 1st reopened date - assigned date or status next to hold

首先分配 - 首先重新打开然后减去保留时间

第二个结果将出现在两个重新开放的州之间。

array << (2nd reopen date - 1st reopen date) - hold state if any between 1st and 2nd reopen state dates - status next to hold state date

array << (approved date - last reopened state) - hold state date if any in this two states - status date next to hold state

重新打开的状态可以是数组中的任意计数。

任何帮助将不胜感激。

4

0 回答 0