fix crowdfund SQL error
This commit is contained in:
parent
1c70a050e3
commit
df5038457e
@ -112,7 +112,7 @@ CMD:crowdfunds( playerid, params[ ] ) return ShowPlayerCrowdfunds( playerid );
|
|||||||
/* ** Functions ** */
|
/* ** Functions ** */
|
||||||
stock ShowPlayerCrowdfunds( playerid ) {
|
stock ShowPlayerCrowdfunds( playerid ) {
|
||||||
return mysql_tquery( dbHandle,
|
return mysql_tquery( dbHandle,
|
||||||
"SELECT CROWDFUNDS.ID, CROWDFUNDS.FEATURE, CROWDFUNDS.FUND_TARGET, SUM(CROWDFUND_PATREONS.AMOUNT) AS RAISED, UNIX_TIMESTAMP(RELEASE_DATE) AS RELEASE, UNIX_TIMESTAMP(END_DATE) AS END FROM CROWDFUNDS " \
|
"SELECT CROWDFUNDS.ID, CROWDFUNDS.FEATURE, CROWDFUNDS.FUND_TARGET, SUM(CROWDFUND_PATREONS.AMOUNT) AS RAISED, UNIX_TIMESTAMP(RELEASE_DATE) AS RELEASE_TS, UNIX_TIMESTAMP(END_DATE) AS END_TS FROM CROWDFUNDS " \
|
||||||
"LEFT JOIN CROWDFUND_PATREONS on CROWDFUNDS.ID = CROWDFUND_PATREONS.CROWDFUND_ID " \
|
"LEFT JOIN CROWDFUND_PATREONS on CROWDFUNDS.ID = CROWDFUND_PATREONS.CROWDFUND_ID " \
|
||||||
"GROUP BY CROWDFUNDS.ID ORDER BY CROWDFUNDS.ID DESC LIMIT " # MAX_CROWDFUNDS,
|
"GROUP BY CROWDFUNDS.ID ORDER BY CROWDFUNDS.ID DESC LIMIT " # MAX_CROWDFUNDS,
|
||||||
"OnDisplayCrowdfunds", "i", playerid
|
"OnDisplayCrowdfunds", "i", playerid
|
||||||
@ -230,9 +230,7 @@ thread OnDisplayCrowdfundInfo( playerid, crowdfund_id )
|
|||||||
thread OnDisplayCrowdfunds( playerid )
|
thread OnDisplayCrowdfunds( playerid )
|
||||||
{
|
{
|
||||||
new
|
new
|
||||||
rows;
|
rows = cache_get_row_count( );
|
||||||
|
|
||||||
cache_get_data( rows, tmpVariable );
|
|
||||||
|
|
||||||
if ( ! rows ) {
|
if ( ! rows ) {
|
||||||
return SendError( playerid, "There is no crowdfund to show. Try again later." );
|
return SendError( playerid, "There is no crowdfund to show. Try again later." );
|
||||||
@ -259,8 +257,8 @@ thread OnDisplayCrowdfunds( playerid )
|
|||||||
new Float: percent_raised = ( amount_raised / target_amount ) * 100.0;
|
new Float: percent_raised = ( amount_raised / target_amount ) * 100.0;
|
||||||
|
|
||||||
new curr_timestamp = gettime( );
|
new curr_timestamp = gettime( );
|
||||||
new release_timestamp = cache_get_field_content_int( row, "RELEASE", dbHandle );
|
new release_timestamp = cache_get_field_content_int( row, "RELEASE_TS", dbHandle );
|
||||||
new end_timestamp = cache_get_field_content_int( row, "END", dbHandle );
|
new end_timestamp = cache_get_field_content_int( row, "END_TS", dbHandle );
|
||||||
|
|
||||||
// inactive
|
// inactive
|
||||||
if ( ( curr_timestamp > release_timestamp && release_timestamp != 0 ) || ( curr_timestamp > end_timestamp ) )
|
if ( ( curr_timestamp > release_timestamp && release_timestamp != 0 ) || ( curr_timestamp > end_timestamp ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user