示例#1
0
 /**
  * Gets customer conversion statistics.
  *
  * @return void
  */
 public function get_conversion()
 {
     $names = array('total', 'total_active', 'total_subscribed');
     $statistics = \Service_Statistic::recent(array('seller' => \Seller::active(), 'type' => 'customer', 'name' => $names));
     $data = array();
     foreach ($statistics as $stat) {
         $date = $stat->date;
         $data[$date][$stat->name] = (int) $stat->value;
     }
     if (!empty($data)) {
         ksort($data[$date]);
     }
     $this->response($data);
 }