你好,我想控制下首页显示产品的排序,该怎么实现这个排序呀
https://github.com/fecshop/yii2_fecshop/blob/master/app/appfront/modules/Cms/block/home/Index.php#L47
加入 orderBy 条件
orderBy
/* * @param $filter | Array , example filter: * [ * 'numPerPage' => 20, * 'pageNum' => 1, * 'orderBy' => ['_id' => SORT_DESC, 'sku' => SORT_ASC ], * 'where' => [ * ['>','price',1], * ['<=','price',10] * ['sku' => 'uk10001'], * ], * 'asArray' => true, * ] * 得到总数。 */