Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

Show new column in Yii2 Grid, based on difference of dates stored in different records

I am having a table called postings, which contain the postings of a personnel, identified by the field cpf at various places at different dates. Similar to the one shown in the image below.

enter image description here

Now, in the index view of the Model, I would like show a new column, which calculates the number of days a person was posted at a particular place. For example, the person 39584 was posted at JORHAT for 5322 days (1998-05-29 - 1983-11-02 = 5322). The same person is being posted at IRS for 4259 days (difference of today's date and 2009-05-15).

I am new to Yii2 and need help. Thanks in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...