Git Product home page Git Product logo

Comments (3)

x86demon avatar x86demon commented on May 23, 2024

Hi, Sergey. Please describe what results do you expect.

from doctrine-extensions.

popovserhii avatar popovserhii commented on May 23, 2024

If examine native query

SELECT
    c0_.id AS id_0,
    c1_.id AS id_1,
    r2_. CODE AS code_2,
    GROUP_CONCAT(r3_.number) serial_all,
    GROUP_CONCAT(CASE WHEN r3_.cartItemId > 0 THEN r3_.number END) serial_selected,
    r2_.sku AS sku_6,
    r2_. NAME AS name_7,
    c0_.quantity AS quantity_8,
    c0_.price AS price_9,
    r3_.*
FROM
    cart_item c0_
LEFT JOIN cart c1_ ON c0_.cartId = c1_.id
LEFT JOIN ra_spare_city r5_ ON (c0_.itemId = r5_.id)
LEFT JOIN ra_spare r2_ ON r5_.productId = r2_.id
LEFT JOIN ra_spare_serial r3_ ON r2_.id = r3_.productId AND (c0_.id = r3_.cartItemId OR r3_.cartItemId IS NULL)
WHERE
    c0_.cartId = 1777
GROUP BY r2_.id

this query in GROUP_CONCAT should give me only cartItem which bind in serial table otherwise nothig to do. At screencast you can see serial_selected which has only one value and serial_all which include all avaliable values.

from doctrine-extensions.

x86demon avatar x86demon commented on May 23, 2024

Hi, @popovsergiy
Seems that this issue is duplicate of #19

Checked it with next query

SELECT
 GROUP_CONCAT(CASE WHEN f.budget > 0 THEN f.budget ELSE 0 END) 
FROM Oro\\Entities\\Foo f GROUP BY f.code

Which works fine with latest release https://github.com/orocrm/doctrine-extensions/releases/tag/1.0.12

Please, check that you are using correct one

Improved test coverage for this case
https://github.com/orocrm/doctrine-extensions/pull/26/files

from doctrine-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.