Count.php 1004 Bytes
Newer Older
Sven Burkert's avatar
Sven Burkert committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace T3o\Randombanners\Eid;

/*
 * This file is part of the TYPO3 CMS project.
 *
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */

use TYPO3\CMS\Core\Utility\GeneralUtility;

$gp = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();

/* @var \TYPO3\CMS\Core\Database\Query\QueryBuilder $queryBuilder */
$queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)->getQueryBuilderForTable('tx_randombanners_domain_model_banner');
$queryBuilder
    ->update('tx_randombanners_domain_model_banner')
    ->where($queryBuilder->expr()->eq('uid', (int)$gp['banner']))
    ->set('clicked_this_month', 'clicked_this_month + 1', FALSE)
    ->execute();