Exemplo n.º 1
0
 /**
  * 通过id获取车站全屏广告
  * @param unknown $id  */
 public function getStationadsById($id)
 {
     $rule = new Psys_AdsRule();
     return $rule->getStationadsById($id);
 }
Exemplo n.º 2
0
 public function changecityAction()
 {
     $adsid = $_GET['adsid'];
     $adstype = $_GET['adsType'];
     $m = new Psys_AdsRule();
     $citys = $m->getcitys();
     $citysId = array();
     foreach ($citys[allrow] as $c) {
         if ($adstype == '5') {
             $m->SetDb('db-rht_idc');
             $m->SetTable("rhi_stationads");
             if ($adstype == '5') {
                 $sql = 'SELECT id FROM rhi_stationads WHERE id=' . $c['id'] . ' and adsone LIKE "%' . $adsid . '%"';
                 $data = $m->Query($sql);
                 if ($data) {
                     array_push($citysId, $data[0]['id']);
                 }
             }
         }
         if ($adstype == '6') {
             $m->SetDb('db-rht_idc');
             $m->SetTable("rhi_stationads");
             if ($adstype == '6') {
                 $sql = 'SELECT id FROM rhi_stationads WHERE id=' . $c['id'] . ' and adstwo LIKE "%' . $adsid . '%"';
                 $data = $m->Query($sql);
                 if ($data) {
                     array_push($citysId, $data[0]['id']);
                 }
             }
         }
     }
     $citysId = implode(',', $citysId);
     print_r($citysId);
 }
Exemplo n.º 3
0
 public function toggleadsAction()
 {
     $ispost = reqnum('ispost', 0);
     if ($ispost == 1) {
         $id = reqnum('id', 0);
         $flag = reqnum('flag');
         $result = array('result' => 'ERROR');
         if (!$id) {
             return $result;
         }
         $flag = empty($flag) ? 1 : 0;
         $rule = new Psys_AdsRule();
         $ret = $rule->updateStationAds(array('flag' => $flag), array('id' => $id));
         if ($ret) {
             $result['result'] = 'SUCCESS';
         }
         return $result;
     }
 }