File tree 1 file changed +21
-3
lines changed
1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ class stuff_info_handler : virtual public stuff_infoIf
364
364
ret->begin_time = single_turn.begin_time ;
365
365
double top_price = 0 ;
366
366
std::string top_customer;
367
+ long time_stamp_tmp = time (nullptr );
367
368
auto all_bc = single_turn.get_all_children <pa_sql_bidding_customer>(" belong_bidding_turn" );
368
369
for (auto &single_customer : all_bc)
369
370
{
@@ -376,10 +377,27 @@ class stuff_info_handler : virtual public stuff_infoIf
376
377
{
377
378
bc_tmp.price = single_customer.price ;
378
379
bc_tmp.timestamp = single_customer.timestamp ;
379
- if (single_customer.price > top_price)
380
+ long bid_time = PA_DATAOPT_timestring_2_date (bc_tmp.timestamp , true );
381
+ if (single_customer.price >= top_price)
380
382
{
381
- top_price = single_customer.price ;
382
- top_customer = customer->name ;
383
+ bool should_replace = false ;
384
+ if (single_customer.price == top_price)
385
+ {
386
+ if (bid_time < time_stamp_tmp)
387
+ {
388
+ should_replace = true ;
389
+ }
390
+ }
391
+ else
392
+ {
393
+ should_replace = true ;
394
+ }
395
+ if (should_replace)
396
+ {
397
+ top_price = single_customer.price ;
398
+ top_customer = customer->name ;
399
+ time_stamp_tmp = bid_time;
400
+ }
383
401
}
384
402
}
385
403
}
You can’t perform that action at this time.
0 commit comments