因为很早用过yii,那边数据查询时对于排序是支持SORT_ASCSORT_DESC的,如下:

    1. $query->order(['id' => SORT_ASC])->select()->toArray();

    结果发现这招在tp中不管用了,原来是tp不支持这个。只得用原始的:

    1. $query->order(['id' => 'asc'])->select()->toArray();