-1
I need to make an application for an auction company of used things, then I will need to create an interface where n customers can give a minimum bid and a maximum bid for a product X and the system returns the winner, but making a rule for the customer to pay as much as possible. The business rule is a little different, because, in this project, wins whoever gives the least value, but, not its minimum (I do not understand why, but will be so rs). For example, if the minimum value of a customer C for R$50,00 and the maximum is R$ 300,00 but in the calculus round he can win with R$120,00 as the cheapest price, he would pay R$120,00 and not the R$50,00 which is to say the least. I hope I’ve been able to explain it to you. I was wondering if you could do this with just a mysql query or php together. And if so, how can I do it? Can anyone give me a light? (There is also the possibility of a draw)
The main query table would have:
- ID (pk)
- PRODUCT_ID (fk)
- CUSTOMER_ID (fk)
- MIN_PRICE (float)
- MAX_PRICE (float)
- WINNER (true or false)
Welcome, your question this wide and without specific details of the problem. Try to be more specific and detail the problem you are facing.
– rubStackOverflow
I think there are problems in this rule, because if there is a tie and there is only one product, what will be the criterion for there to be a winner. There has to be a rule for when this happens, and who should define it is your customer, as a suggestion, when there are ties, will be with product who has made the bid first or who has made more purchases on the site. If you choose the option that has made the most purchase on the site and you are tied what next rule? Talk to your client so you can clear the rules before implementing them.
– Ruberlei Cardoso