public static function getList($cond, $curPage = 1, $pageSize = 5, $orderBy = ['id'=>SORT_DESC]){ $model = new PostModel(); // 查詢語句 $select = ['id','title','summary','label_img','cat_id','user_id','user_name','is_valid','created_at','updated_at']; $query = $model->find() ->select($select) ->where($cond) ->with('relate.tag','extend') ->orderBy($orderBy); // 獲取分頁數據 $res = $model->getPages($query, $curPage, $pageSize); var_dump($res);die; // 格式化數據 $res['data'] = self::_formatList($res['data']); return $res;? }
- 2 回答
- 0 關注
- 1090 瀏覽
添加回答
舉報
0/150
提交
取消