调整场所默认按照地址排序
This commit is contained in:
parent
aafced32ac
commit
8e99421a15
File diff suppressed because it is too large
Load Diff
|
|
@ -18,20 +18,19 @@ trait tdata {
|
|||
private $search_link = [];
|
||||
//跳过替换为突出显示的字段
|
||||
private $skip_field = [];
|
||||
|
||||
// 场所统计查询内的公用where
|
||||
private $villages_where = '';
|
||||
|
||||
|
||||
//表名
|
||||
public function td_sqlk() {
|
||||
global $_M,$_YW;
|
||||
global $_M, $_YW;
|
||||
//当天日期时间
|
||||
$curdate = date('Y-m-d',time());
|
||||
$curdate = date('Y-m-d', time());
|
||||
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,16 +52,17 @@ trait tdata {
|
|||
break;
|
||||
case 'villages':
|
||||
$son = " FROM {$_YW['k']['countela']} AS el WHERE ";
|
||||
|
||||
//判断执行默认还是时间区段
|
||||
$bool = false;
|
||||
if($this->form['vs_starttime'] || $this->form['vs_endtime']){
|
||||
if ($this->form['vs_starttime'] || $this->form['vs_endtime']) {
|
||||
$bool = true;
|
||||
$this->form['vs_starttime'] = $this->form['vs_starttime']?:$curdate;
|
||||
$this->form['vs_endtime'] = $this->form['vs_endtime']?:$curdate;
|
||||
if(strtotime($this->form['vs_starttime']) > strtotime($this->form['vs_endtime'])){
|
||||
$this->form['vs_starttime'] = $this->form['vs_starttime'] ?: $curdate;
|
||||
$this->form['vs_endtime'] = $this->form['vs_endtime'] ?: $curdate;
|
||||
if (strtotime($this->form['vs_starttime']) > strtotime($this->form['vs_endtime'])) {
|
||||
$vs_starttime = $this->form['vs_endtime'];
|
||||
$vs_endtime = $this->form['vs_starttime'];
|
||||
}else{
|
||||
} else {
|
||||
$vs_starttime = $this->form['vs_starttime'];
|
||||
$vs_endtime = $this->form['vs_endtime'];
|
||||
}
|
||||
|
|
@ -70,15 +70,16 @@ trait tdata {
|
|||
|
||||
// 计算是否区分广告位
|
||||
// 检测是否通过JS传递的广告位参数,也就是导出
|
||||
if(isset($this->form['jsadd_veaps'])) $this->form['veaps'] = stringto_array($this->form['jsadd_veaps'],',');
|
||||
if(is_array($this->form['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) ";
|
||||
$son .= " {$this->villages_where} AND ";
|
||||
}
|
||||
|
||||
// 空置计算要排除当前排期中的广告位
|
||||
if($bool){
|
||||
if ($bool) {
|
||||
//加上时间区块 那就是查看在区段内的情况
|
||||
//增加 s_enable 判断是为了防止过去时间
|
||||
//空置
|
||||
|
|
@ -93,7 +94,7 @@ trait tdata {
|
|||
$dwhere = " {$son} el.l_endtime BETWEEN '{$vs_starttime}' AND '{$vs_endtime}' ";
|
||||
//预排
|
||||
$pwhere = " {$son} NOT(el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') AND el.l_starttime > '{$curdate}' ";
|
||||
}else{
|
||||
} else {
|
||||
//没有时间区段,则按照当天为准则,默认值
|
||||
//空置,其他不包含当天的
|
||||
$fwhere = " {$son} NOT EXISTS (SELECT ela.e_number FROM {$_YW['k']['countela']} AS ela WHERE NOT ( ela.l_endtime < '{$curdate}' OR ela.l_starttime > '{$curdate}' ) AND ela.e_number = el.e_number) AND (el.l_endtime < '{$curdate}' OR el.l_starttime > '{$curdate}' OR el.l_id IS NULL) AND el.e_enable = 1 ";
|
||||
|
|
@ -131,7 +132,7 @@ trait tdata {
|
|||
|
||||
//字段
|
||||
public function td_field() {
|
||||
global $_M,$_YW;
|
||||
global $_M, $_YW;
|
||||
switch ($this->tname) {
|
||||
case 'applan':
|
||||
$field = '*';
|
||||
|
|
@ -166,22 +167,24 @@ trait tdata {
|
|||
* 【列出】
|
||||
* 同时满足条件的,非OR
|
||||
*/
|
||||
|
||||
public function td_search($link = true) {
|
||||
global $_M,$_YW;
|
||||
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));
|
||||
$field = array_unique(array_merge($this->search_input, $this->search_other));
|
||||
//判断是否为链表查询
|
||||
$join_field = array_combine($field,count($this->search_field) > 0?$this->search_field:$field);
|
||||
$join_field = array_combine($field, count($this->search_field) > 0 ? $this->search_field : $field);
|
||||
|
||||
//相对独立的搜索
|
||||
$arrwhere = [];
|
||||
foreach ($field as $val) {
|
||||
$search = trim(strtoupper($this->form[$val]));
|
||||
if(strlen($search) > 0) {
|
||||
if (strlen($search) > 0) {
|
||||
$str = $join_field[$val];
|
||||
if(in_array($val, $this->search_link)){
|
||||
if (in_array($val, $this->search_link)) {
|
||||
$arrwhere[] = " {$str} LIKE '%{$search}%' ";
|
||||
continue;
|
||||
}
|
||||
|
|
@ -191,25 +194,25 @@ trait tdata {
|
|||
|
||||
//返回内容
|
||||
$where = '';
|
||||
if(count($arrwhere) > 0){
|
||||
if (count($arrwhere) > 0) {
|
||||
$where = ' AND ';
|
||||
$where .= arrayto_string($arrwhere,' AND ');
|
||||
$where .= arrayto_string($arrwhere, ' AND ');
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
//OR 内容搜索
|
||||
public function td_search_or($orfield,$search_field = []) {
|
||||
global $_M,$_YW;
|
||||
public function td_search_or($orfield, $search_field = []) {
|
||||
global $_M, $_YW;
|
||||
//判断是否为链表查询
|
||||
$join_field = array_combine($orfield,count($search_field) > 0?$search_field:$orfield);
|
||||
$join_field = array_combine($orfield, count($search_field) > 0 ? $search_field : $orfield);
|
||||
//相对独立的搜索
|
||||
$arrwhere = [];
|
||||
foreach ($orfield as $val) {
|
||||
$search = trim(strtoupper($this->form[$val]));
|
||||
if(strlen($search) > 0) {
|
||||
if (strlen($search) > 0) {
|
||||
$str = $join_field[$val];
|
||||
if(in_array($val, $this->search_link)){
|
||||
if (in_array($val, $this->search_link)) {
|
||||
$arrwhere[] = " {$str} LIKE '%{$search}%' ";
|
||||
continue;
|
||||
}
|
||||
|
|
@ -219,27 +222,27 @@ trait tdata {
|
|||
|
||||
//返回内容
|
||||
$where = '';
|
||||
if(count($arrwhere) > 0){
|
||||
$where .= arrayto_string($arrwhere,' OR ');
|
||||
if (count($arrwhere) > 0) {
|
||||
$where .= arrayto_string($arrwhere, ' OR ');
|
||||
}
|
||||
return strlen($where) > 0 ?" AND ({$where}) ":'';
|
||||
return strlen($where) > 0 ? " AND ({$where}) " : '';
|
||||
}
|
||||
|
||||
//时间区间
|
||||
public function td_time_search($field,$search_field = []) {
|
||||
global $_M,$_YW;
|
||||
list($start,$end) = $field;
|
||||
public function td_time_search($field, $search_field = []) {
|
||||
global $_M, $_YW;
|
||||
list($start, $end) = $field;
|
||||
//判断是否为链表查询
|
||||
$join_field = array_combine($field,count($search_field) > 0?$search_field:$field);
|
||||
$join_field = array_combine($field, count($search_field) > 0 ? $search_field : $field);
|
||||
//相对独立的搜索
|
||||
$arrwhere = [];
|
||||
foreach ($field as $val) {
|
||||
$search = trim(strtoupper($this->form[$val]));
|
||||
if(strlen($search) > 0) {
|
||||
if (strlen($search) > 0) {
|
||||
$str = $join_field[$val];
|
||||
if($val == $start){
|
||||
if ($val == $start) {
|
||||
$arrwhere[] = " {$str} >= '{$search}' ";
|
||||
}else{
|
||||
} else {
|
||||
$arrwhere[] = " {$str} <= '{$search}' ";
|
||||
}
|
||||
}
|
||||
|
|
@ -247,28 +250,28 @@ trait tdata {
|
|||
|
||||
//返回内容
|
||||
$where = '';
|
||||
if(count($arrwhere) > 0){
|
||||
$where .= arrayto_string($arrwhere," AND ");
|
||||
if (count($arrwhere) > 0) {
|
||||
$where .= arrayto_string($arrwhere, " AND ");
|
||||
}
|
||||
return strlen($where) > 0 ?" AND ({$where}) ":'';
|
||||
return strlen($where) > 0 ? " AND ({$where}) " : '';
|
||||
}
|
||||
|
||||
//获取重叠的时间区间
|
||||
// $search_field 开始时间和结束时间的字段互相调换,结束的字段在前面
|
||||
public function td_time_orsearch($field,$search_field = []) {
|
||||
global $_M,$_YW;
|
||||
list($start,$end) = $field;
|
||||
public function td_time_orsearch($field, $search_field = []) {
|
||||
global $_M, $_YW;
|
||||
list($start, $end) = $field;
|
||||
//判断是否为链表查询
|
||||
$join_field = array_combine($field,count($search_field) > 0?$search_field:$field);
|
||||
$join_field = array_combine($field, count($search_field) > 0 ? $search_field : $field);
|
||||
//相对独立的搜索
|
||||
$arrwhere = [];
|
||||
foreach ($field as $val) {
|
||||
$search = trim(strtoupper($this->form[$val]));
|
||||
if(strlen($search) > 0) {
|
||||
if (strlen($search) > 0) {
|
||||
$str = $join_field[$val];
|
||||
if($val == $start){
|
||||
if ($val == $start) {
|
||||
$arrwhere[] = " {$str} < '{$search}' "; //结束字段,搜索为开始时间
|
||||
}else{
|
||||
} else {
|
||||
$arrwhere[] = " {$str} > '{$search}' "; //开始字段,搜索为结束时间
|
||||
}
|
||||
}
|
||||
|
|
@ -276,25 +279,26 @@ trait tdata {
|
|||
|
||||
//返回内容
|
||||
$where = '';
|
||||
if(count($arrwhere) > 0){
|
||||
$where .= arrayto_string($arrwhere," OR ");
|
||||
if (count($arrwhere) > 0) {
|
||||
$where .= arrayto_string($arrwhere, " OR ");
|
||||
}
|
||||
return strlen($where) > 0 ?" AND NOT({$where}) ":'';
|
||||
return strlen($where) > 0 ? " AND NOT({$where}) " : '';
|
||||
}
|
||||
|
||||
/*
|
||||
* 【列出】
|
||||
* SQL判断语句$where .= $this->search();
|
||||
*/
|
||||
|
||||
public function td_where() {
|
||||
global $_M,$_YW;
|
||||
global $_M, $_YW;
|
||||
$where = " 1=1 ";
|
||||
switch ($this->tname) {
|
||||
case 'applan':
|
||||
$this->search_input = ['e_number'];
|
||||
$this->search_other = ['e_bno','e_vid','e_enable'];
|
||||
$this->search_other = ['e_bno', 'e_vid', 'e_enable'];
|
||||
$where .= self::td_search();
|
||||
if(is_array($this->form['e_aps'])) {
|
||||
if (is_array($this->form['e_aps'])) {
|
||||
// 不考虑导出的情况
|
||||
$veaps = parent::strchange(array_filter($this->form['e_aps']));
|
||||
$where .= " AND e_aps IN($veaps) ";
|
||||
|
|
@ -302,17 +306,18 @@ trait tdata {
|
|||
break;
|
||||
case 'elevators':
|
||||
$this->search_input = ['e_number'];
|
||||
$this->search_other = ['e_aps','e_bno','e_vid','e_enable','endid','nowid','nextid'];
|
||||
$this->search_field = ['el.e_number','el.e_aps','el.e_bno','el.e_vid','el.e_enable','cla.endid','ala.nowid','bla.nextid'];
|
||||
$this->search_other = ['e_aps', 'e_bno', 'e_vid', 'e_enable', 'endid', 'nowid', 'nextid'];
|
||||
$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':
|
||||
$this->search_input = ['e_number'];
|
||||
$this->search_other = ['e_aps','e_bno','e_vid','e_enable','nowid','l_hnumber'];
|
||||
$this->search_field = ['el.e_number','el.e_aps','el.e_bno','el.e_vid','el.e_enable','ala.nowid','la.l_hnumber'];
|
||||
$this->search_other = ['e_aps', 'e_bno', 'e_vid', 'e_enable', 'nowid', 'l_hnumber'];
|
||||
$this->search_field = ['el.e_number', 'el.e_aps', 'el.e_bno', 'el.e_vid', 'el.e_enable', 'ala.nowid', 'la.l_hnumber'];
|
||||
$where .= self::td_search();
|
||||
|
||||
//不看空位
|
||||
|
|
@ -321,45 +326,45 @@ trait tdata {
|
|||
self::td_groupby($where);
|
||||
break;
|
||||
case 'elevator':
|
||||
$this->search_input = ['e_number','e_label','e_text'];
|
||||
$this->search_other = ['e_aps','e_bno','e_vid','e_enable'];
|
||||
$this->search_input = ['e_number', 'e_label', 'e_text'];
|
||||
$this->search_other = ['e_aps', 'e_bno', 'e_vid', 'e_enable'];
|
||||
$where .= self::td_search();
|
||||
case 'village':
|
||||
$this->search_input = ['v_name','v_text'];
|
||||
$this->search_input = ['v_name', 'v_text'];
|
||||
$where .= self::td_search();
|
||||
|
||||
$this->search_link = ['v_province','v_city','v_district','v_address'];
|
||||
$this->search_field = ['vi.v_name','vi.v_text','vi.v_province','vi.v_city','vi.v_district','vi.v_address'];
|
||||
$this->search_link = ['v_province', 'v_city', 'v_district', 'v_address'];
|
||||
$this->search_field = ['vi.v_name', 'vi.v_text', 'vi.v_province', 'vi.v_city', 'vi.v_district', 'vi.v_address'];
|
||||
$this->form['v_province'] = $this->form['v_address'];
|
||||
$this->form['v_city'] = $this->form['v_address'];
|
||||
$this->form['v_district'] = $this->form['v_address'];
|
||||
|
||||
$where .= self::td_search_or($this->search_link,['vi.v_province','vi.v_city','vi.v_district','vi.v_address']);
|
||||
$where .= self::td_search_or($this->search_link, ['vi.v_province', 'vi.v_city', 'vi.v_district', 'vi.v_address']);
|
||||
self::td_groupby($where);
|
||||
break;
|
||||
case 'customer':
|
||||
$this->search_input = ['c_text'];
|
||||
$this->search_link = ['c_allname','c_name','c_province','c_city','c_district','c_address'];
|
||||
$this->search_link = ['c_allname', 'c_name', 'c_province', 'c_city', 'c_district', 'c_address'];
|
||||
//名称
|
||||
$this->form['c_name'] = $this->form['c_allname'];
|
||||
$where .= self::td_search_or(['c_allname','c_name']);
|
||||
$where .= self::td_search_or(['c_allname', 'c_name']);
|
||||
//地址
|
||||
$this->form['c_province'] = $this->form['c_address'];
|
||||
$this->form['c_city'] = $this->form['c_address'];
|
||||
$this->form['c_district'] = $this->form['c_address'];
|
||||
$where .= self::td_search_or(['c_province','c_city','c_district','c_address']);
|
||||
$where .= self::td_search_or(['c_province', 'c_city', 'c_district', 'c_address']);
|
||||
$where .= self::td_search();
|
||||
break;
|
||||
case 'workers':
|
||||
$this->search_input = ['w_name','w_tel','w_text'];
|
||||
$this->search_input = ['w_name', 'w_tel', 'w_text'];
|
||||
$where .= self::td_search();
|
||||
break;
|
||||
case 'contract':
|
||||
$this->search_input = ['h_number','h_text'];
|
||||
$this->search_other = ['h_cid','h_wid'];
|
||||
$this->search_input = ['h_number', 'h_text'];
|
||||
$this->search_other = ['h_cid', 'h_wid'];
|
||||
$this->search_link = ['h_wid'];
|
||||
$this->search_field = ['ch.h_number','ch.h_text','ch.h_cid','ch.h_wid'];
|
||||
$where .= self::td_time_orsearch(['h_starttime','h_endtime'],['ch.h_endtime','ch.h_starttime']);
|
||||
$this->search_field = ['ch.h_number', 'ch.h_text', 'ch.h_cid', 'ch.h_wid'];
|
||||
$where .= self::td_time_orsearch(['h_starttime', 'h_endtime'], ['ch.h_endtime', 'ch.h_starttime']);
|
||||
$where .= self::td_search();
|
||||
self::td_groupby($where);
|
||||
break;
|
||||
|
|
@ -368,31 +373,33 @@ trait tdata {
|
|||
$where .= self::td_search();
|
||||
break;
|
||||
case 'launch':
|
||||
$this->search_input = ['l_title','l_enumber','l_text'];
|
||||
$this->search_input = ['l_title', 'l_enumber', 'l_text'];
|
||||
$this->search_other = ['l_hnumber'];
|
||||
$where .= self::td_time_orsearch(['l_starttime','l_endtime'],['l_endtime','l_starttime']);
|
||||
$where .= self::td_time_orsearch(['l_starttime', 'l_endtime'], ['l_endtime', 'l_starttime']);
|
||||
$where .= self::td_search();
|
||||
break;
|
||||
case 'villages':
|
||||
$this->search_input = ['v_name','v_text'];
|
||||
$this->search_link = ['v_province','v_city','v_district','v_address'];
|
||||
$this->search_input = ['v_name', 'v_text'];
|
||||
$this->search_link = ['v_province', 'v_city', 'v_district', 'v_address'];
|
||||
$this->form['v_province'] = $this->form['v_address'];
|
||||
$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':
|
||||
$where .= " AND la.id IS NOT NULL ";
|
||||
$this->search_input = ['e_number','l_hnumber'];
|
||||
$this->search_other = ['id','e_vid'];
|
||||
$this->search_field = ['el.e_number','la.l_hnumber','la.id','el.e_vid'];
|
||||
$where .= self::td_time_orsearch(['l_starttime','l_endtime'],['la.l_endtime','la.l_starttime']);
|
||||
$this->search_input = ['e_number', 'l_hnumber'];
|
||||
$this->search_other = ['id', 'e_vid'];
|
||||
$this->search_field = ['el.e_number', 'la.l_hnumber', 'la.id', 'el.e_vid'];
|
||||
$where .= self::td_time_orsearch(['l_starttime', 'l_endtime'], ['la.l_endtime', 'la.l_starttime']);
|
||||
$where .= self::td_search();
|
||||
break;
|
||||
case 'noticeday':
|
||||
|
|
@ -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) {
|
||||
|
|
@ -446,31 +455,43 @@ trait tdata {
|
|||
$order = " `e_enable` DESC ";
|
||||
//按照正常排序,对比相邻广告位的投放广告品类
|
||||
// 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['eaps_order'] || $this->form['order_e_types']) {
|
||||
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){
|
||||
if ($this->form['eaps_order'] == 2) {
|
||||
// 传递进来的编号,不直接查数据是因为有些可能会出现错误,所以直接使用传递进来的,进行排序
|
||||
$array = array_filter(stringto_array($this->form['l_selectenum'],','));
|
||||
$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_address']) {
|
||||
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,37 +504,53 @@ 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';
|
||||
//备份 按照场所排序
|
||||
if($this->bsign){
|
||||
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