Jump to content

Lazarus99

New Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Lazarus99

  • Rank
    Newbie
  1. Thanks for checking that out!
  2. It's OK, I posted it on reddit and a guy came back with this and it worked a treat. case 'price_asc': $select->order(new Expr("IF(l.listing_type='auction', IF(max(b.amount) is null, l.start_price, max(b.amount)), CASE l.buyout_price WHEN 0 THEN ~0 ELSE l.buyout_price END) ASC")); break; Cheers
  3. Hi, Thanks for replying! I have tried using l.buyout_price = 0 in the above snippet but it give weird ordering results Original case 'price_asc': $select->order(new Expr("IF(l.listing_type='auction', IF(max(b.amount) is null, l.start_price, max(b.amount)), l.buyout_price) ASC")); break; Tried case 'price_asc': $select->order(new Expr("IF(l.listing_type='auction', IF(max(b.amount) is null, l.start_price, max(b.amount)), l.buyout_price = 0 ) ASC")); break;
  4. Hi, all I have the below snippet of code, But specifically about the l.buyout_price bit at the end. I want to have 0 values at the end of the ordering. Does anyone have any idea on how to rewrite the below code to achieve this. Example or ordering I would like l.buyout_price to be in this order: 1,12,200,0 instead of 0,1,12,200 case 'price_asc': $select->order(new Expr("IF(l.listing_type='auction', IF(max(b.amount) is null, l.start_price, max(b.amount)), l.buyout_price) ASC")); break;
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.