View Full Version : $ Sold amount increased $100,000 overnight
April 30th, 2006, 06:01 PM
The dollar amount sold in the stats block jumped up from $30,000+ to $129,000 overnight and NO, there haven't been any $100,000 items sold.
What could cause this to happen. Any way to realign it without just changing the number in the database to what I "remember" that it was yesterday?
Will this happen again and again?
April 30th, 2006, 06:34 PM
The only way it can happen two ways period looking at the code.
If you have your CRON TASK running an auctions close out the amount is added to the stats table etc and the winning bid is sent out etc and two the stats amount goes up when a poster marks there ad sold.
That is the only time the stats table is updated. Either on auction close or when a user manually marks there ad sold.
If you really want to find out which ads caused this you can run a query like this. Here is the unixtimestamp from saturday 12am forward
SELECT * FROM pp_products WHERE status > ' 1146283200'
This should select all closed auctions and ads which where marked sold by users or the cron script and those prices would have been added to your stats table.
April 30th, 2006, 11:09 PM
I have a Cron Task running every hour. I ran your SQL query and it did turn up a 94 listings. But NONE had "isauction" set as for on. Some were even wanted to buys without $ at all.
This Cron Task has been running everyday since I installed the program and I've not made any changes to anything.
May 1st, 2006, 07:54 AM
Well not only are auctions added. Anything that has a price amount in that list was added to your stats column period.
May 1st, 2006, 08:08 AM
So, when the cron task runs and removes expired ads it is counting them as "sold"? I don't understand.
Additionally, when ads expire if I don't go into the Admin section and delete them from the expire queue will they ever automatically go away or will they stay in the expire queue forever until I remove them?
May 1st, 2006, 08:30 AM
1. The cron task does not mark anything sold. Only a user can mark there own ad sold. The cron task only expired ads and expired auctions and it is the auction that counted towards the sales amount. An ad that is sold has status greater than 0. An ad that was never sold has a status of 0. Thus this is why I gave you the query I did as it would list all ads whether auction or sold ad that would have added prices to the stats table. Status is greater than 0 and the unixtimestamp I gave you was Saturday at 12 midnight am.
2. The cron task simply expires ads from showing you need to actually go into the query and mark them for deletion.
May 1st, 2006, 11:43 PM
Yes, but as I said, none of the ads that were selected by your query were Auctions. Zero. I've only had one auction in my Classifieds. So far.
So, if all those ads were cleared by the cron task, and they weren't auctions how did the $ amount of sales increase by $100,000 overnight?
May 2nd, 2006, 06:26 AM
It does not matter if they are auctions. What is not clear in my post that you think only auctions count in the stats?
My post explicitly states auctions and sold ads count in the stats table. If you had like 94 results with the query I gave you then every single result counted towards updating your stats table. The query I posted pulled everything from Saturday 12am forward that would have updated your stats table and should have. It pulled closed auctions and ads users have marked sold.
May 2nd, 2006, 11:13 PM
Sorry, I seem to be reading your explaination wrong. I thought you said that regular ads that expire and are shown expired after a cron task wouldn't increase the dollar total of sold items... unless they were auctions.
So, they're not auctions.
They didn't get marked sold by the ad owners
But the total increaed $100,000 in 24 hours which is 600% more than had been sold in the previous 30 days.
So, how did the number increase from mid $20,000 to mid-$120,000s overnight?
May 3rd, 2006, 07:37 AM
Hello yeah I think you misunderstood the explanation as it does not say what your thinking.
I gave you a query to pull all auctions that closed or ads which where marked sold by the user hense the status was not 0.
SELECT * FROM pp_products WHERE status > '1146283200'
THIS QUERY PULLS ONLY SOLD ADS AND EXPIRED AUCTIONS BOTH OF WHICH COUNT TOWARDS SALES
On a regular expired ad status would be 0 whether its active or expired. It only gets changed when marked sold. There are only two places in the program that the stats dollar amount changes and that is when a auction closed and when a user marks there ad sold.
If status is greater than 0 then they most definately where marked sold by users. I am just telling you what I see. Therefore you are saying there where 96 transactions added to your stats table since Saturday 12AM. Thats closed auctions and sold ads not expired ads.
May 4th, 2006, 10:31 AM
What does a product class of "1146283200" signify exactly? I just did a export of my products table and I have 235 ads. Out of 235 ads 111 have a class of "0" and 124 have a class with a 10-digit number like that.
That doesn't sound right to me.
I'm guessing when the cron task wipes those 124 ads that they too will lead to increasing the "sold" total. So, I need to get to the bottom of this problem. Do you know any reason that this would happen?
I can attach the csv file if you'd like to see it.
May 4th, 2006, 11:16 PM
You mean status?
A status like that tells me that is an ad that a user has marked sold or an auction that has closed both of which add dollar amounts into the stats table.
This is exactly why I gave you that query. You said you found it hard to believe that after saturday your stats grew that much yet the query above pulls all sold ads or closed auctions since last saturday and you told me initially the query pulled 90 some results. Very believable to me here with 90 some results closing.
There is no problem that I see anywhere as stated. Let me explain how the program works again. The stats table only gets updated in two places in the code period.
1. When an auction is closed by sendnotice.php cron then stats are updated.
2. When a user that places an ad physically marks his ad sold the stats table gets updated
These are the only two places that ever run a query to update the stats table and in both cases those ads also get status field updated with the time the auction is closed or the ad is marked sold by the user. Hense why some ads are 0 and others are not.
May 5th, 2006, 09:58 AM
Yes, sorry "status" not class. I misspoke.
Let me try to simplfy what I'm asking.
Could ads not marked sold or as an auction, through some error, have the status set to something other than zero?
Because I have 235 Ads right now and 134 of them have a status larger than zero. I can guarantee that they are not auctions and have not been marked sold. How could they get this status number higher than zero.
This is the question I've been trying to ask. Sorry if I haven't been clear enough.
I think something else, some error or something, is making this status number greater than zero and this is how my dollar sold stat goes up so unrealisticly. Can you give me any insight as to why this might happen?
I hope I've stated this more clearly this time.
May 5th, 2006, 10:26 AM
I see nowhere in the program this can happen at all. As I have been trying to explain and sorry if I am not clear enough here. The query to update the stats table with a dollar amount only happens twice in our classifieds program.
1. On sendnotice.php when it closes an auction by running the cron task.
2. On editproduct when a user views their ad and hits SOLD AD
Only then is the stats table updated hense I can see no way other than the fact an auction has closed or the user has marked their ad sold that the stats can go up.
Are you allowing anonymous ad posting and anonymous users ability to edit ads?
You can look at sendnotice.php and editproduct.php those two files and see exactly what I mean. Nowhere else in the program at any time does the stats table get incremented in price and amount of ads sold.
You have had 134 ads close since last Saturday how can you guarantee the users are not marking them sold? The sold button is only shown to you or the user who posted there ad. If status is not 0 the ad if you view it is going to say sold. Someone marked it sold here. I do not see anywhere in the code that
May 5th, 2006, 06:13 PM
No, at my forum you can't place an ad without being registered (phpbb).
But according to your explaination 50% of the users suddenly started marking their ads as "sold"?
Could it be that they've received an email saying that their ad is expiring and when the follow the link to the ad, if they don't want to renew that ad they think the only way to get rid of the ad is to mark it sold? I have had one or two users email me and say they needed another option between "sold" and "renew".
I've not placed an ad and let it run to the end so I don't know what they are experiencing.
Could it be that? It took a month for this big jump to happen. Maybe the first ads were just expiring then?
Oh, and by the way, the Sold total hasn't kept going up hardly at all -- in fact it's just like normal now. And the Cron Task has been running every hour or so for the past week.
May 5th, 2006, 06:35 PM
Okay well I can not tell you what your users are doing but as the program is coded stats are only updated in two places so either you have had ads marked sold by users or auctions where closed with sendnotice.
If this is your first big jump then yeah they could have got there expiration notices and said hey wait I sold that so let me mark that sold.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.