8

私はcakephpV2.0.2を使用しています

問題が発生しています

$this->paginate = array(
                "fields" => array(
                    "Player.join_country"
                ),
                "joins" => array(
                    array(
                        "table" => "banner_key_current_ext",
                        "alias" => "BannerKeyCurrentExt",
                        "type" => "inner",
                        "conditions" => "BannerKeyCurrentExt.banner_key_id = BannerKeyCurrent.banner_key_id"
                    ),
                    array(
                        "table" => "players",
                        "alias" => "Player",
                        "type" => "inner",
                        "conditions" => "BannerKeyCurrentExt.identifier = Player.zban_player_id" . $country_condition
                    ),
                    array(
                        "table" => "users",
                        "alias" => "User",
                        "type" => "inner",
                        "conditions" => "BannerKeyCurrent.user_id = User.user_id"
                    ),
                    array(
                        "table" => "tag_links",
                        "alias" => "TagLinks",
                        "type" => "inner",
                        "conditions" => "TagLinks.id = BannerKeyCurrent.user_id AND TagLinks.tag_id = 710"
                    )
                ),
                "conditions" => array(
                    "BannerKeyCurrent.date BETWEEN ? AND ?" => array(
                        $this->request->query["period_from"],
                        $this->request->query["period_to"]
                    ),
                    "BannerKeyCurrent.plan_id" => $brands_plan_map[$this->request->query["brand"]]["plans"],
                    "BannerKeyCurrent.operation_id" => $operation_ids
                ),
                "group" => array( "Player.join_country" ),
                "order" => array(
                    "Player.join_country" => "DESC"
                ),
                "limit" => 999999,
                "maxLimit" => 999999
            );

すべてがすべてのフィールド、結合、グループで機能し、問題を制限しませんが、単純な順序付けは機能しません。sql_dump要素を出力すると、クエリに追加されないことがわかります。

どんな助けでも大歓迎です。

ありがとう

4

3 に答える 3

9

することで

"order" =>  "Player.join_country DESC" 

私のために働いた。

あなたにも役立つことを願っています。

于 2013-09-12T07:00:01.890 に答える
0

試す:

$this->Paginator->settings = array(
    "fields" => array(
                "Player.join_country"
            ),
            "joins" => array(
                array(
                    "table" => "b...

$pagedResults = $this->paginate('YourModel');
于 2012-10-23T14:46:40.193 に答える