Пример #1
0
 public function __construct(Request $request, GuardUser $objUser, EntityManager $em)
 {
     parent::__construct($request, $objUser, $em);
     $this->setSortForm(new UsersSortForm($this->getOrder(), $this->getDir()));
     $this->setFilterForm(new UsersFilterForm($this->getFieldsArray()));
     $this->generateQuery("\n                SELECT gu\n                    FROM AppGuardBundle:GuardUser gu\n        ");
     $objFilterForm = $this->getFilterForm();
     if ($objFilterForm->hasId()) {
         $this->addContidion("gu.id = " . $objFilterForm->getId());
     }
     if ($objFilterForm->hasUsername()) {
         $this->addContidion("gu.username like '%" . $objFilterForm->getUsername() . "%'");
     }
     $this->generateResult();
 }
Пример #2
0
 public function __construct(\Symfony\Component\HttpFoundation\Request $request, GuardUser $objUser = null, \Doctrine\ORM\EntityManager $em)
 {
     parent::__construct($request, $objUser, $em);
     $this->setFilterForm(new CreditFilterForm($this->getFieldsArray()));
     $this->setSortForm(new CreditSortForm($this->getOrder(), $this->getDir()));
     $this->generateQuery("\n                SELECT c\n                    FROM DataBundle:Credit c\n        ");
     $objFilterForm = $this->getFilterForm();
     $this->addContidion("c.status = " . \DataBundle\Entity\Credit::STATUS_ADMIN_ACCEPTED);
     if ($objFilterForm->hasCreatedAt()) {
         $dt = new \DateTime($objFilterForm->getCreatedAt());
         $this->addContidion("c.createdAt > '" . $dt->format('Y-m-d') . " 00:00:00' AND c.createdAt < '" . $dt->format('Y-m-d') . " 23:59:59'");
     }
     if ($objFilterForm->hasReferences()) {
         $this->addContidion("c.references = '" . $objFilterForm->getReferences() . "'");
     }
     $this->generateResult();
 }
Пример #3
0
 public function __construct(Request $request, GuardUser $objUser, EntityManager $em)
 {
     parent::__construct($request, $objUser, $em);
     $this->setSortForm(new CreditSortForm($this->getOrder(), $this->getDir()));
     $this->setFilterForm(new CreditFilterForm($this->getFieldsArray()));
     $this->generateQuery("\n                SELECT c\n                    FROM DataBundle:Credit c\n        ");
     $objFilterForm = $this->getFilterForm();
     $objSortForm = $this->getSortForm();
     if ($objFilterForm->hasCreatedAt()) {
         $dt = new \DateTime($objFilterForm->getCreatedAt());
         $this->addContidion("c.createdAt > '" . $dt->format('Y-m-d') . " 00:00:00' AND c.createdAt < '" . $dt->format('Y-m-d') . " 23:59:59'");
     }
     if ($objFilterForm->hasReferences()) {
         $this->addContidion("c.references = '" . $objFilterForm->getReferences() . "'");
     }
     if ($objFilterForm->hasStatus()) {
         $this->addContidion("c.status = " . $objFilterForm->getStatus());
     }
     $this->generateResult();
 }
Пример #4
0
 public function __construct(\Symfony\Component\HttpFoundation\Request $request, GuardUser $objUser, \Doctrine\ORM\EntityManager $em)
 {
     parent::__construct($request, $objUser, $em);
     $this->setFilterForm(new LenderDashboardFilterForm($this->getFieldsArray()));
     $this->setSortForm(new LenderDashboardSortForm($this->getOrder(), $this->getDir()));
     $this->generateQuery("\n                SELECT c\n                    FROM DataBundle:Credit c\n        ");
     $objFilterForm = $this->getFilterForm();
     $preferedCreditAmountFrom = $objUser->getLenderAmountFrom();
     $preferedCreditAmountTo = $objUser->getLenderAmountTo();
     $preferedReplaymentFrom = $objUser->getLenderReplaymentTimeForm();
     $preferedReplaymentTo = $objUser->getLenderReplaymentTimeTo();
     $this->addContidion("(c.creditAmount >= " . $preferedCreditAmountFrom . " AND c.creditAmount <= " . $preferedCreditAmountTo . " )");
     $this->addContidion("(c.replaymentTime >= " . $preferedReplaymentFrom . " AND c.replaymentTime <= " . $preferedReplaymentTo . " )");
     $this->addContidion("(c.status = " . \DataBundle\Entity\Credit::STATUS_ADMIN_ACCEPTED . " OR c.lender = " . $objUser->getId() . ")");
     if ($objFilterForm->hasCreatedAt()) {
         $dt = new \DateTime($objFilterForm->getCreatedAt());
         $this->addContidion("c.createdAt > '" . $dt->format('Y-m-d') . " 00:00:00' AND c.createdAt < '" . $dt->format('Y-m-d') . " 23:59:59'");
     }
     if ($objFilterForm->hasReferences()) {
         $this->addContidion("c.references = '" . $objFilterForm->getReferences() . "'");
     }
     $this->generateResult();
 }