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.
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…