Exemplo n.º 1
0
 public function getOne($mc_id)
 {
     $club_id = get_club_id();
     //当日潜客
     $potential_d = McNewService::getInstance()->getTodayPotentialNumber($mc_id);
     $potential_all = McNewService::getInstance()->getAllPotentialNumber($mc_id);
     //成交额
     $cardsale_d = McNewService::getInstance()->getTodayCardsSale($mc_id);
     $cardsale_all = McNewService::getInstance()->getAllCardsSale($mc_id);
     return array("potential_d" => $potential_d, "potential_all" => $potential_all, "cardsale_d" => $cardsale_d, "cardsale_all" => $cardsale_all);
 }
Exemplo n.º 2
0
 public function mcstatAction()
 {
     $time = date('Y-m', strtotime("-1 day"));
     $mc = $this->getAllMc();
     // $all_newplan=$all_newstat=$all_oldplan=$all_oldstat=$all_memberplan=$all_memberstat=array();
     foreach ($mc as $key => $value) {
         $user_id = $value['id'];
         $ret = McNewService::getInstance()->getUserOneMonthStatistics($user_id, $time);
         $data = array("user_id" => $user_id, "time" => $time, "value" => json_encode($ret));
         M("McPlanArchive")->data($data)->add();
     }
 }
Exemplo n.º 3
0
 public function queryAction()
 {
     $club_id = get_club_id();
     $user_id = I("user_id");
     $start_time = I("start_time");
     if (empty($start_time)) {
         $this->error("请输入开始时间!");
     }
     if (empty($user_id)) {
         $ret = McNewService::getInstance()->getMonthStatistics($club_id, $start_time);
         $this->ajaxReturn(array("status" => 1, "statistics" => $ret));
     } else {
         $ret = McNewService::getInstance()->getUserOneMonthStatistics($user_id, $start_time);
         $this->ajaxReturn(array("status" => 1, "statistics" => $ret));
     }
 }