There is a referral program with ranks. When buying a referral package, it is necessary to make a percentage payment to the inviter Now I do it right after the purchase, but I need to do it for example on the 7th day of each month. I know there is a cron planner, but there will be quite a lot of payments and recalculations of ranks. How to do it better?

if ($dataRef > 0) { $refSum = round((($data['amount'] * $percent) / 100), 2); $params = [ 'sum' => $refSum, 'id' => $dataRef, ]; $this->db->query('UPDATE accounts SET refBalance = refBalance + :sum WHERE id = :id', $params); } 

    0