Difficult to understand your code but solution are so essay
here you need to when user use the coupon at that time you need to reduce max use
like if you set max uses 2 time so when any user use that coupon update max uses value as 1
and if you manage with different column then you need to increment that another column and when both column value are same then no more use possible.