From d876f4389e27d0eed423e20c1d953677fa09ce40 Mon Sep 17 00:00:00 2001 From: cloud Date: Fri, 26 Jun 2020 02:39:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B9=BF=E5=91=8A=E4=BD=8D?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E6=97=B6=E5=8F=AF=E4=BB=A5=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E5=A4=9A=E4=B8=AA=E5=B9=BF=E5=91=8A=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class/table_theme.class.php | 29 +++++++++++++++-------------- include/traits/tdata.class.php | 10 +++++++++- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/include/class/table_theme.class.php b/include/class/table_theme.class.php index 81d04ec..ae57448 100644 --- a/include/class/table_theme.class.php +++ b/include/class/table_theme.class.php @@ -730,8 +730,19 @@ class table_theme { $para = $tsql->table('para')->where(['p_type' => 3])->all(); $this->search['left'][] = self::para_select($para,['e_bno','门口方位']); //位置 - $para = $tsql->table('para')->where(['p_type' => 0])->all(); - $this->search['left'][] = self::para_select($para,['e_aps','位置']); + //位置 + $this->select2 = [ + '_fiend' => ['veaps','位置'], + 'placeholder' => '可选择多个位置', + 'fiend' => 'p_value', + 'tname' => 'para', + 'source' => 'search_para_eaps', + 'allnone' => 0, + 'condition' => 'p_type|||0' + ]; + $this->search['left'][] = self::input_select_search_multiple(); +// $para = $tsql->table('para')->where(['p_type' => 0])->all(); +// $this->search['left'][] = self::para_select($para,['e_aps','位置']); $this->search['left'][] = self::input_search('e_number','输入广告位编号'); //状态 // $this->search[] = self::para_select([['禁用',0],['启用',1]],['e_enable','状态'],true); @@ -773,18 +784,8 @@ class table_theme { $tsql = load::own_class('tsql','new'); $this->search[] = self::input_search(['e_number','广告位编号',$_M['form']['e_number']],'输入广告位编号'); //位置 - $this->select2 = [ - '_fiend' => ['veaps','位置'], - 'placeholder' => '可选择多个位置', - 'fiend' => 'p_value', - 'tname' => 'para', - 'source' => 'search_para_eaps', - 'allnone' => 0, - 'condition' => 'p_type|||0' - ]; - $this->search[] = self::input_select_search_multiple(); -// $para = $tsql->table('para')->where(['p_type' => 0])->all(); -// $this->search[] = self::para_select($para,['e_aps','位置']); + $para = $tsql->table('para')->where(['p_type' => 0])->all(); + $this->search[] = self::para_select($para,['e_aps','位置']); //门口方位 $para = $tsql->table('para')->where(['p_type' => 3])->all(); $this->search[] = self::para_select($para,['e_bno','门口方位']); diff --git a/include/traits/tdata.class.php b/include/traits/tdata.class.php index 31ac5b5..2f76be2 100644 --- a/include/traits/tdata.class.php +++ b/include/traits/tdata.class.php @@ -32,6 +32,13 @@ trait tdata { case 'applan': //判断是否可选的依据 if(!empty($this->form['slid'])) $where = " AND nla.id != '{$this->form['slid']}' "; + + // 不考虑导出的情况 + if(is_array($this->form['veaps'])){ + $veaps = parent::strchange(array_filter($this->form['veaps'])); + $this->villages_where = " e_aps IN($veaps) "; + } + //表 $sqlk = " {$_YW['k']['elevator']} AS el " . "LEFT JOIN (SELECT * FROM( SELECT DISTINCT( nel.e_number ) AS nowe_number,ANY_VALUE( nla.id ) AS nowid,ANY_VALUE( nla.l_title ) AS nowtitle,ANY_VALUE( nla.l_starttime ) AS nowstime,ANY_VALUE( nla.l_endtime ) AS nowetime,if(NOT ( nla.l_endtime < '{$curdate}' OR nla.l_starttime > '{$curdate}' ) OR nla.l_starttime > '{$curdate}',1,0) AS estate FROM {$_YW['k']['elevator']} AS nel LEFT JOIN {$_YW['k']['launch']} AS nla ON find_in_set( nel.e_number, nla.l_enumber ) WHERE NOT ( nla.l_endtime < '{$curdate}' OR nla.l_starttime > '{$curdate}' ) AND nla.id IS NOT NULL ORDER BY nowstime ASC ) eala GROUP BY nowe_number ) ala ON ala.nowe_number = el.e_number " @@ -291,8 +298,9 @@ trait tdata { switch ($this->tname) { case 'applan': $this->search_input = ['e_number']; - $this->search_other = ['e_aps','e_bno','e_vid','e_enable']; + $this->search_other = ['e_bno','e_vid','e_enable']; $where .= self::td_search(); + if(is_array($this->form['veaps'])) $where .= " AND {$this->villages_where} "; break; case 'elevators': $this->search_input = ['e_number'];