Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
namespace Plugin\Sample\Controller;
use Eccube\Application;
use Eccube\Common\Constant;
use Symfony\Component\HttpFoundation\Request;
class SampleController
public function index(Application $app, Request $request)
$qb = $app['orm.em']->getRepository('Eccube\Entity\OrderDetail')
->innerJoin('od.Product', 'p')
->innerJoin('Eccube\Entity\Order', 'o', 'WITH', ' = od.Order')
->select('COUNT( AS orders')
->where('o.order_date >= :now')
->andWhere(' = :product_id')
->setParameter('product_id', $app['request']->get('id'))
->setParameter('now', new \DateTime('-1 month'));
$result = $qb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment