Esempio n. 1
0
 /**
  * 广告1与广告2展示的pv详情
  */
 public function adshowpvinfoAction()
 {
     $page = reqnum('page', 1);
     $pagesize = reqnum('rp', 100);
     $date = reqstr('date') ? date('Y_m_d', strtotime(reqstr('date'))) : date('Y_m_d', strtotime('-1 day'));
     //接收排序
     $sortname = reqstr('sortname', 'total');
     $sortorder = reqstr('sortorder', 'asc');
     $nt = new Psys_StationModel();
     $data = $nt->AdShowPvInfo($page, $pagesize, $date, $sortname, $sortorder);
     if ($data['allnum'] <= 0) {
         return 0;
     }
     //拼接返回的表格数据格式
     $res['total'] = $data['allnum'];
     $res['page'] = $page;
     $res['rows'] = $data['allrow'];
     $graph = array();
     foreach ($res['rows'] as &$v) {
         if ($v['show_type'] == '1') {
             $v['show_type'] = '广告1';
         } elseif ($v['show_type'] == '2') {
             $v['show_type'] = '广告2';
         }
         $graph[] = $v['cell'] = array_values($v);
         array_splice($v, 0, 7);
     }
     return $res;
 }