您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

34 行
1.1KB

  1. <?php
  2. namespace Lc\ShopBundle\Repository;
  3. use Doctrine\ORM\EntityManager;
  4. use Lc\ShopBundle\Context\DefaultRepositoryInterface;
  5. use Lc\ShopBundle\Context\MerchantUtilsInterface;
  6. use Lc\ShopBundle\Context\ReductionCreditInterface;
  7. /**
  8. * @method ReductionCreditInterface|null find($id, $lockMode = null, $lockVersion = null)
  9. * @method ReductionCreditInterface|null findOneBy(array $criteria, array $orderBy = null)
  10. * @method ReductionCreditInterface[] findAll()
  11. * @method ReductionCreditInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  12. */
  13. class ReductionCreditRepository extends BaseRepository implements DefaultRepositoryInterface
  14. {
  15. public function getInterfaceClass()
  16. {
  17. return ReductionCreditInterface::class;
  18. }
  19. public function findReductionCreditsByUser($user)
  20. {
  21. $query = $this->findByMerchantQuery() ;
  22. $query->andWhere('e.status = 1');
  23. $query->andWhere(':user MEMBER OF e.users');
  24. $query->setParameter('user', $user);
  25. return $query->getQuery()->getResult() ;
  26. }
  27. }