Hi Simon
The ($statuses[$track->value] == 4) means completed status.
And It works correctly now.
Thanks.
Jinchao