php - Our round robin function is skipping sales poeple -


we have round robin system sends contact form emails numbers of sales staff in order. if there gap of period of days loses goes out of sequence. reason why happening?

code on page:

    public function __construct() {     parent::__construct();      // round robin - next email address      $this->addrs = $this->config->item("internal_contact_emails");      // index of last email used db     $last_index = $this->db->get('round_robin')->result();     $last_index = $last_index[0]->last_index;     $last_index++;      if ($last_index >= count($this->addrs)) {         $index = 0;     } else {         $index = $last_index;     }      $this->email_to = $this->addrs[$index];      $this->db->update("round_robin", [             'last_index' => $index         ]); } 

sent to

$config['internal_contact_emails'] = [     'test@gmail.com',     'test@gmail.com',     'test@gmail.com' ]; 


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -