示例#1
0
 /**
  * 根据类型获取广告列表
  * @param unknown_type $type
  */
 private function _getAdverList($sql, $channel = 0, $adid = '')
 {
     $rows = $this->executeQuery($sql);
     if ($rows === false) {
         log::write("AndroidWallpaperDb::_getAdListByType():executeQuery() sql: " . $sql . "faled", "log");
         return false;
     }
     $arr_android_wp_ad = array();
     foreach ($rows as $row) {
         $wp_protocol = new WallpaperProtocol();
         $wp_protocol->setProduct($this->_product);
         $wp_protocol->setAndroideskWallpaper($row, $channel, $adid);
         $wp_protocol->setWallpaperRatio($this->_width, $this->_height);
         array_push($arr_android_wp_ad, $wp_protocol);
     }
     return $arr_android_wp_ad;
 }
示例#2
0
 public function getProtocol($rows, $nType = 0)
 {
     $arrProtocol = array();
     foreach ($rows as $row) {
         $wallpaper = new WallpaperProtocol();
         $wallpaper->setVercode($this->_nVercode);
         $wallpaper->setProduct($this->_product);
         $wallpaper->setWallpaper($row, $this->_nChannel);
         array_push($arrProtocol, $wallpaper);
     }
     return $arrProtocol;
 }