own_name_info = $_M['url']['own_name'] . 'c=info_on&a=do'; //这个前台已经涉及到,需要现在更换 $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', '_fiend' => [], 'placeholder' => '', 'fiend' => '', 'tname' => '', 'source' => 'search', 'allnone' => 1, 'condition' => '' ]; } use tfield; //配置参数 public function start($tname, $search = true, $btn = true) { global $_M, $_YW; $this->tname = $tname; $this->search_bool = $search; $this->btn_bool = $btn; //赋值结束后执行对应方法 self::{$this->tname}(); self::colspan(); return $this; } //头部搜索 public function search() { global $_M, $_YW; //特殊情况下的左边 if (count($this->search['left']) > 0) { $left = arrayto_string($this->search['left'], ''); $left = '
' . $left . '
'; unset($this->search['left']); } //默认都是在右边 $right = arrayto_string(array_reverse($this->search), ''); $right = '
' . $right . '
'; $this->goret['search'] = $left . $right; return $this; } //只做两行 TH 处理 private function row_datas($rowdatas, $keys) { global $_M, $_YW; foreach ($rowdatas as $key => $val) { if (is_array($val)) { $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 ]); } } return $datas; } //表格头部 public function thead() { global $_M, $_YW; $keys = []; if (count($this->rowsth) > 0) { extract($this->rowsth); //获取默认数组维度也就是默认行数 $rowspan = " rowspan='{$rowlevel}' "; $keys = array_keys($rowdatas); //进行值的替换,转换 foreach ($rowdatas as $key => $val) { list($thtitle, $keydata) = $val; $datas[ $key ] = self::row_datas($keydata, $keys); $this->th_head[ $key ] = $thtitle; } } if ($this->checkall) $this->goret['thead'] = ' '; foreach ($this->th_head as $key => $val) { $rowspanb = $rowspan; $colspanb = ''; if (in_array($key, $keys)) { $rowspanb = " rowspan='1' "; //要做循环,二层tr内th $keydata = $datas[ $key ]; foreach ($keydata as $value) { $thead .= '' . $value . ''; } //计算一层的宽度 $colslevel = count($keydata); $colspanb = " colspan='{$colslevel}' "; } $class = $colspanb ? ' class="sorting_disabled text-xs-center" ' : ' data-table-columnclass="text-xs-center" '; //正常的th $this->goret['thead'] .= '' . $val . ''; } if ($this->lastbtn) $this->goret['thead'] .= '操作'; $this->goret['thead'] = '' . $this->goret['thead'] . ''; if ($thead) $this->goret['thead'] .= '' . $thead . ''; return $this; } //表格底部按钮 // @$dvalue int 两个按钮组 的差值 public function tfoot($dvalue = 2) { global $_M, $_YW; if ($this->btn_bool == false) return $this; if ($this->checkall) $this->goret['tfoot'] = ' '; //计算数组的维数 if (array_level($this->btn) == 1) { $btn = arrayto_string($this->btn, ''); $this->goret['tfoot'] .= '
' . $btn . '
'; } else { list($front, $after) = $this->btn; $thcol = floor($this->goret['thcol'] / 2) - $dvalue; $btn = arrayto_string($front, ''); $this->goret['tfoot'] .= '
' . $btn . '
'; $thcol = $this->goret['thcol'] - $thcol; $btn = arrayto_string($after, ''); $this->goret['tfoot'] .= '
' . $btn . '
'; } $this->goret['tfoot'] = '' . $this->goret['tfoot'] . ''; return $this; } //输出全部,需要先通过start()配置参数 public function send_all($dvalue = 2) { global $_M, $_YW; return $this->thead() ->tfoot($dvalue) ->search() ->send(); } //输出 public function send() { global $_M, $_YW; return $this->goret; } //表格头部的数组信息 public function thead_arr() { global $_M, $_YW; return $this->table_fiend; } // +---------------------------------------------------------------------- // | 内部方法 // +---------------------------------------------------------------------- //计算表格col protected function colspan() { $tdcol = $this->checkall && $this->lastbtn ? 2 : ($this->checkall || $this->lastbtn ? 1 : 0); $thcol = $this->lastbtn ? 1 : 0; $this->goret['tdcol'] = count($this->table_fiend) + $tdcol; $this->goret['thcol'] = count($this->table_fiend) + $thcol; } //删除 protected function btn_del($title = '确定要删除选中的信息吗?一旦删除将不能恢复!') { global $_M, $_YW; return ''; } //删除 protected function btn_zdy($str, $color = 0, $type = 'test', $confirm = false, $title = '确定要删除选中的信息吗?一旦删除将不能恢复!') { global $_M, $_YW; $btncolor = ['btn-default', 'btn-primary', 'btn-success', 'btn-info', 'btn-warning', 'btn-danger']; $alertify = $confirm ? ' data-plugin="alertify" data-type="confirm" data-label-ok="确定" data-label-cancel="取消" data-confirm-title="' . $title . '" ' : ''; return ''; // type="submit" 时jq的submit()才正常提交 } //保存 protected function btn_save() { return ''; } //添加 protected function btn_add($title = '添加', $nocancel = false) { global $_M, $_YW; $datanocancel = $nocancel ? '' : 'data-nocancel'; return ''; } //单页按钮 protected function btn_link($url, $name, $class) { global $_M, $_YW; return '' . $name . ''; } //输入框搜索 protected function input_search($_fiend, $tips) { global $_M, $_YW; list($name, $title, $value) = self::fiend_data($_fiend); return '
' . $title . '
'; } // 输入框搜索 protected function input_select_search($maxWidth = 260) { global $_M, $_YW; $url = $this->select2['url'] ?: $_YW['url']['select']; list($name, $title, $value) = self::fiend_data($this->select2['_fiend']); return '
' . $title . '
'; } // 输入框搜索 protected function input_select_search_multiple($maxWidth = 260) { global $_M, $_YW; $url = $this->select2['url'] ?: $_YW['url']['select']; list($name, $title, $value) = self::fiend_data($this->select2['_fiend']); $condition = $this->select2['condition'] ?: 'p_type|||0'; return '
' . $title . '
'; } //参数下拉列表 public function para_select($para, $_fiend, $exists = false, $option = true) { global $_M, $_YW; list($name, $title, $value) = self::fiend_data($_fiend); if ($option) $option = ''; foreach ($para as $key => $val) { if ($exists) { list($p_name, $p_value) = $val; } else { extract($val); } $option .= ''; } return '
' . $title . '
'; } //输入框搜索 protected function date_timepicker_search($start, $end = '') { global $_M, $_YW; list($sname, $stitle, $svalue) = self::fiend_data($start); list($ename, $etitle, $evalue) = self::fiend_data($end); if ($end) { $endinput = ' ' . $etitle . ' '; } return '
' . $stitle . ' ' . $endinput . '
'; } //输入框搜索 protected function date_time_search($start) { global $_M, $_YW; list($sname, $stitle, $svalue) = self::fiend_data($start); return '
' . $stitle . ' ' . $endinput . '
'; } /* * 获取字段信息 * @$fiend array 字段数组,包含字段名和字段标题 * @$title string 替换字段数组得到字段标题 */ protected function fiend_data($_fiend) { global $_M, $_YW; list($name, $title, $value) = is_array($_fiend) ? $_fiend : [$_fiend]; $title = strlen($title) > 0 ? $title : $this->table_fiend[ $name ]; return [$name, $title, $value]; } //标题替换为排序功能 // $key 为name值 table_fiend 对应的字段名 // $name 自定义的input字段名 protected function th_replace_order($key, $name = '', $str = '') { global $_M, $_YW; $str = $str === '' ? $this->table_fiend[ $key ] : $str; $name = $name === '' ? 'order_' . $key : $name; return '' . $str . ''; } //给标题增加提示 // $tooltip 的参数全部通过这个数组配置 // $position 决定内容在字符的前后显示 protected function th_tooltip($tooltip = [], $str = '', $position = true) { global $_M, $_YW; if (!is_array($tooltip)) $tooltip = [$tooltip]; list($title, $placement, $trigger, $key) = $tooltip; $placement = $placement ?: 'bottom'; $trigger = $trigger ?: 'hover'; $str = $str === '' ? $this->table_fiend[ $key ] : $str; $toolstr = ''; return $position ? $str . $toolstr : $toolstr . $str; } // 地图选择 protected function th_toolmap($title, $html = '

选择小区

') { global $_M, $_YW; return '
'; } // 公用城市选择 private $selctCityConfig = [ // 1 为通用 0为模态框样式 'type' => 1, // true 开启值的变化触发table筛选,false则不触发 'tableSearch' => true, 'class' => 'city-js' ]; /** * @param false[] $display 是否显示 * @param string[] $name name值 * @param array $defaults 默认值 * @return string */ protected function th_select_city($display = [false, false], $name = ['v_province', 'v_city', 'v_district'], $defaults = []) { global $_M, $_YW; $cityUrl = load::own_class('cloud', 'new')->city_url(); $title = '选择区域'; $select = function ($mr = 5) use ($_YW, $defaults, $display, $name) { list($provName, $cityName, $distName) = is_array($name) ? $name : [$name]; list($prov, $city, $dist) = is_array($defaults) ? $defaults : [$defaults]; list($provhd, $cityhd) = is_array($display) ? $display : [$display]; $provhd = $provhd ? '' : 'hidden-xs-up'; $cityhd = $cityhd ? '' : 'hidden-xs-up'; $tableSearch = $this->selctCityConfig['tableSearch'] ? 'data-table-search' : ''; $class = $mr > 0 ? 'm-r-' . $mr : ''; return ' '; }; $htmla = '
' . $title . '
' . $select(0) . '
'; $htmlb = '
' . $select(5) . '
'; return $this->selctCityConfig['type'] ? $htmla : $htmlb; } // +---------------------------------------------------------------------- // | 各表处理 // +---------------------------------------------------------------------- //广告位列表 protected function elevator() { global $_M, $_YW; $this->table_fiend = self::tf_elevator(); //头部 TH内容替换 $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $tsql = load::own_class('tsql', 'new'); $this->search[] = self::input_search('e_text', '输入搜索内容'); $this->search[] = self::input_search('e_label', '输入检索标签'); $this->search[] = self::input_search('e_number', '输入广告位编号'); //位置 $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', '门口方位']); $this->select2 = [ '_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']], 'placeholder' => '输入场所名称', 'fiend' => 'id', 'tname' => 'village', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); //状态 $this->search[] = self::para_select([['禁用', 0], ['启用', 1]], ['e_enable', '状态'], true); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_del(), self::btn_zdy('启用', 2, 'enable_on'), self::btn_zdy('禁用', 4, 'enable_off', true, '确定要选中的广告位吗?一旦将无法进行排期投放!'), ]; $addtourl = $this->own_name_info . __FUNCTION__; $this->btn[] = [ '新增广告位' ]; } } // 场所统计表 protected function village() { global $_M, $_YW; $this->table_fiend = self::tf_village(); $rselect = [ 'v_totalstr' => self::th_tooltip(['广告位总数 / 禁用 / 正常', 'top', '', 'v_totalstr']) ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search('v_text', '输入搜索内容'); $this->search[] = self::input_search('v_address', '输入地址'); $this->search[] = self::input_search('v_name', '输入场所名称'); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_del(), self::btn_zdy('启用', 2, 'enableon'), self::btn_zdy('禁用', 4, 'enableoff', true, '确定要禁用场所的广告位吗?一旦将无法进行排期投放!'), ]; $addtourl = $this->own_name_info . __FUNCTION__; $this->btn[] = [ '新增场所' ]; } } // 广告合同关联表 protected function schedule() { global $_M, $_YW; //不需要最后一栏 $this->checkall = false; $this->lastbtn = false; $this->table_fiend = self::tf_schedule(); //替换表格头部 $rselect = [ 'l_starttime' => self::th_replace_order('l_starttime'), 'l_endtime' => self::th_replace_order('l_endtime'), ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search('l_hnumber', '输入合同编号'); $this->search[] = self::input_search(['e_number', '', $_M['form']['e_number']], '输入广告位编号'); $this->search[] = self::date_timepicker_search(['l_starttime', '时间区段'], ['l_endtime', 'To']); $this->select2 = [ '_fiend' => ['id', '选择投放计划', $_M['form']['l_id']], 'placeholder' => '输入投放计划名称', 'fiend' => 'id', 'tname' => 'launch', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ '_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']], 'placeholder' => '输入场所名称', 'fiend' => 'id', 'tname' => 'village', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); } //底部按钮 if ($this->btn_bool) { $this->btn[] = ''; } } // 合同归档 protected function contract() { global $_M, $_YW; $this->table_fiend = self::tf_contract(); //替换表格头部 $rselect = [ 'h_starttime' => self::th_replace_order('h_starttime'), 'h_endtime' => self::th_replace_order('h_endtime'), ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search('h_text', '输入搜索内容'); $this->select2 = [ '_fiend' => ['h_wid', '签定人员', $_M['form']['h_wid']], 'placeholder' => '输入姓名/电话', 'fiend' => 'id', 'tname' => 'workers', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ '_fiend' => ['h_cid', '选择企业', $_M['form']['h_cid']], 'placeholder' => '输入企业名称', 'fiend' => 'id', 'tname' => 'customer', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->search[] = self::input_search(['h_number', '', $_M['form']['h_number']], '输入合同编号'); $this->search[] = self::date_timepicker_search(['h_starttime', '时间区段'], ['h_endtime', 'To']); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_del() ]; $addtourl = $this->own_name_info . __FUNCTION__; $this->btn[] = [ '录入订单合同' ]; } } // 公司资料 protected function customer() { global $_M, $_YW; $this->table_fiend = self::tf_customer(); $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search('c_text', '输入搜索内容'); $this->search[] = self::input_search('c_address', '输入地址'); $this->search[] = self::input_search('c_allname', '输入企业名称'); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_del() ]; $addtourl = $this->own_name_info . __FUNCTION__; $this->btn[] = [ '新增企业' ]; } } // 企业联系人 protected function workers() { global $_M, $_YW; $this->table_fiend = self::tf_workers(); $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search('w_text', '输入搜索内容'); $this->search[] = self::input_search('w_tel', '输入电话'); $this->search[] = self::input_search('w_name', '输入姓名'); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_del() ]; $addtourl = $this->own_name_info . __FUNCTION__; $this->btn[] = [ '新增联系人' ]; } } // 参数统计 protected function para() { global $_M, $_YW; $this->table_fiend = self::tf_para(); //头部 TH内容替换 $rselect = [ 'p_type' => self::th_replace_order('p_type'), 'p_order' => self::th_replace_order('p_order'), ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $para = [ ['广告位置', 0], ['企业职位', 1], ['投放进度', 2], ['门口方位', 3], ['投放媒介', 4], ['场所分类', 6], ['广告类型', 7] ]; $this->search['left'][] = self::para_select($para, ['p_type', '参数分类', $_M['form']['p_type']], true); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_save(), self::btn_del() ]; $_YW['url']['addlist'] .= '&p_type=' . $_M['form']['p_type']; $this->btn[] = [ self::btn_add('新增参数') ]; } } // 投放计划 protected function launch() { global $_M, $_YW; $this->table_fiend = self::tf_launch(); $rselect = [ 'l_starttime' => self::th_replace_order('l_starttime'), 'l_endtime' => self::th_replace_order('l_endtime'), 'l_totalnum' => self::th_tooltip(['排期成功个数 / 选择的个数', 'top', '', 'l_totalnum']) ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search(['l_text'], '输入搜索内容'); $this->search[] = self::input_search(['l_enumber', '广告位编号'], '输入广告位编号'); $this->search[] = self::input_search(['l_hnumber', '', $_M['form']['l_hnumber']], '输入完整合同编号'); $this->search[] = self::input_search(['l_title'], '输入广告标题'); $this->search[] = self::date_timepicker_search(['l_starttime', '时间区段'], ['l_endtime', 'To']); } //底部按钮 if ($this->btn_bool) { $this->btn[] = self::btn_del(); } } // 广告位排期选择列表 protected function applan() { global $_M, $_YW; //不需要最后一栏 $this->lastbtn = false; $this->table_fiend = self::tf_applan(); $rselect = [ 'e_types' => self::th_replace_order('e_types'), ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $html = ''; // 地图区域 $this->selctCityConfig['type'] = 1; $this->selctCityConfig['class'] = 'city-js'; $html .= self::th_select_city(); $this->search['left'][] = self::th_toolmap('地图筛选',$html); // 区域 $this->selctCityConfig['class'] = 'search-city-js'; $this->search['left'][] = self::th_select_city(); $para = [['正常-按照广告位置排序', 0], ['推荐-将适合投放的提前排序', 1], ['选中-将选择中广告位提前排序', 2]]; $this->search['left'][] = self::para_select($para, ['eaps_order', '广告位排序', $_M['form']['eaps_order']], true, false); $tsql = load::own_class('tsql', 'new'); $this->select2 = [ '_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']], 'placeholder' => '输入场所名称', 'fiend' => 'id', 'tname' => 'village', 'source' => 'search', 'allnone' => 2 ]; $this->search['left'][] = self::input_select_search(); $this->select2 = [ '_fiend' => ['vtype', '社区类型'], 'placeholder' => '可选择多个社区类型', 'fiend' => 'p_value', 'tname' => 'para', 'source' => 'search_para_vtype', 'allnone' => 0, 'condition' => 'p_type|||6' ]; $this->search['left'][] = self::input_select_search_multiple(160); //门口方位 $para = $tsql->table('para')->where(['p_type' => 3])->all(); $this->search['left'][] = self::para_select($para, ['e_bno', '门口方位']); //位置 $this->select2 = [ '_fiend' => ['e_aps', '位置'], 'placeholder' => '可选择多个位置', 'fiend' => 'p_value', 'tname' => 'para', 'source' => 'search_para_eaps', 'allnone' => 0, 'condition' => 'p_type|||0' ]; $this->search['left'][] = self::input_select_search_multiple(160); $this->search['left'][] = self::input_search('e_number', '输入广告位编号'); //状态 // $this->search[] = self::para_select([['禁用',0],['启用',1]],['e_enable','状态'],true); } //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_save() ]; $this->btn[] = [ '已选中广告位个数:0' ]; } } // 广告位排期统计查询 protected function elevators() { global $_M, $_YW; $this->table_fiend = self::tf_elevators(); //替换表格头部 $rselect = [ 'e_address' => self::th_replace_order('e_address'), 'e_number' => self::th_replace_order('e_number'), 'endtime' => self::th_replace_order('endtime'), 'e_totalnum' => self::th_replace_order('e_totalnum'), 'endstime' => self::th_replace_order('endstime'), 'endetime' => self::th_replace_order('endetime'), 'nowstime' => self::th_replace_order('nowstime'), 'nowetime' => self::th_replace_order('nowetime'), 'nextstime' => self::th_replace_order('nextstime'), 'nextetime' => self::th_replace_order('nextetime'), 'etypes' => self::th_replace_order('etypes', 'order_etypes'), ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $tsql = load::own_class('tsql', 'new'); $this->search[] = self::input_search(['e_number', '广告位编号', $_M['form']['e_number']], '输入广告位编号'); //位置 $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', '门口方位']); $this->select2 = [ '_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']], 'placeholder' => '输入场所名称', 'fiend' => 'id', 'tname' => 'village', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ '_fiend' => ['nextid', '下个排期计划'], 'placeholder' => '输入投放计划名称', 'fiend' => 'id', 'tname' => 'launch', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ '_fiend' => ['nowid', '当前排期计划'], 'placeholder' => '输入投放计划名称', 'fiend' => 'id', 'tname' => 'launch', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ '_fiend' => ['endid', '上个排期计划'], 'placeholder' => '输入投放计划名称', 'fiend' => 'id', 'tname' => 'launch', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->search[] = self::date_time_search(['endtime', '最大结束时间']); //状态 $this->search[] = self::para_select([['禁用', 0], ['启用', 1]], ['e_enable', '状态'], true); } //底部按钮 if ($this->btn_bool) { $this->btn[] = ''; } } // 场所统计展示 protected function villages() { global $_M, $_YW; $this->table_fiend = self::tf_villages(); $this->rowsth = [ 'rowlevel' => 2, 'rowdatas' => [ //key 需要在指定的位置进行整合 //整合后的新名称 //被整合的字段 'v_enum' => ['资源总计', ['v_enum', 'v_ebnonum']], 'v_free' => [self::th_tooltip(['今天空闲或者时间区段内空闲的广告位,已去除禁用个数', 'top'], '闲置总计', false), ['v_free', 'v_bno']] ] ]; //原来的列 除掉要转为第二行的 全部要设置为2,转为一行的设置为1 // //将选中的数组转为二级,并给二级添加一级 // //查找到某些元素存放到指定数组,并在原数组上删除 //在原数组删除的地方添加一个值 //将新数组作为一个tr //头部 TH内容替换 $rselect = [ 'v_enum' => self::th_tooltip(['广告位总个数 / 禁用的个数', 'top'], self::th_replace_order('v_enum'), false), 'v_free' => self::th_replace_order('v_free'), 'v_lease' => self::th_replace_order('v_lease'), 'v_endday' => self::th_tooltip(['默认7天内即将到期的广告位', 'top'], self::th_replace_order('v_endday'), false), 'v_prerow' => self::th_replace_order('v_prerow'), 'v_ebnonum' => self::th_replace_order('v_ebnonum'), 'v_bno' => self::th_tooltip(['存在一个广告空位则所属门口方位就算有空', 'top'], self::th_replace_order('v_bno')), ]; $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $this->search[] = self::input_search('v_text', '输入搜索内容'); $this->search[] = self::input_search('v_address', '输入地址'); $this->search[] = self::input_search('v_name', '输入场所名称'); $this->search[] = self::date_timepicker_search(['vs_starttime', '时间区段'], ['vs_endtime', 'To']); $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(); $this->select2 = [ '_fiend' => ['vtype', '社区类型'], 'placeholder' => '可选择多个社区类型', 'fiend' => 'p_value', 'tname' => 'para', 'source' => 'search_para_vtype', 'allnone' => 0, 'condition' => 'p_type|||6' ]; $this->search[] = self::input_select_search_multiple(); // 区域 $this->selctCityConfig['class'] = 'search-city-js'; $this->search[] = self::th_select_city(); $html = ''; // 地图区域 $this->selctCityConfig['type'] = 1; $this->selctCityConfig['class'] = 'city-js'; $html .= self::th_select_city(); $this->search[] = self::th_toolmap('地图筛选',$html); } //底部按钮 if ($this->btn_bool) { $this->btn[] = ''; } } // 首页统计 protected function noticeday() { global $_M, $_YW; $this->checkall = false; $this->lastbtn = false; $this->table_fiend = self::tf_noticeday(); $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { } //搜索 if ($this->search_bool) { $this->search[] = self::input_search('v_text', '输入搜索内容'); $this->search[] = self::input_search('v_address', '输入地址'); $this->search[] = self::input_search('v_name', '输入场所名称'); $this->search[] = self::date_timepicker_search(['vs_starttime', '时间区段'], ['vs_endtime', 'To']); } //底部按钮 if ($this->btn_bool) { $this->btn[] = ''; } } //前台巡查页面 protected function patrol() { global $_M, $_YW; $this->checkall = false; $this->lastbtn = false; $this->table_fiend = self::tf_patrol(); $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //搜索 if ($this->search_bool) { $tsql = load::own_class('tsql', 'new'); $this->search[] = self::input_search(['e_number', '编号', $_M['form']['e_number']], '输入广告位编号'); //位置 $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', '门口方位']); $this->select2 = [ 'url' => $_M['url']['site'] . 'app/index.php?n=dzadsod&c=select&a=doselect', '_fiend' => ['e_vid', '场所', $_M['form']['e_vid']], 'placeholder' => '输入场所名称', 'fiend' => 'id', 'tname' => 'village', 'source' => 'search', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ 'url' => $_M['url']['site'] . 'app/index.php?n=dzadsod&c=select&a=doselect', '_fiend' => ['nowid', '排期'], 'placeholder' => '输入投放计划名称', 'fiend' => 'id', 'tname' => 'launch', 'source' => 'weblaunchsearch', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); $this->select2 = [ 'url' => $_M['url']['site'] . 'app/index.php?n=dzadsod&c=select&a=doselect', '_fiend' => ['l_hnumber', '订单'], 'placeholder' => '输入合同名称', 'fiend' => 'h_number', 'tname' => 'contract', 'source' => 'webcontractsearch', 'allnone' => 2 ]; $this->search[] = self::input_select_search(); } } // 参数统计 protected function keylist() { global $_M, $_YW; $this->table_fiend = self::tf_keylist(); $this->th_head = is_array($rselect) ? array_merge($this->table_fiend, $rselect) : $this->table_fiend; //底部按钮 if ($this->btn_bool) { $this->btn[] = [ self::btn_del() ]; $addtourl = $this->own_name_info . __FUNCTION__; $this->btn[] = [ '新增巡查人员' ]; } } }