gpt4 book ai didi

php - Propel,为选择语句添加别名

转载 作者:可可西里 更新时间:2023-11-01 13:47:53 25 4
gpt4 key购买 nike

我在 symfony 2.1 中使用 propel master-dev。可以写这样的东西吗?否则我如何向 select 语句添加别名。

    $products = ProdottinewQuery::create()
->leftJoinWith('Prodotticolori')
->leftJoinWith('Alberocategorie')
->leftJoinWith('Brand')
->leftJoinWith('Prodottimateriali')
->leftJoinWith('Prodottigroffatura')
->select(array('id',
'codice',
'nomeEng',
'Alberocategorie.nomeeng' => 'category',
'Prodotticolori.coloreeng' => 'color',
'Brand.brand' => 'brand',
'Prodottimateriali.materialeeng' => 'material',
'Prodottigroffatura.groffaturaeng' => 'groffage'))
->orderById()
->limit($howmany)
->find();

最佳答案

已解决:

    $products = ProdottinewQuery::create()
->leftJoinWith('Prodotticolori')
->leftJoinWith('Alberocategorie')
->leftJoinWith('Brand')
->leftJoinWith('Prodottimateriali')
->leftJoinWith('Prodottigroffatura')
->select(array('id',
'codice',
'nomeEng'))
->withColumn('Alberocategorie.nomeeng', 'category')
->withColumn('Prodotticolori.coloreeng', 'color')
->withColumn('Brand.brand', 'brand')
->withColumn('Prodottimateriali.materialeeng', 'material')
->withColumn('Prodottigroffatura.groffaturaeng', 'groffage')
->orderById()
->limit($howmany)
->find();

关于php - Propel,为选择语句添加别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11099055/

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