我有一个表格,其中包含以下列:
SelectGroup,Rank,Crew Name,Status,Available Date,Document Monitoring,Documents
Rank,Crew Name和status来自mysql查询,然后将其打印为表格中的单元格。另一方面,对于文档监控,mysql仅检索document_exp_date。然后使用php计算当前日期和document_exp_date之间的差异。将有三个结果:
NO DOCUMENTS EXPIRED
SOME DOCUMENTS ARE EXPIRING
SOME DOCUMENTS ARE EXPIRED
现在,我对排序表有疑问。它很容易对排名和状态进行排序,因为它在数据库中,但我们还需要根据文档监控对其进行排序。我们希望输出按此顺序排列:
MASTER, VACATION, NO DOCUMENTS EXPIRED
MASTER, VACATION, SOME DOCUMENTS ARE EXPIRING
MASTER, VACATION, SOME DOCUMENTS ARE EXPIRED
.
.
.
CHIEF MATE , VACATION, NO DOCUMENTS EXPIRED
CHIEF MATE , VACATION, SOME DOCUMENTS ARE EXPIRING
CHIEF MATE , VACATION, SOME DOCUMENTS ARE EXPIRED
我试图在查询中包含文档监控的计算,但执行时间很糟糕。我们怎样才能对表格进行排序?