Exemplo n.º 1
0
 private function get_condition()
 {
     $condition = '';
     if (isset($this->input['k']) && !empty($this->input['k'])) {
         $condition .= ' AND grouptitle LIKE \'%' . trim($this->input['k']) . '%\'';
     }
     if (isset($this->input['app_uniqueid']) && $this->input['app_uniqueid'] != -1) {
         $app_uniqueid = $this->input['app_uniqueid'];
         $settingRelation = new settingRelation();
         $groupmark = $settingRelation->show(array('app_uniqueid' => $app_uniqueid), 0, 0, 'groupmark', 'groupmark', 0);
         if ($groupmark) {
             $condition .= ' AND groupmark IN (\'' . implode('\',\'', $groupmark) . '\')';
         }
     }
     return $condition;
 }
Exemplo n.º 2
0
 /**
  *
  * 根据应用标识取配置 ...
  * @param array $app_uniqueid
  */
 public function getConfig($app_uniqueid)
 {
     $re = array();
     if (is_array($app_uniqueid)) {
         $settingRelation = new settingRelation();
         $relationInfo = $settingRelation->show(array('app_uniqueid' => $app_uniqueid), 0, 0, 'app_uniqueid,groupmark', 'app_uniqueid', 3, 'groupmark');
         if ($relationInfo) {
             $_relationInfo = array();
             foreach ($relationInfo as $v) {
                 $_relationInfo = array_merge($_relationInfo, $v);
             }
             $configInfo = $this->show(array('groupmark' => array_unique($_relationInfo)), 0, 0, 'settitle,setname,description,groupmark,limitapps,type,value', 'groupmark', 'ORDER BY order_id DESC', array('limitapps' => array('type' => 'explode', 'delimiter' => "\n")), 2);
             foreach ($relationInfo as $key => $val) {
                 foreach ($configInfo as $k => $v) {
                     if (in_array($k, $val)) {
                         foreach ($v as $vv) {
                             if (empty($vv[limitapps]) || $vv[limitapps] && in_array($key, $vv[limitapps])) {
                                 $vv['value'] = outPutFormat($vv['type'], $vv['value'], array('img' => 1));
                                 unset($vv['limitapps'], $vv['groupmark'], $vv['type']);
                                 $re[$key][$k][$vv[setname]] = $vv;
                             }
                         }
                     }
                 }
             }
         }
     }
     return $re;
 }
Exemplo n.º 3
0
 private function get_condition()
 {
     $condition = '';
     if (isset($this->input['k']) && !empty($this->input['k'])) {
         $condition .= ' AND grouptitle LIKE \'%' . trim($this->input['k']) . '%\'';
     }
     if (isset($this->input['groupmark']) && $this->input['groupmark'] != -1) {
         $groupmark = $this->input['groupmark'];
         $condition .= ' AND groupmark = \'' . $groupmark . '\'';
     } else {
         if (isset($this->input['app_uniqueid']) && $this->input['app_uniqueid'] != -1 && (empty($this->input['groupmark']) || $this->input['groupmark'] == -1)) {
             if ($app_uniqueid = trim($this->input['app_uniqueid'])) {
                 $settingRelation = new settingRelation();
                 $groupmark = $settingRelation->show(array('app_uniqueid' => $app_uniqueid), 0, 0, 'groupmark', 'groupmark', 0);
                 if ($groupmark) {
                     $groupMarkWhere = trim("'" . implode("','", $groupmark) . "'");
                     if (count($groupmark) > 1) {
                         $condition .= ' AND groupmark IN (' . $groupMarkWhere . ')';
                     } else {
                         $condition .= ' AND groupmark = ' . $groupMarkWhere;
                     }
                 }
             }
         }
     }
     return $condition;
 }