array( -6ren">
gpt4 book ai didi

CakePHP 分页顺序不起作用

转载 作者:行者123 更新时间:2023-12-04 07:25:18 24 4
gpt4 key购买 nike

我使用的是cakephp V2.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 元素表明它从未添加到查询中。

任何帮助将不胜感激。

谢谢

最佳答案

通过做

"order" =>  "Player.join_country DESC" 

为我工作。

我希望它也能帮助你。

关于CakePHP 分页顺序不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13031006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com