[TYPO3-english] pt_extlist use daysInYear to sort dates

Simon Schaufelberger (Schaufi) simonschaufi at guugelmail.de
Fri Mar 20 23:44:58 CET 2015


basically what happens is that it will produce the following sql:

field1Column {
   table = table1
   field = field1
}

select table1.field1 AS field1Column

field1Column needs to match the fieldIdentifier in the columns block.

Am 20.03.15 um 23:40 schrieb Simon Schaufelberger (Schaufi):
> hi,
> yes, what you write in the fields array will produce direct sql.
>
> here are some examples:
> http://extlist.punkt.de/examples/typo3mysql/grouped-rows-single-column.html
>
> Am 20.03.15 um 08:02 schrieb Sebastian Gärtner:
>> Hi, Am trying to set up pt_extlist to give me a list sorted and sortable
>> by the daysInYear (php is using %j in its strftime function)
>> I dont really get what i can access with the field definition
>>
>> fields {
>>          field1 {              table = table1
>>            field = field1
>>            isSortable = 1
>>          }
>> }
>>
>> Is this the pure access to one column eg. field or can i access
>> something that i define in the baseFromClause
>> Lets say this would work
>>
>> baseFromClause (
>>              SELECT
>>                  domain,
>>                  years_paid,
>>                  date_registered,
>>                  date_registered + INTERVAL(YEAR(CURRENT_TIMESTAMP) -
>> YEAR(date_registered)) + 0 YEAR AS currPeriod,
>>                  date_registered + INTERVAL(YEAR(CURRENT_TIMESTAMP) -
>> YEAR(date_registered)) + 1 YEAR AS nextPeriod
>>              )
>>
>> It works in phpMyAdmin when i add the FROM clause which is not needed in
>> baseFromClause or am i wrong?
>>
>> Now my question is can i define nextPeriod as a field and use as a
>> column. What do i have to do to use it as a column?
>

-- 
Regards, Schaufi


More information about the TYPO3-english mailing list