Unknown column 'd.status' in 'order clause'