调整场所默认按照地址排序
This commit is contained in:
parent
aafced32ac
commit
8e99421a15
|
|
@ -3,6 +3,7 @@
|
|||
defined('IN_MET') or exit('No permission');
|
||||
|
||||
load::own_class('../traits/tfield');
|
||||
|
||||
class table_theme {
|
||||
|
||||
//表字库
|
||||
|
|
@ -17,20 +18,16 @@ class table_theme {
|
|||
private $own_name_info;
|
||||
//头部搜索HTML
|
||||
private $search;
|
||||
|
||||
|
||||
//是否开启搜索
|
||||
private $search_bool = true;
|
||||
//开启底部按钮
|
||||
private $btn_bool = true;
|
||||
//返回值
|
||||
private $goret;
|
||||
|
||||
//全选按钮框
|
||||
private $checkall = true;
|
||||
//尾部的操作
|
||||
private $lastbtn = true;
|
||||
|
||||
// select2筛选
|
||||
private $select2 = [];
|
||||
//多行头部
|
||||
|
|
@ -45,9 +42,7 @@ class table_theme {
|
|||
|
||||
//这个前台已经涉及到,需要现在更换
|
||||
$this->select2 = [
|
||||
'url' => class_exists('admin') || class_exists('app')
|
||||
? $_M['url']['own_name'].'c=select&a=doselect'
|
||||
: $_M['url']['site'].'app/index.php?n=dzadsod&c=select&a=doselect',
|
||||
'url' => class_exists('admin') || class_exists('app') ? $_M['url']['own_name'] . 'c=select&a=doselect' : $_M['url']['site'] . 'app/index.php?n=dzadsod&c=select&a=doselect',
|
||||
'_fiend' => [],
|
||||
'placeholder' => '',
|
||||
'fiend' => '',
|
||||
|
|
@ -96,13 +91,13 @@ class table_theme {
|
|||
$datas[$key] = self::row_datas($val, $keys);
|
||||
} else {
|
||||
$datas[$val] = $this->th_head[$val];
|
||||
if(!in_array($val, $keys,true)) unset($this->th_head[$val]);
|
||||
if (!in_array($val, $keys, true))
|
||||
unset($this->th_head[$val]);
|
||||
}
|
||||
}
|
||||
return $datas;
|
||||
}
|
||||
|
||||
|
||||
//表格头部
|
||||
public function thead() {
|
||||
global $_M, $_YW;
|
||||
|
|
@ -118,10 +113,10 @@ class table_theme {
|
|||
$datas[$key] = self::row_datas($keydata, $keys);
|
||||
$this->th_head[$key] = $thtitle;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($this->checkall) $this->goret['thead'] = '<th width="50" data-table-columnclass="text-xs-center" '.$rowspan.'>
|
||||
if ($this->checkall)
|
||||
$this->goret['thead'] = '<th width="50" data-table-columnclass="text-xs-center" ' . $rowspan . '>
|
||||
<span class="checkbox-custom checkbox-primary ap-all">
|
||||
<input class="selectable-all" type="checkbox">
|
||||
<label></label>
|
||||
|
|
@ -146,9 +141,11 @@ class table_theme {
|
|||
//正常的th
|
||||
$this->goret['thead'] .= '<th ' . $class . $rowspanb . $colspanb . '>' . $val . '</th>';
|
||||
}
|
||||
if($this->lastbtn) $this->goret['thead'] .= '<th data-table-columnclass="text-xs-center" '.$class.$rowspan.'>操作</th>';
|
||||
if ($this->lastbtn)
|
||||
$this->goret['thead'] .= '<th data-table-columnclass="text-xs-center" ' . $class . $rowspan . '>操作</th>';
|
||||
$this->goret['thead'] = '<tr>' . $this->goret['thead'] . '</tr>';
|
||||
if($thead) $this->goret['thead'] .= '<tr>'.$thead.'</tr>';
|
||||
if ($thead)
|
||||
$this->goret['thead'] .= '<tr>' . $thead . '</tr>';
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
@ -156,8 +153,10 @@ class table_theme {
|
|||
// @$dvalue int 两个按钮组 的差值
|
||||
public function tfoot($dvalue = 2) {
|
||||
global $_M, $_YW;
|
||||
if($this->btn_bool == false) return $this;
|
||||
if($this->checkall) $this->goret['tfoot'] = '<th>
|
||||
if ($this->btn_bool == false)
|
||||
return $this;
|
||||
if ($this->checkall)
|
||||
$this->goret['tfoot'] = '<th>
|
||||
<span class="checkbox-custom checkbox-primary ap-all">
|
||||
<input class="selectable-all" type="checkbox">
|
||||
<label></label>
|
||||
|
|
@ -204,7 +203,6 @@ class table_theme {
|
|||
// +----------------------------------------------------------------------
|
||||
// | 内部方法
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
//计算表格col
|
||||
protected function colspan() {
|
||||
$tdcol = $this->checkall && $this->lastbtn ? 2 : ($this->checkall || $this->lastbtn ? 1 : 0);
|
||||
|
|
@ -315,7 +313,8 @@ class table_theme {
|
|||
public function para_select($para, $_fiend, $exists = false, $option = true) {
|
||||
global $_M, $_YW;
|
||||
list($name, $title, $value) = self::fiend_data($_fiend);
|
||||
if($option) $option = '<option value="">全部</option>';
|
||||
if ($option)
|
||||
$option = '<option value="">全部</option>';
|
||||
foreach ($para as $key => $val) {
|
||||
if ($exists) {
|
||||
list($p_name, $p_value) = $val;
|
||||
|
|
@ -375,6 +374,7 @@ class table_theme {
|
|||
* @$fiend array 字段数组,包含字段名和字段标题
|
||||
* @$title string 替换字段数组得到字段标题
|
||||
*/
|
||||
|
||||
protected function fiend_data($_fiend) {
|
||||
global $_M, $_YW;
|
||||
list($name, $title, $value) = is_array($_fiend) ? $_fiend : [$_fiend];
|
||||
|
|
@ -397,7 +397,8 @@ class table_theme {
|
|||
// $position 决定内容在字符的前后显示
|
||||
protected function th_tooltip($tooltip = [], $str = '', $position = true) {
|
||||
global $_M, $_YW;
|
||||
if(!is_array($tooltip)) $tooltip = [$tooltip];
|
||||
if (!is_array($tooltip))
|
||||
$tooltip = [$tooltip];
|
||||
list($title, $placement, $trigger, $key) = $tooltip;
|
||||
$placement = $placement ?: 'bottom';
|
||||
$trigger = $trigger ?: 'hover';
|
||||
|
|
@ -410,11 +411,9 @@ class table_theme {
|
|||
return $position ? $str . $toolstr : $toolstr . $str;
|
||||
}
|
||||
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | 各表处理
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
//广告位列表
|
||||
protected function elevator() {
|
||||
global $_M, $_YW;
|
||||
|
|
@ -889,7 +888,6 @@ class table_theme {
|
|||
if ($this->btn_bool) {
|
||||
$this->btn[] = '<button type="button" class="btn btn-warning btn-sm backups" data-url="' . $_YW['url']['backup'] . '">导出Excel</button>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 首页统计
|
||||
|
|
@ -903,6 +901,7 @@ class table_theme {
|
|||
|
||||
//搜索
|
||||
if ($this->search_bool) {
|
||||
|
||||
}
|
||||
|
||||
//搜索
|
||||
|
|
@ -917,7 +916,6 @@ class table_theme {
|
|||
if ($this->btn_bool) {
|
||||
$this->btn[] = '<button type="button" class="btn btn-warning btn-sm backups" data-url="' . $_YW['url']['backup'] . '">导出Excel</button>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//前台巡查页面
|
||||
|
|
@ -991,5 +989,4 @@ class table_theme {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,9 @@ trait tdata {
|
|||
private $search_link = [];
|
||||
//跳过替换为突出显示的字段
|
||||
private $skip_field = [];
|
||||
|
||||
// 场所统计查询内的公用where
|
||||
private $villages_where = '';
|
||||
|
||||
|
||||
//表名
|
||||
public function td_sqlk() {
|
||||
global $_M, $_YW;
|
||||
|
|
@ -31,7 +29,8 @@ trait tdata {
|
|||
switch ($this->tname) {
|
||||
case 'applan':
|
||||
//判断是否可选的依据
|
||||
if(!empty($this->form['slid'])) $where = " AND nla.id != '{$this->form['slid']}' ";
|
||||
if (!empty($this->form['slid']))
|
||||
$where = " AND nla.id != '{$this->form['slid']}' ";
|
||||
|
||||
//表
|
||||
$sqlk = " {$_YW['k']['elevator']} AS el "
|
||||
|
|
@ -53,6 +52,7 @@ trait tdata {
|
|||
break;
|
||||
case 'villages':
|
||||
$son = " FROM {$_YW['k']['countela']} AS el WHERE ";
|
||||
|
||||
//判断执行默认还是时间区段
|
||||
$bool = false;
|
||||
if ($this->form['vs_starttime'] || $this->form['vs_endtime']) {
|
||||
|
|
@ -70,7 +70,8 @@ trait tdata {
|
|||
|
||||
// 计算是否区分广告位
|
||||
// 检测是否通过JS传递的广告位参数,也就是导出
|
||||
if(isset($this->form['jsadd_veaps'])) $this->form['veaps'] = stringto_array($this->form['jsadd_veaps'],',');
|
||||
if (isset($this->form['jsadd_veaps']))
|
||||
$this->form['veaps'] = stringto_array($this->form['jsadd_veaps'], ',');
|
||||
if (is_array($this->form['veaps'])) {
|
||||
$veaps = parent::strchange(array_filter($this->form['veaps']));
|
||||
$this->villages_where = " el.e_aps IN($veaps) ";
|
||||
|
|
@ -166,10 +167,12 @@ trait tdata {
|
|||
* 【列出】
|
||||
* 同时满足条件的,非OR
|
||||
*/
|
||||
|
||||
public function td_search($link = true) {
|
||||
global $_M, $_YW;
|
||||
//默认input字段为link搜索
|
||||
if($link) $this->search_link = array_unique(array_merge($this->search_input,$this->search_link));
|
||||
if ($link)
|
||||
$this->search_link = array_unique(array_merge($this->search_input, $this->search_link));
|
||||
//合成得带搜索字段
|
||||
$field = array_unique(array_merge($this->search_input, $this->search_other));
|
||||
//判断是否为链表查询
|
||||
|
|
@ -286,6 +289,7 @@ trait tdata {
|
|||
* 【列出】
|
||||
* SQL判断语句$where .= $this->search();
|
||||
*/
|
||||
|
||||
public function td_where() {
|
||||
global $_M, $_YW;
|
||||
$where = " 1=1 ";
|
||||
|
|
@ -306,7 +310,8 @@ trait tdata {
|
|||
$this->search_field = ['el.e_number', 'el.e_aps', 'el.e_bno', 'el.e_vid', 'el.e_enable', 'cla.endid', 'ala.nowid', 'bla.nextid'];
|
||||
$where .= self::td_search();
|
||||
//判断是否为备份
|
||||
if($this->bsign) parent::where_id($where);
|
||||
if ($this->bsign)
|
||||
parent::where_id($where);
|
||||
self::td_groupby($where);
|
||||
break;
|
||||
case 'patrol':
|
||||
|
|
@ -380,11 +385,13 @@ trait tdata {
|
|||
$this->form['v_city'] = $this->form['v_address'];
|
||||
$this->form['v_district'] = $this->form['v_address'];
|
||||
|
||||
if(is_array($this->form['veaps'])) $where .= " AND {$this->villages_where} ";
|
||||
if (is_array($this->form['veaps']))
|
||||
$where .= " AND {$this->villages_where} ";
|
||||
$where .= self::td_search_or($this->search_link);
|
||||
$where .= self::td_search();
|
||||
//判断是否为备份
|
||||
if($this->bsign) parent::where_id($where);
|
||||
if ($this->bsign)
|
||||
parent::where_id($where);
|
||||
self::td_groupby($where);
|
||||
break;
|
||||
case 'schedule':
|
||||
|
|
@ -415,7 +422,8 @@ trait tdata {
|
|||
switch ($this->tname) {
|
||||
case 'elevators':
|
||||
$where .= " GROUP BY el.e_number ";
|
||||
if($this->form['endtime']) $where .= " HAVING endtime < '{$this->form['endtime']}' ";
|
||||
if ($this->form['endtime'])
|
||||
$where .= " HAVING endtime < '{$this->form['endtime']}' ";
|
||||
break;
|
||||
case 'patrol':
|
||||
$where .= " GROUP BY el.e_number ";
|
||||
|
|
@ -439,6 +447,7 @@ trait tdata {
|
|||
* 【列出】
|
||||
* SQL排序方式语句
|
||||
*/
|
||||
|
||||
public function td_order() {
|
||||
global $_M;
|
||||
switch ($this->tname) {
|
||||
|
|
@ -447,29 +456,41 @@ trait tdata {
|
|||
//按照正常排序,对比相邻广告位的投放广告品类
|
||||
// order_e_types 按照是否可投放进行排序
|
||||
if ($this->form['eaps_order'] || $this->form['order_e_types']) {
|
||||
if(!$this->form['order_e_types']) $this->form['order_e_types'] = ' ASC ';
|
||||
if (!$this->form['order_e_types'])
|
||||
$this->form['order_e_types'] = ' ASC ';
|
||||
$order .= ", `lanum` {$this->form['order_e_types']} ";
|
||||
}
|
||||
if ($this->form['eaps_order'] == 2) {
|
||||
// 传递进来的编号,不直接查数据是因为有些可能会出现错误,所以直接使用传递进来的,进行排序
|
||||
$array = array_filter(stringto_array($this->form['l_selectenum'], ','));
|
||||
$idstr = parent::strchange($array);
|
||||
if(strlen($idstr)) $order = " `e_number` IN({$idstr}) DESC, ".$order;
|
||||
if (strlen($idstr))
|
||||
$order = " `e_number` IN({$idstr}) DESC, " . $order;
|
||||
}
|
||||
$order .= ", `e_vid` ASC, `e_bno` ASC, `e_aps` ASC ";
|
||||
break;
|
||||
case 'elevators':
|
||||
$order = " `etypes` DESC, endtime DESC, el.`e_vid` ASC, el.`e_bno` ASC, el.`e_aps` ASC ";
|
||||
if($this->form['order_e_number']) $order = " el.e_number {$this->form['order_e_number']} ";
|
||||
if($this->form['order_endtime']) $order = " endtime {$this->form['order_endtime']} ";
|
||||
if($this->form['order_e_totalnum']) $order = " e_totalnum {$this->form['order_e_totalnum']} ";
|
||||
if($this->form['order_etypes']) $order = " `etypes` {$this->form['order_etypes']} ";
|
||||
if($this->form['order_nowstime']) $order = " nowstime {$this->form['order_nowstime']} ";
|
||||
if($this->form['order_nowetime']) $order = " nowetime {$this->form['order_nowetime']} ";
|
||||
if($this->form['order_nextstime']) $order = " nextstime {$this->form['order_nextstime']} ";
|
||||
if($this->form['order_nextetime']) $order = " nextetime {$this->form['order_nextetime']} ";
|
||||
if($this->form['order_endstime']) $order = " endstime {$this->form['order_endstime']} ";
|
||||
if($this->form['order_endetime']) $order = " endetime {$this->form['order_endetime']} ";
|
||||
if ($this->form['order_e_number'])
|
||||
$order = " el.e_number {$this->form['order_e_number']} ";
|
||||
if ($this->form['order_endtime'])
|
||||
$order = " endtime {$this->form['order_endtime']} ";
|
||||
if ($this->form['order_e_totalnum'])
|
||||
$order = " e_totalnum {$this->form['order_e_totalnum']} ";
|
||||
if ($this->form['order_etypes'])
|
||||
$order = " `etypes` {$this->form['order_etypes']} ";
|
||||
if ($this->form['order_nowstime'])
|
||||
$order = " nowstime {$this->form['order_nowstime']} ";
|
||||
if ($this->form['order_nowetime'])
|
||||
$order = " nowetime {$this->form['order_nowetime']} ";
|
||||
if ($this->form['order_nextstime'])
|
||||
$order = " nextstime {$this->form['order_nextstime']} ";
|
||||
if ($this->form['order_nextetime'])
|
||||
$order = " nextetime {$this->form['order_nextetime']} ";
|
||||
if ($this->form['order_endstime'])
|
||||
$order = " endstime {$this->form['order_endstime']} ";
|
||||
if ($this->form['order_endetime'])
|
||||
$order = " endetime {$this->form['order_endetime']} ";
|
||||
if ($this->form['order_e_address']) {
|
||||
$e_address = $this->form['order_e_address'];
|
||||
$order = " el.e_vid {$e_address}, el.e_bno {$e_address}, el.e_aps {$e_address} ";
|
||||
|
|
@ -483,13 +504,17 @@ trait tdata {
|
|||
break;
|
||||
case 'launch':
|
||||
$order = " `id` DESC ";
|
||||
if($this->form['order_l_starttime']) $order = " l_starttime {$this->form['order_l_starttime']} ";
|
||||
if($this->form['order_l_endtime']) $order = " l_endtime {$this->form['order_l_endtime']} ";
|
||||
if ($this->form['order_l_starttime'])
|
||||
$order = " l_starttime {$this->form['order_l_starttime']} ";
|
||||
if ($this->form['order_l_endtime'])
|
||||
$order = " l_endtime {$this->form['order_l_endtime']} ";
|
||||
break;
|
||||
case 'contract':
|
||||
$order = ' ch.`id` DESC';
|
||||
if($this->form['order_h_starttime']) $order = " ch.h_starttime {$this->form['order_h_starttime']} ";
|
||||
if($this->form['order_h_endtime']) $order = " ch.h_endtime {$this->form['order_h_endtime']} ";
|
||||
if ($this->form['order_h_starttime'])
|
||||
$order = " ch.h_starttime {$this->form['order_h_starttime']} ";
|
||||
if ($this->form['order_h_endtime'])
|
||||
$order = " ch.h_endtime {$this->form['order_h_endtime']} ";
|
||||
break;
|
||||
case 'schedule':
|
||||
$order = ' la.l_starttime DESC,la.`id` DESC';
|
||||
|
|
@ -497,23 +522,35 @@ trait tdata {
|
|||
if ($this->bsign) {
|
||||
$order = " el.`e_vid` ASC, el.`e_bno` ASC, el.`e_aps` ASC ";
|
||||
}
|
||||
if($this->form['order_l_starttime']) $order = " la.l_starttime {$this->form['order_l_starttime']} ";
|
||||
if($this->form['order_l_endtime']) $order = " la.l_endtime {$this->form['order_l_endtime']} ";
|
||||
if ($this->form['order_l_starttime'])
|
||||
$order = " la.l_starttime {$this->form['order_l_starttime']} ";
|
||||
if ($this->form['order_l_endtime'])
|
||||
$order = " la.l_endtime {$this->form['order_l_endtime']} ";
|
||||
break;
|
||||
case 'villages':
|
||||
$order = ' vi.`id` DESC';
|
||||
if($this->form['order_v_enum']) $order = " v_enum {$this->form['order_v_enum']} ";
|
||||
if($this->form['order_v_free']) $order = " v_free {$this->form['order_v_free']} ";
|
||||
if($this->form['order_v_lease']) $order = " v_lease {$this->form['order_v_lease']} ";
|
||||
if($this->form['order_v_endday']) $order = " v_endday {$this->form['order_v_endday']} ";
|
||||
if($this->form['order_v_prerow']) $order = " v_prerow {$this->form['order_v_prerow']} ";
|
||||
if($this->form['order_v_ebnonum']) $order = " v_ebnonum {$this->form['order_v_ebnonum']} ";
|
||||
if($this->form['order_v_bno']) $order = " v_bno {$this->form['order_v_bno']} ";
|
||||
$order = ' CONVERT( vi.`v_address` USING gbk ) COLLATE gbk_chinese_ci ASC ';
|
||||
if ($this->form['order_v_enum'])
|
||||
$order = " v_enum {$this->form['order_v_enum']} ";
|
||||
if ($this->form['order_v_free'])
|
||||
$order = " v_free {$this->form['order_v_free']} ";
|
||||
if ($this->form['order_v_lease'])
|
||||
$order = " v_lease {$this->form['order_v_lease']} ";
|
||||
if ($this->form['order_v_endday'])
|
||||
$order = " v_endday {$this->form['order_v_endday']} ";
|
||||
if ($this->form['order_v_prerow'])
|
||||
$order = " v_prerow {$this->form['order_v_prerow']} ";
|
||||
if ($this->form['order_v_ebnonum'])
|
||||
$order = " v_ebnonum {$this->form['order_v_ebnonum']} ";
|
||||
if ($this->form['order_v_bno'])
|
||||
$order = " v_bno {$this->form['order_v_bno']} ";
|
||||
|
||||
break;
|
||||
case 'para':
|
||||
$order = ' `id` DESC';
|
||||
if($this->form['order_p_type']) $order = " `p_type` {$this->form['order_p_type']} ";
|
||||
if($this->form['order_p_order']) $order = " `p_order` {$this->form['order_p_order']} ";
|
||||
if ($this->form['order_p_type'])
|
||||
$order = " `p_type` {$this->form['order_p_type']} ";
|
||||
if ($this->form['order_p_order'])
|
||||
$order = " `p_order` {$this->form['order_p_order']} ";
|
||||
break;
|
||||
case 'noticeday':
|
||||
$order = ' `endtime` ASC, `h_endtime` ASC ';
|
||||
|
|
|
|||
Loading…
Reference in New Issue