コード例 #1
0
 public function getMailDataGeneratorSeller($email)
 {
     try {
         $period = $this->periodos();
         $last = array_pop($period);
         $seller = new Vendedor();
         $id = $seller->getIdByEmail($email);
         $period = $last->inicio . "_" . $last->fin;
         $data = $this->getAllByAuth($id, $period);
         $collection = array();
         foreach ($data as $key => $val) {
             $result = new stdClass();
             $result->{'cliente'} = $val->cliente;
             $result->{"ultimo_total"} = (double) $val->ultimo_total;
             $result->{"total"} = (double) $val->total;
             $result->{"total_clave"} = (double) $val->total_prod_clave;
             $result->{"porcentaje_clave"} = $this->getPercent($val->total_prod_clave, $val->total);
             $collection[] = $result;
         }
         return $collection;
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }