全局代码进行格式优化

This commit is contained in:
cloud 2020-12-07 02:16:43 +08:00
parent fe837f0df5
commit 7d2668700b
51 changed files with 3925 additions and 3532 deletions

View File

@ -7,7 +7,8 @@ load::own_class('../traits/tlist');
load::own_class('../traits/tfield'); load::own_class('../traits/tfield');
//表格 //表格
class backups extends appadmin { class backups extends appadmin
{
//备份字段 //备份字段
private $bsign = true; private $bsign = true;
@ -33,15 +34,16 @@ class backups extends appadmin {
private $bacfield = ''; //查询字段 private $bacfield = ''; //查询字段
private $bacpages = 500; //每页查询条数 private $bacpages = 500; //每页查询条数
public function __construct() { public function __construct()
global $_M,$_YW; {
global $_M, $_YW;
parent::__construct(); parent::__construct();
$this->form = $_M['form']; $this->form = $_M['form'];
if($this->form['tname']){ if ($this->form['tname']) {
$this->tname = $this->form['tname']; $this->tname = $this->form['tname'];
$this->sqlk = $_YW['k'][$this->tname]; $this->sqlk = $_YW['k'][ $this->tname ];
} }
$this->own_name_info = $_M['url']['own_name'].'c=info_on&a=do'; $this->own_name_info = $_M['url']['own_name'] . 'c=info_on&a=do';
} }
use tdata; use tdata;
@ -49,7 +51,8 @@ class backups extends appadmin {
use tlist; use tlist;
//表格数据 //表格数据
public function doindex() { public function doindex()
{
global $_M; global $_M;
self::csvtitle(); self::csvtitle();
$this->bacname = '广告位'; $this->bacname = '广告位';
@ -76,8 +79,8 @@ class backups extends appadmin {
self::bactable(); self::bactable();
# 获取数据总条数 # 获取数据总条数
$total = self::tabletotal(); $total = self::tabletotal();
$pages = ceil($total/$this->bacpages); $pages = ceil($total / $this->bacpages);
for ($i = 0; $i < $pages; $i++){ for ($i = 0; $i < $pages; $i++) {
$data = self::tabledata($i); $data = self::tabledata($i);
$y = 0; $y = 0;
$listnum = 1000; $listnum = 1000;
@ -92,7 +95,7 @@ class backups extends appadmin {
flush(); flush();
$y = 0; $y = 0;
} }
$arr = self::arrzbm($val,'utf-8' , 'GBK'); $arr = self::arrzbm($val, 'utf-8', 'GBK');
fputcsv($file, $arr); fputcsv($file, $arr);
} }
} }
@ -100,7 +103,8 @@ class backups extends appadmin {
} }
//判断语句组合 //判断语句组合
protected function bactable() { protected function bactable()
{
global $_M; global $_M;
$this->bactable = self::td_sqlk(); $this->bactable = self::td_sqlk();
$this->bacfield = self::td_field(); $this->bacfield = self::td_field();
@ -108,12 +112,12 @@ class backups extends appadmin {
$where = self::td_where(); $where = self::td_where();
parent::where_id($where); parent::where_id($where);
if($where){ if ($where) {
$where = trim($where); $where = trim($where);
if (strtolower(substr($where, 0, 5)) != 'where' && $where) $this->bacconds = " WHERE {$where} "; if (strtolower(substr($where, 0, 5)) != 'where' && $where) $this->bacconds = " WHERE {$where} ";
} }
//排序 //排序
if($this->bacconds){ if ($this->bacconds) {
$order = self::td_order(); $order = self::td_order();
$this->bacconds .= " ORDER BY {$order} "; $this->bacconds .= " ORDER BY {$order} ";
} }
@ -121,29 +125,31 @@ class backups extends appadmin {
} }
//计算总数 //计算总数
protected function tabletotal() { protected function tabletotal()
{
global $_M; global $_M;
$countsql = " SELECT COUNT(*) FROM {$this->bactable} {$this->bacconds} "; $countsql = " SELECT COUNT(*) FROM {$this->bactable} {$this->bacconds} ";
if($this->multi_table) $countsql = " SELECT count(*) FROM (SELECT {$this->bacfield} FROM {$this->bactable} {$this->bacconds}) num "; if ($this->multi_table) $countsql = " SELECT count(*) FROM (SELECT {$this->bacfield} FROM {$this->bactable} {$this->bacconds}) num ";
$result = DB::query($countsql); $result = DB::query($countsql);
$fetch_row = DB::fetch_row($result); $fetch_row = DB::fetch_row($result);
return $fetch_row[0]; return $fetch_row[0];
} }
//获取获取 //获取获取
protected function tabledata($pages) { protected function tabledata($pages)
{
global $_M; global $_M;
$cursize = $pages* $this->bacpages; $cursize = $pages * $this->bacpages;
//SQL查询 //SQL查询
$result = DB::query("SELECT {$this->bacfield} FROM {$this->bactable} {$this->bacconds} LIMIT {$cursize},{$this->bacpages}"); $result = DB::query("SELECT {$this->bacfield} FROM {$this->bactable} {$this->bacconds} LIMIT {$cursize},{$this->bacpages}");
while($val = DB::fetch_array($result)){ while ($val = DB::fetch_array($result)) {
$data[] = $val; $data[] = $val;
} }
//处理数组结果 //处理数组结果
foreach ($data as $val) { foreach ($data as $val) {
$lists = self::{$this->tname}($val); $lists = self::{$this->tname}($val);
$baclist[] = array_intersect_key(self::striptags($lists),$this->title); $baclist[] = array_intersect_key(self::striptags($lists), $this->title);
} }
return $baclist; return $baclist;
} }
@ -156,15 +162,17 @@ class backups extends appadmin {
# 导入导出数组(保持和导入格式一样) # 导入导出数组(保持和导入格式一样)
protected function csvtitle() { protected function csvtitle()
{
global $_M, $_YW; global $_M, $_YW;
$this->title = self::{'tf_'.$this->tname}(); $this->title = self::{'tf_' . $this->tname}();
$this->keys = array_keys($this->title); $this->keys = array_keys($this->title);
return $this; return $this;
} }
//生成文件名 //生成文件名
public function csvname() { public function csvname()
{
global $_M, $_YW; global $_M, $_YW;
$date = date('Ymd', time()); $date = date('Ymd', time());
$filename = iconv("utf-8", "GBK", $this->bacname . $_M['lang'] . $date); $filename = iconv("utf-8", "GBK", $this->bacname . $_M['lang'] . $date);
@ -173,20 +181,22 @@ class backups extends appadmin {
} }
//对数组的值进行转码并返回(一维数组) //对数组的值进行转码并返回(一维数组)
public function arrzbm($arr, $u, $g) { public function arrzbm($arr, $u, $g)
{
global $_M, $_YW; global $_M, $_YW;
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
$newarr[$k] = iconv($u, $g, $v); $newarr[ $k ] = iconv($u, $g, $v);
} }
return $newarr; return $newarr;
} }
//删除html元素 //删除html元素
public function striptags($array = []) { public function striptags($array = [])
{
global $_M, $_YW; global $_M, $_YW;
$ret = []; $ret = [];
foreach ($array as $key => $str) { foreach ($array as $key => $str) {
$ret[$key] = strip_tags($str); $ret[ $key ] = strip_tags($str);
} }
return $ret; return $ret;
} }

View File

@ -59,7 +59,7 @@ class config extends appadmin
if (empty($lang)) $lang = $_M['lang']; if (empty($lang)) $lang = $_M['lang'];
//程序运行必备 //程序运行必备
$para_a = ['tem_ida', 'tem_idb', 'tem_idc', 'openid']; $para_a = ['tem_ida', 'tem_idb', 'tem_idc', 'openid'];
$para_b = ['mapkey','mapprov','mapcity','mapdist','maplng','maplat']; $para_b = ['mapkey', 'mapprov', 'mapcity', 'mapdist', 'maplng', 'maplat'];
$para = array_merge($para_a, $para_b); $para = array_merge($para_a, $para_b);
$arrs = array_intersect_key($form, array_combine($para, $para)); //对比数组 $arrs = array_intersect_key($form, array_combine($para, $para)); //对比数组
foreach ($arrs as $k => $v) { foreach ($arrs as $k => $v) {

View File

@ -1,38 +1,44 @@
<?php <?php
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
//接口初始化
class dzadsod extends appadmin {
public function __construct() { //接口初始化
global $_M,$_YW; class dzadsod extends appadmin
{
public function __construct()
{
global $_M, $_YW;
parent::__construct(); parent::__construct();
parent::appnav(); parent::appnav();
parent::point('dzadsod','dodzadsod'); parent::point('dzadsod', 'dodzadsod');
} }
public function __destruct() { public function __destruct()
global $_M,$_YW; {
if($this->destruct){ global $_M, $_YW;
if(empty($this->appshow)) $this->appshow = 'app/'.$this->tname; if ($this->destruct) {
require $this->show($this->appshow,$this->input); if (empty($this->appshow)) $this->appshow = 'app/' . $this->tname;
require $this->show($this->appshow, $this->input);
} }
} }
/** /**
* 综合设置 * 综合设置
*/ */
public function dodzadsod() { public function dodzadsod()
{
global $_M; global $_M;
//统计总数 //统计总数
$this->input['num'] = $this->cloud->summary(); $this->input['num'] = $this->cloud->summary();
//到期数据 //到期数据
parent::point('table_off','doindex','table'); parent::point('table_off', 'doindex', 'table');
parent::appurl('noticeday');//endcontract parent::appurl('noticeday');//endcontract
$this->input['table'] = load::own_class('table_theme','new')->start($this->tname)->send_all(1); $this->input['table'] = load::own_class('table_theme', 'new')->start($this->tname)->send_all(1);
$this->appshow = 'app/dzadsod'; $this->appshow = 'app/dzadsod';
} }
} }
?> ?>

View File

@ -11,31 +11,31 @@ class info_on extends appadmin
public function __construct() public function __construct()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
parent::point('info_off','doindex'); parent::point('info_off', 'doindex');
} }
public function __destruct() public function __destruct()
{ {
global $_M,$_YW; global $_M, $_YW;
if($this->destruct){ if ($this->destruct) {
if(empty($this->appshow)) $this->appshow = 'app/'.$this->tname; if (empty($this->appshow)) $this->appshow = 'app/' . $this->tname;
require $this->show($this->appshow,$this->input); require $this->show($this->appshow, $this->input);
} }
} }
//场所 //场所
public function dovillage() public function dovillage()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['table_on__dovillage','场所资料']); parent::appnav(['table_on__dovillage', '场所资料']);
parent::appurl(parent::tname(),['id'=>$_M['form']['id']]); parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if($_M['form']['id']){ if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id'=>$_M['form']['id']]) ->where(['id' => $_M['form']['id']])
->one(); ->one();
}else{ } else {
//默认值 //默认值
$this->input['data']['v_province'] = '山东省'; $this->input['data']['v_province'] = '山东省';
$this->input['data']['v_city'] = '泰安市'; $this->input['data']['v_city'] = '泰安市';
@ -43,8 +43,8 @@ class info_on extends appadmin
} }
//场所分类 //场所分类
$para = $this->tsql->table('para')->where(['p_type' => 6])->all(); $para = $this->tsql->table('para')->where(['p_type' => 6])->all();
parent::para_radio($para,'v_type',$this->input['data']['v_type'],$this->input['para']['v_type_radio']) parent::para_radio($para, 'v_type', $this->input['data']['v_type'], $this->input['para']['v_type_radio'])
->setparahtml(6,$this->input['para']['v_type_radio']); ->setparahtml(6, $this->input['para']['v_type_radio']);
// 百度地图 // 百度地图
$this->input['mapkey'] = $_YW['c']['mapkey']; $this->input['mapkey'] = $_YW['c']['mapkey'];
//城市json //城市json
@ -54,14 +54,14 @@ class info_on extends appadmin
//企业 //企业
public function docustomer() public function docustomer()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['table_on__docustomer','企业资料']); parent::appnav(['table_on__docustomer', '企业资料']);
parent::appurl(parent::tname(),['id'=>$_M['form']['id']]); parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if($_M['form']['id']){ if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id'=>$_M['form']['id']]) ->where(['id' => $_M['form']['id']])
->one(); ->one();
}else{ } else {
//默认值 //默认值
$this->input['data']['c_province'] = '山东省'; $this->input['data']['c_province'] = '山东省';
$this->input['data']['c_city'] = '泰安市'; $this->input['data']['c_city'] = '泰安市';
@ -75,44 +75,44 @@ class info_on extends appadmin
//企业 //企业
public function doworkers() public function doworkers()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['table_on__doworkers','企业资料']); parent::appnav(['table_on__doworkers', '企业资料']);
parent::appurl(parent::tname(),['id'=>$_M['form']['id']]); parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if($_M['form']['id']){ if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id'=>$_M['form']['id']]) ->where(['id' => $_M['form']['id']])
->one(); ->one();
} }
//职务选择 //职务选择
$para = $this->tsql->table('para')->where(['p_type' => 1])->all(); $para = $this->tsql->table('para')->where(['p_type' => 1])->all();
parent::para_radio($para,'w_jid',$this->input['data']['w_jid'],$this->input['para']['radio']) parent::para_radio($para, 'w_jid', $this->input['data']['w_jid'], $this->input['para']['radio'])
->setparahtml(1,$this->input['para']['radio']); ->setparahtml(1, $this->input['para']['radio']);
} }
//广告位 //广告位
public function doelevator() public function doelevator()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['table_on__doelevator','广告位']); parent::appnav(['table_on__doelevator', '广告位']);
parent::appurl(parent::tname(),['id'=>$_M['form']['id']]); parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if($_M['form']['id']){ if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id'=>$_M['form']['id']]) ->where(['id' => $_M['form']['id']])
->one(); ->one();
$this->input['data']['e_number_readonly'] = 'readonly'; $this->input['data']['e_number_readonly'] = 'readonly';
// 二次编辑时采用单选 // 二次编辑时采用单选
//门口方位 //门口方位
$para = $this->tsql->table('para')->where(['p_type' => 3])->all(); $para = $this->tsql->table('para')->where(['p_type' => 3])->all();
parent::para_radio($para,'e_bno',$this->input['data']['e_bno'],$this->input['para']['e_bno_radio']) parent::para_radio($para, 'e_bno', $this->input['data']['e_bno'], $this->input['para']['e_bno_radio'])
->setparahtml(3,$this->input['para']['e_bno_radio']); ->setparahtml(3, $this->input['para']['e_bno_radio']);
//广告位置 //广告位置
$para = $this->tsql->table('para')->where(['p_type' => 0])->all(); $para = $this->tsql->table('para')->where(['p_type' => 0])->all();
parent::para_radio($para,'e_aps',$this->input['data']['e_aps'],$this->input['para']['e_aps_radio']) parent::para_radio($para, 'e_aps', $this->input['data']['e_aps'], $this->input['para']['e_aps_radio'])
->setparahtml(0,$this->input['para']['e_aps_radio']); ->setparahtml(0, $this->input['para']['e_aps_radio']);
}else{ } else {
//默认值 //默认值
$this->input['data']['e_vid'] = $_M['form']['e_vid']; $this->input['data']['e_vid'] = $_M['form']['e_vid'];
$this->input['data']['e_enable'] = 1; $this->input['data']['e_enable'] = 1;
@ -120,54 +120,54 @@ class info_on extends appadmin
// 新增编辑时采用多选 // 新增编辑时采用多选
//门口方位 //门口方位
$para = $this->tsql->table('para')->where(['p_type' => 3])->all(); $para = $this->tsql->table('para')->where(['p_type' => 3])->all();
parent::para_checkbox($para,'e_bno',$this->input['data']['e_bno'],$this->input['para']['e_bno_radio']) parent::para_checkbox($para, 'e_bno', $this->input['data']['e_bno'], $this->input['para']['e_bno_radio'])
->setparahtml(3,$this->input['para']['e_bno_radio']); ->setparahtml(3, $this->input['para']['e_bno_radio']);
//广告位置 //广告位置
$para = $this->tsql->table('para')->where(['p_type' => 0])->all(); $para = $this->tsql->table('para')->where(['p_type' => 0])->all();
parent::para_checkbox($para,'e_aps',$this->input['data']['e_aps'],$this->input['para']['e_aps_radio']) parent::para_checkbox($para, 'e_aps', $this->input['data']['e_aps'], $this->input['para']['e_aps_radio'])
->setparahtml(0,$this->input['para']['e_aps_radio']); ->setparahtml(0, $this->input['para']['e_aps_radio']);
} }
//场所名称URL //场所名称URL
$this->input['remote_url'] = $_M['url']['own_name'].'c=ajax&a=doenumber&id='.$_M['form']['id']; $this->input['remote_url'] = $_M['url']['own_name'] . 'c=ajax&a=doenumber&id=' . $_M['form']['id'];
} }
//录入合同 //录入合同
public function docontract() public function docontract()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['table_on__docontract','合同详情']); parent::appnav(['table_on__docontract', '合同详情']);
parent::appurl(parent::tname(),['id'=>$_M['form']['id']]); parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if($_M['form']['id']){ if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id'=>$_M['form']['id']]) ->where(['id' => $_M['form']['id']])
->one(); ->one();
$this->input['data']['h_number_readonly'] = 'readonly'; $this->input['data']['h_number_readonly'] = 'readonly';
}else{ } else {
//默认值 //默认值
$this->input['data']['e_vid'] = $_M['form']['e_vid']; $this->input['data']['e_vid'] = $_M['form']['e_vid'];
$this->input['data']['h_noticeday'] = 7; $this->input['data']['h_noticeday'] = 7;
} }
$para = $this->tsql->table('para')->where(['p_type' => 4])->all(); $para = $this->tsql->table('para')->where(['p_type' => 4])->all();
parent::para_checkbox($para,'h_medium',$this->input['data']['h_medium'],$this->input['para']['h_medium_radio']) parent::para_checkbox($para, 'h_medium', $this->input['data']['h_medium'], $this->input['para']['h_medium_radio'])
->setparahtml(4,$this->input['para']['h_medium_radio']); ->setparahtml(4, $this->input['para']['h_medium_radio']);
$this->input['remote_url'] = $_M['url']['own_name'].'c=ajax&a=dohnumber&id='.$_M['form']['id']; $this->input['remote_url'] = $_M['url']['own_name'] . 'c=ajax&a=dohnumber&id=' . $_M['form']['id'];
} }
//广告投放 //广告投放
public function dolaunch() public function dolaunch()
{ {
global $_M,$_YW; global $_M, $_YW;
$slid = $_M['form']['slid']; $slid = $_M['form']['slid'];
parent::appnav(['table_on__dolaunch','广告投放']); parent::appnav(['table_on__dolaunch', '广告投放']);
parent::appurl(parent::tname(),['slid'=>$slid]); parent::appurl(parent::tname(), ['slid' => $slid]);
$fzid = $_M['form']['fzid']; $fzid = $_M['form']['fzid'];
if($slid){ if ($slid) {
// 编辑 // 编辑
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $slid]) ->where(['id' => $slid])
@ -175,7 +175,7 @@ class info_on extends appadmin
$contract = $this->tsql->table('contract') $contract = $this->tsql->table('contract')
->where(['h_number' => $this->input['data']['l_hnumber']]) ->where(['h_number' => $this->input['data']['l_hnumber']])
->one(); ->one();
}elseif($fzid){ } elseif ($fzid) {
// 复制功能 // 复制功能
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $fzid]) ->where(['id' => $fzid])
@ -184,8 +184,8 @@ class info_on extends appadmin
->where(['h_number' => $this->input['data']['l_hnumber']]) ->where(['h_number' => $this->input['data']['l_hnumber']])
->one(); ->one();
// 注销掉不需要的属性 // 注销掉不需要的属性
unset($this->input['data']['id'],$this->input['data']['l_enumber'],$this->input['data']['l_schedule'],$this->input['data']['l_enable'],$this->input['data']['l_updatetime'],$this->input['data']['l_addtime']); unset($this->input['data']['id'], $this->input['data']['l_enumber'], $this->input['data']['l_schedule'], $this->input['data']['l_enable'], $this->input['data']['l_updatetime'], $this->input['data']['l_addtime']);
}else{ } else {
//获取合同的值 //获取合同的值
$contract = $this->tsql->table('contract') $contract = $this->tsql->table('contract')
->where(['id' => $_M['form']['cid']]) ->where(['id' => $_M['form']['cid']])
@ -204,34 +204,34 @@ class info_on extends appadmin
//合同状态 //合同状态
$para = parent::paralist(2); $para = parent::paralist(2);
parent::para_radio($para,'l_schedule',$this->input['data']['l_schedule'],$this->input['para']['l_schedule_radio']) parent::para_radio($para, 'l_schedule', $this->input['data']['l_schedule'], $this->input['para']['l_schedule_radio'])
->setparahtml(2,$this->input['para']['l_schedule_radio']); ->setparahtml(2, $this->input['para']['l_schedule_radio']);
//广告分类 //广告分类
$para = parent::paralist(7); $para = parent::paralist(7);
parent::para_radio($para,'l_type',$this->input['data']['l_type'],$this->input['para']['l_type_radio']) parent::para_radio($para, 'l_type', $this->input['data']['l_type'], $this->input['para']['l_type_radio'])
->setparahtml(7,$this->input['para']['l_type_radio']); ->setparahtml(7, $this->input['para']['l_type_radio']);
//表格数据 //表格数据
// ap_plan // ap_plan
$this->input['table'] = load::own_class('table_theme','new')->start('applan')->send_all(); $this->input['table'] = load::own_class('table_theme', 'new')->start('applan')->send_all();
$this->input['table']['ajaxurl'] = $_M['url']['own_name']."c=table_ajax&a=doindex&tname=applan&slid=".$slid; $this->input['table']['ajaxurl'] = $_M['url']['own_name'] . "c=table_ajax&a=doindex&tname=applan&slid=" . $slid;
} }
//新增巡查人员 //新增巡查人员
public function dokeylist() public function dokeylist()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['table_on__dokeylist','巡查人员']); parent::appnav(['table_on__dokeylist', '巡查人员']);
parent::appurl(parent::tname(),['id'=>$_M['form']['id']]); parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if($_M['form']['id']){ if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname) $this->input['data'] = $this->tsql->table($this->tname)
->where(['id'=>$_M['form']['id']]) ->where(['id' => $_M['form']['id']])
->one(); ->one();
$this->input['data']['k_passkey'] = base64_decode($this->input['data']['k_basekey']); $this->input['data']['k_passkey'] = base64_decode($this->input['data']['k_basekey']);
}else{ } else {
$this->input['data']['k_state'] = 1; $this->input['data']['k_state'] = 1;
} }
} }
@ -239,10 +239,10 @@ class info_on extends appadmin
// 调整广告位投放计划 // 调整广告位投放计划
public function douplaunch() public function douplaunch()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appnav(['info_on__douplaunch','调整投放计划']); parent::appnav(['info_on__douplaunch', '调整投放计划']);
// parent::appnav(['info_on__doelevators','调整投放计划']); // parent::appnav(['info_on__doelevators','调整投放计划']);
parent::appurl(parent::tname(),['e_number'=>$_M['form']['e_number']]); parent::appurl(parent::tname(), ['e_number' => $_M['form']['e_number']]);
// 先获取广告位编号,获取对应的位置信息 // 先获取广告位编号,获取对应的位置信息
// 再获取 前 中 后排期 // 再获取 前 中 后排期
// 过期的只要最后一期,当前排期的,按照当天计算,然后罗列出预排的排期 // 过期的只要最后一期,当前排期的,按照当天计算,然后罗列出预排的排期
@ -258,4 +258,5 @@ class info_on extends appadmin
} }
} }
?> ?>

View File

@ -1,5 +1,6 @@
<?php <?php
defined('IN_MET') or exit ('No permission'); defined('IN_MET') or exit ('No permission');
//2.0 //2.0
class install class install
{ {
@ -15,10 +16,11 @@ class install
private $display; private $display;
private $mlangok; private $mlangok;
public function __construct() { public function __construct()
{
global $_M; global $_M;
do{ do {
$this->appno = mt_rand(2001,9999); //应用编号 $this->appno = mt_rand(2001, 9999); //应用编号
} while (self::sqlone('applist') != false); } while (self::sqlone('applist') != false);
$this->appver = '1.0'; //应用版本号 $this->appver = '1.0'; //应用版本号
@ -34,20 +36,22 @@ class install
} }
//安装主方法 //安装主方法
public function dosql() { public function dosql()
{
global $_M; global $_M;
$stall = self::sqlone('applist'," m_name='{$this->m_name}' "); $stall = self::sqlone('applist', " m_name='{$this->m_name}' ");
if(!$stall){ if (!$stall) {
//系统表 //系统表
self::appsql(); self::appsql();
}else{ } else {
} }
return 'complete'; return 'complete';
} }
//执行APP相关的表数据插入 //执行APP相关的表数据插入
private function appsql() { private function appsql()
{
global $_M; global $_M;
$time = time(); $time = time();
//注册应用 //注册应用
@ -65,7 +69,7 @@ class install
`display`='{$this->display}', `display`='{$this->display}',
`depend`='{$this->depend}', `depend`='{$this->depend}',
`mlangok`='{$this->mlangok}' "; `mlangok`='{$this->mlangok}' ";
self::addsql('applist',$field); self::addsql('applist', $field);
/** /**
* 1、增加新表 * 1、增加新表
@ -81,26 +85,29 @@ class install
`lang` varchar(50) NOT NULL, `lang` varchar(50) NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `name_lang` (`name`,`m_name`,`lang`)"; UNIQUE KEY `name_lang` (`name`,`m_name`,`lang`)";
DB::query("CREATE TABLE `".$_M['config']['tablepre']."cloud_config` ( {$field} ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8"); DB::query("CREATE TABLE `" . $_M['config']['tablepre'] . "cloud_config` ( {$field} ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8");
add_table('cloud_config'); add_table('cloud_config');
} }
//公共查询方法 //公共查询方法
private function sqlone($tname,$where = '') { private function sqlone($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
if(!$where){ if (!$where) {
$where = "no='{$this->appno}'"; $where = "no='{$this->appno}'";
} }
return DB::get_one("select * from {$table} where {$where}"); return DB::get_one("select * from {$table} where {$where}");
} }
//公共写入方法 //公共写入方法
private function addsql($tname,$field = '') { private function addsql($tname, $field = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
DB::query("INSERT INTO {$table} SET {$field}"); DB::query("INSERT INTO {$table} SET {$field}");
} }
} }
?> ?>

View File

@ -9,7 +9,9 @@ load::own_func('appcmp');
* 配置 * 配置
* 包含其他功能初始化 * 包含其他功能初始化
*/ */
class select extends appadmin {
class select extends appadmin
{
/* /*
* @$querys string 搜索内容 * @$querys string 搜索内容
@ -44,15 +46,16 @@ class select extends appadmin {
//返回的数组 //返回的数组
private $data = []; private $data = [];
public function __construct() { public function __construct()
global $_M,$_YW; {
global $_M, $_YW;
parent::__construct(); parent::__construct();
//指定表 //指定表
$this->tname = $_M['form']['tname']; $this->tname = $_M['form']['tname'];
//搜索内容 //搜索内容
$this->querys = $_M['form']['querys']; $this->querys = $_M['form']['querys'];
//以指定字段为值 //以指定字段为值
$this->fiend = $_M['form']['fiend']?:'id'; $this->fiend = $_M['form']['fiend'] ?: 'id';
//来源 //来源
$this->source = $_M['form']['source']; $this->source = $_M['form']['source'];
//是否显示全部 //是否显示全部
@ -66,55 +69,59 @@ class select extends appadmin {
} }
# select2 选项字段处理 # select2 选项字段处理
private function select_fiend($val) { private function select_fiend($val)
global $_M,$_YW; {
$strarr = stringto_array($this->fiend,'|'); global $_M, $_YW;
$strarr = stringto_array($this->fiend, '|');
foreach ($strarr as $value) { foreach ($strarr as $value) {
$arrstr[] = $val[$value]; $arrstr[] = $val[ $value ];
} }
return arrayto_string($arrstr,'|'); return arrayto_string($arrstr, '|');
} }
# allnone 默认选项全部处理 # allnone 默认选项全部处理
private function allnone() { private function allnone()
global $_M,$_YW; {
global $_M, $_YW;
// 若不需要显示‘全部’值,则直接返回空 // 若不需要显示‘全部’值,则直接返回空
// 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值 // 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值
// 1 为显示 显示‘全部’,同时也在未搜索结果的情况下 设置可选值 // 1 为显示 显示‘全部’,同时也在未搜索结果的情况下 设置可选值
// 2 只显示‘全部’ // 2 只显示‘全部’
// 3 只将未搜索到结果的情况下设置为可选值 // 3 只将未搜索到结果的情况下设置为可选值
if(empty($this->allnone) || $this->allnone == '3') return false; if (empty($this->allnone) || $this->allnone == '3') return false;
//然后可根据来源标记进行处理 //然后可根据来源标记进行处理
switch ($this->source) { switch ($this->source) {
// case 'githooks': // case 'githooks':
// $initial[] = ['id' => 'newver','text'=>'自动部署至最新版本']; // $initial[] = ['id' => 'newver','text'=>'自动部署至最新版本'];
// break; // break;
default: default:
$initial[] = [ 'id' => '','text' => '全部' ]; $initial[] = ['id' => '', 'text' => '全部'];
break; break;
} }
$this->data[] = ["text" => '',"children" => $initial ]; $this->data[] = ["text" => '', "children" => $initial];
} }
# 当未搜索到值是否将搜索结果设置为可选值 # 当未搜索到值是否将搜索结果设置为可选值
private function children() { private function children()
global $_M,$_YW; {
global $_M, $_YW;
// 判断是否要将搜索内容设置为可选值 // 判断是否要将搜索内容设置为可选值
if(empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false; if (empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false;
// 要注意id的是否为可写入数据库 误区,若有些字段为数字 则会导致无法录入成功 // 要注意id的是否为可写入数据库 误区,若有些字段为数字 则会导致无法录入成功
// 后期可增加一个判断方式来处理这个误区 // 后期可增加一个判断方式来处理这个误区
$this->data[] = [ $this->data[] = [
"text" => '', "text" => '',
"children" => [ "children" => [
['id'=> $this->querys,'text' => $this->querys] ['id' => $this->querys, 'text' => $this->querys]
] ]
]; ];
} }
# querys 处理 # querys 处理
private function querys() { private function querys()
global $_M,$_YW; {
if(strlen($this->querys) == 0) return false; global $_M, $_YW;
if (strlen($this->querys) == 0) return false;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$this->where = " v_name LIKE '%{$this->querys}%' "; $this->where = " v_name LIKE '%{$this->querys}%' ";
@ -144,60 +151,63 @@ class select extends appadmin {
} }
# condition 处理 # condition 处理
private function condition() { private function condition()
global $_M,$_YW; {
if(empty($this->condition)) return false; global $_M, $_YW;
if (empty($this->condition)) return false;
// 进行处理 // 进行处理
$condition = stringto_array($this->condition,'|||','$$$'); $condition = stringto_array($this->condition, '|||', '$$$');
foreach ($condition as $value) { foreach ($condition as $value) {
list($key,$val) = $value; list($key, $val) = $value;
$valstr[] = " {$key} = '{$val}' "; $valstr[] = " {$key} = '{$val}' ";
} }
$valstr = arrayto_string($valstr,' AND '); $valstr = arrayto_string($valstr, ' AND ');
if(strlen($valstr) > 0){ if (strlen($valstr) > 0) {
if(!empty($this->where)) $this->where = " ({$this->where}) AND "; if (!empty($this->where)) $this->where = " ({$this->where}) AND ";
$this->where .= $valstr; $this->where .= $valstr;
} }
} }
# 选项值的组成样式 # 选项值的组成样式
private function valuet($val) { private function valuet($val)
global $_M,$_YW; {
global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$fiend = [$val['v_name'],$val['v_province'].$val['v_city'].$val['v_district'].$val['v_address']]; $fiend = [$val['v_name'], $val['v_province'] . $val['v_city'] . $val['v_district'] . $val['v_address']];
break; break;
case 'customer': case 'customer':
$fiend = [$val['c_name'],$val['c_allname'],$val['c_province'].$val['c_city'].$val['c_district'].$val['c_address']]; $fiend = [$val['c_name'], $val['c_allname'], $val['c_province'] . $val['c_city'] . $val['c_district'] . $val['c_address']];
break; break;
case 'workers': case 'workers':
$fiend = [$val['w_name'],$val['w_tel']]; $fiend = [$val['w_name'], $val['w_tel']];
break; break;
case 'contract': case 'contract':
$fiend = [$val['h_number']]; $fiend = [$val['h_number']];
break; break;
case 'launch': case 'launch':
$fiend = [$val['l_title'],$val['l_hnumber']]; $fiend = [$val['l_title'], $val['l_hnumber']];
break; break;
case 'weuser': case 'weuser':
$sex = ['未知','男','女']; $sex = ['未知', '男', '女'];
$fiend = [$val['nickname'],$sex[$val['sex']] ]; $fiend = [$val['nickname'], $sex[ $val['sex'] ]];
break; break;
case 'para': case 'para':
$fiend = [$val['p_name']]; $fiend = [$val['p_name']];
// $fiend = [$val['p_value']]; // $fiend = [$val['p_value']];
break; break;
default: default:
break; break;
} }
$text = arrayto_string($fiend,' / '); $text = arrayto_string($fiend, ' / ');
return $text; return $text;
} }
//编号字段,根据此字段进行编号处理 //编号字段,根据此字段进行编号处理
private function charter() { private function charter()
global $_M,$_YW; {
global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$fiend = 'v_name'; $fiend = 'v_name';
@ -229,8 +239,9 @@ class select extends appadmin {
// 查看场所名称列表 // 查看场所名称列表
public function doselect() { public function doselect()
global $_M,$_YW; {
global $_M, $_YW;
//判断条件 //判断条件
self::querys(); self::querys();
//带入的判断条件 //带入的判断条件
@ -240,13 +251,13 @@ class select extends appadmin {
//查询 //查询
$array = $this->tsql->table($this->tname)->where($this->where)->order('id DESC')->all('id'); $array = $this->tsql->table($this->tname)->where($this->where)->order('id DESC')->all('id');
// $sqltsr = $this->tsql->query(); // $sqltsr = $this->tsql->query();
foreach ($array as $val) { foreach ($array as $val) {
if($this->tname == 'weuser'){ if ($this->tname == 'weuser') {
$val['nickname'] = urldecode($val['nickname']); $val['nickname'] = urldecode($val['nickname']);
} }
$letter = getstrcharter($val[$fiend]); $letter = getstrcharter($val[ $fiend ]);
$selectlist[$letter][] = $val; $selectlist[ $letter ][] = $val;
} }
//是否显示全部 //是否显示全部
@ -255,29 +266,29 @@ class select extends appadmin {
self::children(); self::children();
//处理结果 //处理结果
foreach ($selectlist as $key => $val){ foreach ($selectlist as $key => $val) {
$arr = []; $arr = [];
foreach ($val as $v) { foreach ($val as $v) {
$valid = self::select_fiend($v); $valid = self::select_fiend($v);
//判断是否只输出默认值 //判断是否只输出默认值
if(strlen($this->default) > 0){ if (strlen($this->default) > 0) {
$default = stringto_array($this->default, $this->division); $default = stringto_array($this->default, $this->division);
if(!in_array($valid, $default,true)) continue; if (!in_array($valid, $default, true)) continue;
} }
//组成选项 //组成选项
$arr[] = ['id' => $valid, 'text' => self::valuet($v)]; $arr[] = ['id' => $valid, 'text' => self::valuet($v)];
} }
$this->data[] = ["text" => $key,"children" => $arr]; $this->data[] = ["text" => $key, "children" => $arr];
} }
//当值不存在时 //当值不存在时
if(!count($this->data)){ if (!count($this->data)) {
//输出没有搜索到结果 //输出没有搜索到结果
$this->data = [["text" => $this->querys == ''?'检索不到相关信息':"检索不到 {$this->querys} 相关信息","children" => [] ]]; $this->data = [["text" => $this->querys == '' ? '检索不到相关信息' : "检索不到 {$this->querys} 相关信息", "children" => []]];
}else{ } else {
//对数组排序A-ZZ //对数组排序A-ZZ
$text = array_column($this->data, 'text'); $text = array_column($this->data, 'text');
array_multisort($text,SORT_ASC,$this->data); array_multisort($text, SORT_ASC, $this->data);
} }
echo jsoncallback(['results' => $this->data]); echo jsoncallback(['results' => $this->data]);

View File

@ -7,7 +7,8 @@ load::own_class('../traits/tlist');
load::own_class('../traits/tfield'); load::own_class('../traits/tfield');
//表格 //表格
class table_ajax extends appadmin { class table_ajax extends appadmin
{
//非备份,正常字段即可 //非备份,正常字段即可
private $bsign = false; private $bsign = false;
@ -23,20 +24,22 @@ class table_ajax extends appadmin {
private $own_name_info; private $own_name_info;
private $own_name_table; private $own_name_table;
public function __construct() { public function __construct()
global $_M,$_YW; {
global $_M, $_YW;
parent::__construct(); parent::__construct();
$this->form = $_M['form']; $this->form = $_M['form'];
if($this->form['tname']){ if ($this->form['tname']) {
$this->tname = $this->form['tname']; $this->tname = $this->form['tname'];
$this->sqlk = $_YW['k'][$this->tname]; $this->sqlk = $_YW['k'][ $this->tname ];
} }
$this->own_name_info = $_M['url']['own_name'].'c=info_on&a=do'; $this->own_name_info = $_M['url']['own_name'] . 'c=info_on&a=do';
$this->own_name_table = $_M['url']['own_name'].'c=table_on&a=do'; $this->own_name_table = $_M['url']['own_name'] . 'c=table_on&a=do';
} }
//表格数据 //表格数据
public function doindex() { public function doindex()
{
global $_M; global $_M;
//加载表格数据获取类 //加载表格数据获取类
$table = load::own_class('tabledata', 'new'); $table = load::own_class('tabledata', 'new');
@ -46,17 +49,17 @@ class table_ajax extends appadmin {
$where = self::td_where(); $where = self::td_where();
$order = self::td_order(); $order = self::td_order();
/*查询表*/ /*查询表*/
if($where){ if ($where) {
$conds .= " WHERE {$where} "; $conds .= " WHERE {$where} ";
} }
if($order){ if ($order) {
$conds .= " ORDER BY {$order} "; $conds .= " ORDER BY {$order} ";
} }
//整理查询条件 //整理查询条件
$query = "SELECT {$field} FROM {$sqlk} {$conds} "; $query = "SELECT {$field} FROM {$sqlk} {$conds} ";
//获取数据 //获取数据
$data = $table->getdata($sqlk, $field, $where, $order,$query,$this->multi_table); $data = $table->getdata($sqlk, $field, $where, $order, $query, $this->multi_table);
//数据整理 //数据整理
$array = self::sqlarr($data); $array = self::sqlarr($data);
//返回数据 //返回数据
@ -69,28 +72,30 @@ class table_ajax extends appadmin {
* 【列出】 * 【列出】
* 返回数据数组 * 返回数据数组
*/ */
private function sqlarr($data = []) { private function sqlarr($data = [])
{
global $_M; global $_M;
// if(in_array($this->tname,$this->k_name)){ // if(in_array($this->tname,$this->k_name)){
foreach ($data as $val) { foreach ($data as $val) {
self::output($val); self::output($val);
$array[] = $this->list; $array[] = $this->list;
} }
return $array; return $array;
// }else{ // }else{
// return false; // return false;
// } // }
} }
/* /*
* 【新行】 * 【新行】
* 新增行分发 * 新增行分发
*/ */
public function do_table_add_list(){ public function do_table_add_list()
{
global $_M; global $_M;
$val = ['id' => 'new-'.$this->form['new_id'], 'p_type' => $this->form['p_type']]; $val = ['id' => 'new-' . $this->form['new_id'], 'p_type' => $this->form['p_type']];
if(in_array($this->tname,$this->k_name)){ if (in_array($this->tname, $this->k_name)) {
self::output($val,'checked=""'); self::output($val, 'checked=""');
} }
self::addlist($val); self::addlist($val);
} }
@ -99,11 +104,12 @@ class table_ajax extends appadmin {
* 【新行】 * 【新行】
* 生成文件新增行 * 生成文件新增行
*/ */
private function addlist($val) { private function addlist($val)
{
global $_M; global $_M;
$metinfo = ''; $metinfo = '';
foreach ($this->list as $v){ foreach ($this->list as $v) {
$metinfo .= '<td class=" text-xs-center">'.$v.'</td>'; $metinfo .= '<td class=" text-xs-center">' . $v . '</td>';
} }
echo "<tr>{$metinfo}</tr>"; echo "<tr>{$metinfo}</tr>";
} }
@ -112,9 +118,10 @@ class table_ajax extends appadmin {
use tlist; use tlist;
//公用的输出 //公用的输出
protected function output($val,$checked = '') { protected function output($val, $checked = '')
global $_M,$_YW; {
$array = self::{$this->tname}($val,$checked); global $_M, $_YW;
$array = self::{$this->tname}($val, $checked);
$this->list = array(); $this->list = array();
foreach ($array as $value) { foreach ($array as $value) {
$this->list[] = $value; $this->list[] = $value;

View File

@ -4,7 +4,8 @@ defined('IN_MET') or exit ('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
//表格 //表格
class table_off extends appadmin { class table_off extends appadmin
{
//获取的ID //获取的ID
private $allid; private $allid;
@ -21,16 +22,16 @@ class table_off extends appadmin {
public function __construct() public function __construct()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
$this->tname = $_M['form']['tname']; $this->tname = $_M['form']['tname'];
$this->sqlk = $_YW['k'][$this->tname]; $this->sqlk = $_YW['k'][ $this->tname ];
} }
public function __destruct() public function __destruct()
{ {
global $_M,$_YW; global $_M, $_YW;
if($this->destruct){ if ($this->destruct) {
switch ($this->tname) { switch ($this->tname) {
case 'para': case 'para':
$this->para = [ $this->para = [
@ -41,14 +42,15 @@ class table_off extends appadmin {
default: default:
break; break;
} }
if(count($this->para)) $para = '&'.http_build_query($this->para); if (count($this->para)) $para = '&' . http_build_query($this->para);
turnover($this->returl?:$_M['url']['own_name'] . 'c=table_on&a=do'.$this->tname.$para, $this->tips); turnover($this->returl ?: $_M['url']['own_name'] . 'c=table_on&a=do' . $this->tname . $para, $this->tips);
} }
} }
//主方法 //主方法
public function doindex(){ public function doindex()
global $_M,$_YW; {
global $_M, $_YW;
$this->allid = array_filter(explode(',', $_M['form']['all_id'])); $this->allid = array_filter(explode(',', $_M['form']['all_id']));
switch ($_M['form']['submit_type']) { switch ($_M['form']['submit_type']) {
case 'delet': case 'delet':
@ -72,19 +74,20 @@ class table_off extends appadmin {
break; break;
} }
if($_M['form']['method'] == 'ajax') { if ($_M['form']['method'] == 'ajax') {
$this->destruct = false; $this->destruct = false;
echo jsoncallback(['code' => $this->tsql->error()?1:0 ]); echo jsoncallback(['code' => $this->tsql->error() ? 1 : 0]);
} }
} }
//保存 //保存
private function save() { private function save()
global $_M,$_YW; {
global $_M, $_YW;
foreach ($this->allid as $id) { foreach ($this->allid as $id) {
if($id){ if ($id) {
$field = self::info($id); $field = self::info($id);
if(is_number($id)){ if (is_number($id)) {
$this->tsql->table($this->tname) $this->tsql->table($this->tname)
->field($field) ->field($field)
->where(" id = '{$id}' ") ->where(" id = '{$id}' ")
@ -99,13 +102,14 @@ class table_off extends appadmin {
} }
//删除 //删除
private function delet() { private function delet()
global $_M,$_YW; {
global $_M, $_YW;
foreach ($this->allid as $id) { foreach ($this->allid as $id) {
if($id){ if ($id) {
//删除关联表 //删除关联表
$ret = self::todel($id); $ret = self::todel($id);
if($ret == false) continue; if ($ret == false) continue;
//删除本表 //删除本表
$where = " id = '{$id}' "; $where = " id = '{$id}' ";
$this->tsql->table($this->tname) $this->tsql->table($this->tname)
@ -117,12 +121,13 @@ class table_off extends appadmin {
} }
//调整广告位状态 //调整广告位状态
private function enable($type = true) { private function enable($type = true)
global $_M,$_YW; {
$enable = $_M['form']['submit_type'] == 'enableon' || $_M['form']['submit_type'] == 'enable_on'?1:0; global $_M, $_YW;
$fid = $type?'e_vid':'id'; $enable = $_M['form']['submit_type'] == 'enableon' || $_M['form']['submit_type'] == 'enable_on' ? 1 : 0;
$fid = $type ? 'e_vid' : 'id';
foreach ($this->allid as $id) { foreach ($this->allid as $id) {
if($id){ if ($id) {
$this->tsql->table('elevator') $this->tsql->table('elevator')
->field(['e_enable' => $enable]) ->field(['e_enable' => $enable])
->where([$fid => $id]) ->where([$fid => $id])
@ -132,15 +137,16 @@ class table_off extends appadmin {
} }
//ajax单独调整 //ajax单独调整
private function typeonoff() { private function typeonoff()
global $_M,$_YW; {
global $_M, $_YW;
$field = $_M['form']['field']; $field = $_M['form']['field'];
$special = "ABS({$field}-1)"; $special = "ABS({$field}-1)";
$array = [$field => $special]; $array = [$field => $special];
$field_id = 'id'; $field_id = 'id';
foreach ($this->allid as $id) { foreach ($this->allid as $id) {
if($id){ if ($id) {
$this->tsql->table($this->tname) $this->tsql->table($this->tname)
->special($special) ->special($special)
->field($array) ->field($array)
@ -151,17 +157,18 @@ class table_off extends appadmin {
} }
//保存信息 //保存信息
private function info($id) { private function info($id)
global $_M,$_YW; {
global $_M, $_YW;
$lang = ''; $lang = '';
switch ($this->tname) { switch ($this->tname) {
case 'para': case 'para':
$info = [ $info = [
'p_type' => $_M['form']['p_type-'.$id], 'p_type' => $_M['form'][ 'p_type-' . $id ],
'p_order' => $_M['form']['p_order-'.$id], 'p_order' => $_M['form'][ 'p_order-' . $id ],
'p_name' => $_M['form']['p_name-'.$id], 'p_name' => $_M['form'][ 'p_name-' . $id ],
'p_value' => $_M['form']['p_value-'.$id], 'p_value' => $_M['form'][ 'p_value-' . $id ],
'p_text' => $_M['form']['p_text-'.$id] 'p_text' => $_M['form'][ 'p_text-' . $id ]
]; ];
break; break;
default: default:
@ -171,8 +178,9 @@ class table_off extends appadmin {
} }
//删除其他的关联表 //删除其他的关联表
private function todel($id) { private function todel($id)
global $_M,$_YW; {
global $_M, $_YW;
$ret = true; $ret = true;
switch ($this->tname) { switch ($this->tname) {
case 'contract': case 'contract':
@ -182,22 +190,22 @@ class table_off extends appadmin {
->one(); ->one();
//删除相关计划 //删除相关计划
$this->tsql->table('launch') $this->tsql->table('launch')
->where(['l_hnumber' => $contract['h_number'] ]) ->where(['l_hnumber' => $contract['h_number']])
->del(); ->del();
//删除相关排期 //删除相关排期
$this->tsql->table('schedule') $this->tsql->table('schedule')
->where(['s_hnumber' => $contract['h_number'] ]) ->where(['s_hnumber' => $contract['h_number']])
->del(); ->del();
break; break;
case 'launch': case 'launch':
//删除相关排期 //删除相关排期
$this->tsql->table('schedule') $this->tsql->table('schedule')
->where(['s_lid' => $id ]) ->where(['s_lid' => $id])
->del(); ->del();
break; break;
case 'para': case 'para':
//删除相关的光广告位 //删除相关的光广告位
if($_M['form']['p_num-'.$id] > 0) $ret = false; if ($_M['form'][ 'p_num-' . $id ] > 0) $ret = false;
break; break;
case 'village': case 'village':
//查询需要删除的广告位编号 //查询需要删除的广告位编号
@ -223,21 +231,22 @@ class table_off extends appadmin {
} }
// 删除排期广告位编号 // 删除排期广告位编号
private function del_elevator($num) { private function del_elevator($num)
{
$dellist = []; $dellist = [];
if(!is_array($num)) $num = [$num]; if (!is_array($num)) $num = [$num];
$num = array_unique($num); $num = array_unique($num);
if(count($num) == 0) return false; if (count($num) == 0) return false;
// 广告位数组 // 广告位数组
foreach ($num as $e_number){ foreach ($num as $e_number) {
// 删除广告位 // 删除广告位
$this->tsql->table('elevator') $this->tsql->table('elevator')
->where(['e_number' => $e_number ]) ->where(['e_number' => $e_number])
->del(); ->del();
//删除相关排期缓存 //删除相关排期缓存
$this->tsql->table('schedule') $this->tsql->table('schedule')
->where(['s_enumber' => $e_number ]) ->where(['s_enumber' => $e_number])
->del(); ->del();
// 整理数据 // 整理数据
$launch = false; $launch = false;
@ -248,29 +257,29 @@ class table_off extends appadmin {
->all(); ->all();
// 处理的核心函数 // 处理的核心函数
$col = function($launch,$field) use(&$dellist,$e_number){ $col = function ($launch, $field) use (&$dellist, $e_number) {
foreach ($launch as $val){ foreach ($launch as $val) {
$dellist[$val['id']]['info'] = $val; $dellist[ $val['id'] ]['info'] = $val;
$dellist[$val['id']][$field][] = $e_number; $dellist[ $val['id'] ][ $field ][] = $e_number;
} }
}; };
if($launch != false) $col($launch,'l_selectenum'); if ($launch != false) $col($launch, 'l_selectenum');
// 排期成功的广告位 // 排期成功的广告位
$launch = $this->tsql->table('launch') $launch = $this->tsql->table('launch')
->where(" find_in_set( '{$e_number}', l_enumber ) ") ->where(" find_in_set( '{$e_number}', l_enumber ) ")
->all(); ->all();
if($launch != false) $col($launch,'l_enumber'); if ($launch != false) $col($launch, 'l_enumber');
} }
if(count($dellist) == 0) return false; if (count($dellist) == 0) return false;
// 对值进行统计并修改 // 对值进行统计并修改
foreach ($dellist as $id => $la){ foreach ($dellist as $id => $la) {
// 处理的核心函数 // 处理的核心函数
$enum = function($field) use($la){ $enum = function ($field) use ($la) {
// 拿到la内需要去掉的值 数组 // 拿到la内需要去掉的值 数组
// 再通过对比获得差异值,并去重,再转成字符串 // 再通过对比获得差异值,并去重,再转成字符串
return is_array($la[$field])?arrayto_string(array_unique(array_diff(stringto_array($la['info'][$field],','),$la[$field])),','):$la['info'][$field]; return is_array($la[ $field ]) ? arrayto_string(array_unique(array_diff(stringto_array($la['info'][ $field ], ','), $la[ $field ])), ',') : $la['info'][ $field ];
}; };
//mysql //mysql
@ -283,4 +292,5 @@ class table_off extends appadmin {
} }
} }
?> ?>

View File

@ -3,35 +3,36 @@ defined('IN_MET') or exit ('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
class table_on extends appadmin { class table_on extends appadmin
{
// 表格标题 // 表格标题
private $table_theme; // 等待完善 private $table_theme; // 等待完善
public function __construct() public function __construct()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
parent::appnav(); parent::appnav();
parent::point('table_off','doindex','table'); parent::point('table_off', 'doindex', 'table');
$this->table_theme = load::own_class('table_theme','new'); $this->table_theme = load::own_class('table_theme', 'new');
} }
//输出模板内容 //输出模板内容
public function __destruct() public function __destruct()
{ {
global $_M,$_YW; global $_M, $_YW;
if($this->destruct){ if ($this->destruct) {
if(empty($this->appshow)) $this->appshow = 'app/'.$this->tname; if (empty($this->appshow)) $this->appshow = 'app/' . $this->tname;
require $this->show($this->appshow,$this->input); require $this->show($this->appshow, $this->input);
} }
} }
//广告位统计 //广告位统计
public function doelevator() public function doelevator()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
} }
@ -39,7 +40,7 @@ class table_on extends appadmin {
//场所统计 //场所统计
public function dovillage() public function dovillage()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
} }
@ -47,7 +48,7 @@ class table_on extends appadmin {
//广告合同关联表 //广告合同关联表
public function doschedule() public function doschedule()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(); $this->input['table'] = $this->table_theme->start($this->tname)->send_all();
} }
@ -55,7 +56,7 @@ class table_on extends appadmin {
//合同统计 //合同统计
public function docontract() public function docontract()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(); $this->input['table'] = $this->table_theme->start($this->tname)->send_all();
} }
@ -63,7 +64,7 @@ class table_on extends appadmin {
//企业资料 //企业资料
public function docustomer() public function docustomer()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
} }
@ -71,7 +72,7 @@ class table_on extends appadmin {
//企业联系人 //企业联系人
public function doworkers() public function doworkers()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
} }
@ -79,7 +80,7 @@ class table_on extends appadmin {
//投放计划单 //投放计划单
public function dolaunch() public function dolaunch()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
} }
@ -87,7 +88,7 @@ class table_on extends appadmin {
//参数配置 //参数配置
public function dopara() public function dopara()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(); $this->input['table'] = $this->table_theme->start($this->tname)->send_all();
} }
@ -95,18 +96,18 @@ class table_on extends appadmin {
// 场所统计 // 场所统计
public function dovillages() public function dovillages()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$vs_daytime = date('Y-m-d',time()); $vs_daytime = date('Y-m-d', time());
$this->input['top']['tips'] = ' $this->input['top']['tips'] = '
<div class="alert dark alert-primary radius0 m-b-5"> <div class="alert dark alert-primary radius0 m-b-5">
<p><mark>闲置个数、排期中的个数、到期个数、预排的个数计算说明</mark></p> <p><mark>闲置个数、排期中的个数、到期个数、预排的个数计算说明</mark></p>
<ol> <ol>
<li>若选择时间区段,若两者缺少其中一个则自动补全为当天时间(<span class="tag tag-danger">'.$vs_daytime.'</span></li> <li>若选择时间区段,若两者缺少其中一个则自动补全为当天时间(<span class="tag tag-danger">' . $vs_daytime . '</span></li>
<li><span class="tag tag-danger">闲置:</span>默认计算当天('.$vs_daytime.')的广告位闲置个数,选择时间区段后,计算的可以满足时间区段的广告位个数。(<span class="tag tag-danger">仅计算启用的广告位</span>)</li> <li><span class="tag tag-danger">闲置:</span>默认计算当天(' . $vs_daytime . ')的广告位闲置个数,选择时间区段后,计算的可以满足时间区段的广告位个数。(<span class="tag tag-danger">仅计算启用的广告位</span>)</li>
<li><span class="tag tag-danger">排期中:</span>默认计算当天('.$vs_daytime.')排期中的个数,选择时间区段后,计算的在时间区段内有排期的广告位个数。</li> <li><span class="tag tag-danger">排期中:</span>默认计算当天(' . $vs_daytime . ')排期中的个数,选择时间区段后,计算的在时间区段内有排期的广告位个数。</li>
<li><span class="tag tag-danger">到期:</span>默认以当天('.$vs_daytime.')为准,计算<span class="tag tag-danger">7</span>天后到期的个数,选择时间区段后,计算的在时间区段内到期的广告位个数。</li> <li><span class="tag tag-danger">到期:</span>默认以当天(' . $vs_daytime . ')为准,计算<span class="tag tag-danger">7</span>天后到期的个数,选择时间区段后,计算的在时间区段内到期的广告位个数。</li>
<li><span class="tag tag-danger">预排:</span>默认计算当天('.$vs_daytime.')以后才开始的排期广告位个数,选择时间区段后,计算的是时间区段内排期状态为预排的广告位个数。</li> <li><span class="tag tag-danger">预排:</span>默认计算当天(' . $vs_daytime . ')以后才开始的排期广告位个数,选择时间区段后,计算的是时间区段内排期状态为预排的广告位个数。</li>
</ol> </ol>
</div>'; </div>';
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
@ -115,7 +116,7 @@ class table_on extends appadmin {
// 场所统计 // 场所统计
public function doelevators() public function doelevators()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(1); $this->input['table'] = $this->table_theme->start($this->tname)->send_all(1);
} }
@ -123,13 +124,12 @@ class table_on extends appadmin {
// 巡查密钥列表 // 巡查密钥列表
public function dokeylist() public function dokeylist()
{ {
global $_M,$_YW; global $_M, $_YW;
parent::appurl(parent::tname()); parent::appurl(parent::tname());
$this->input['table'] = $this->table_theme->start($this->tname)->send_all(); $this->input['table'] = $this->table_theme->start($this->tname)->send_all();
} }
} }
?> ?>

View File

@ -73,12 +73,12 @@ $met_title = $data['met_title'];
<input type="text" name="h_texta" <input type="text" name="h_texta"
value="{$data.data.h_texta}" value="{$data.data.h_texta}"
class="form-control" class="form-control"
placeholder='投放周期' > placeholder='投放周期'>
<span class="input-group-addon">--</span> <span class="input-group-addon">--</span>
<input type="text" name="h_tower" <input type="text" name="h_tower"
value="{$data.data.h_tower}" value="{$data.data.h_tower}"
class="form-control" class="form-control"
placeholder='投放台数' > placeholder='投放台数'>
<span class="input-group-addon"></span> <span class="input-group-addon"></span>
</div> </div>
<span class="text-help m-l-10"></span> <span class="text-help m-l-10"></span>
@ -117,7 +117,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>合同到期通知</label></dt> <dt><label class='form-control-label'>合同到期通知</label></dt>
<dd> <dd>
<input type="text" name="h_noticeday" placeholder="输入天数,限于数字" value="{$data.data.h_noticeday}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="h_noticeday" placeholder="输入天数,限于数字" value="{$data.data.h_noticeday}"
data-plugin='tokenfield' data-delimiter=','/>
<span class="text-help m-l-10">可设置多个通知天数,输入完成一个回车后再输入下一个</span> <span class="text-help m-l-10">可设置多个通知天数,输入完成一个回车后再输入下一个</span>
</dd> </dd>
</dl> </dl>
@ -138,7 +139,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>合同备注</label></dt> <dt><label class='form-control-label'>合同备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="h_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.h_text}</textarea> <textarea name="h_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.h_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -7,16 +7,16 @@
background-color: #fff; background-color: #fff;
border: 0 solid transparent; border: 0 solid transparent;
border-radius: .286rem; border-radius: .286rem;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: 0 1px 1px rgba(0,0,0,.05) box-shadow: 0 1px 1px rgba(0, 0, 0, .05)
} }
.panel-content>.row { .panel-content > .row {
padding-left: 30px; padding-left: 30px;
padding-right: 30px padding-right: 30px
} }
.panel-content>.row>[class*=col-] { .panel-content > .row > [class*=col-] {
padding-left: 30px; padding-left: 30px;
padding-right: 30px padding-right: 30px
} }
@ -29,11 +29,11 @@
border-top-left-radius: .214rem border-top-left-radius: .214rem
} }
.panel-heading+.alert { .panel-heading + .alert {
border-radius: 0 border-radius: 0
} }
.panel-heading>.nav-tabs { .panel-heading > .nav-tabs {
border-bottom: none border-bottom: none
} }
@ -42,24 +42,24 @@
background-color: #62a8ea background-color: #62a8ea
} }
.panel-heading-tab>.nav-tabs .nav-link { .panel-heading-tab > .nav-tabs .nav-link {
color: #fff color: #fff
} }
.panel-heading-tab>.nav-tabs .nav-link.hover,.panel-heading-tab>.nav-tabs .nav-link:hover { .panel-heading-tab > .nav-tabs .nav-link.hover, .panel-heading-tab > .nav-tabs .nav-link:hover {
color: #76838f color: #76838f
} }
.panel-heading-tab>.nav-tabs .nav-link.active,.panel-heading-tab>.nav-tabs .nav-link:active { .panel-heading-tab > .nav-tabs .nav-link.active, .panel-heading-tab > .nav-tabs .nav-link:active {
color: #76838f; color: #76838f;
background-color: #fff background-color: #fff
} }
.panel-heading+.nav-tabs { .panel-heading + .nav-tabs {
margin-top: -.715rem margin-top: -.715rem
} }
.panel-heading>.dropdown .dropdown-toggle { .panel-heading > .dropdown .dropdown-toggle {
color: inherit color: inherit
} }
@ -74,19 +74,19 @@
clear: both clear: both
} }
.panel-heading+.panel-body { .panel-heading + .panel-body {
padding-top: 0 padding-top: 0
} }
.panel-body .h1:first-child,.panel-body .h2:first-child,.panel-body .h3:first-child,.panel-body .h4:first-child,.panel-body .h5:first-child,.panel-body .h6:first-child,.panel-body h1:first-child,.panel-body h2:first-child,.panel-body h3:first-child,.panel-body h4:first-child,.panel-body h5:first-child,.panel-body h6:first-child { .panel-body .h1:first-child, .panel-body .h2:first-child, .panel-body .h3:first-child, .panel-body .h4:first-child, .panel-body .h5:first-child, .panel-body .h6:first-child, .panel-body h1:first-child, .panel-body h2:first-child, .panel-body h3:first-child, .panel-body h4:first-child, .panel-body h5:first-child, .panel-body h6:first-child {
margin-top: 0 margin-top: 0
} }
.panel-body>:last-child { .panel-body > :last-child {
margin-bottom: 0 margin-bottom: 0
} }
.panel-body>.list-group-dividered:only-child>.list-group-item:last-child { .panel-body > .list-group-dividered:only-child > .list-group-item:last-child {
border-bottom-color: transparent border-bottom-color: transparent
} }
@ -98,7 +98,7 @@
border-bottom-left-radius: .214rem border-bottom-left-radius: .214rem
} }
.table+.panel-footer { .table + .panel-footer {
padding-top: 15px; padding-top: 15px;
border-color: #e4eaec border-color: #e4eaec
} }
@ -112,19 +112,19 @@
color: #37474f color: #37474f
} }
.panel-title>.icon { .panel-title > .icon {
margin-right: 10px margin-right: 10px
} }
.panel-title>.tag { .panel-title > .tag {
margin-left: 10px margin-left: 10px
} }
.panel-title .small,.panel-title small { .panel-title .small, .panel-title small {
color: #76838f color: #76838f
} }
.panel-title>.small>a,.panel-title>a,.panel-title>small>a { .panel-title > .small > a, .panel-title > a, .panel-title > small > a {
color: inherit color: inherit
} }
@ -140,17 +140,17 @@
position: absolute; position: absolute;
right: 30px; right: 30px;
top: 50%; top: 50%;
-webkit-transform: translate(0,-50%); -webkit-transform: translate(0, -50%);
-ms-transform: translate(0,-50%); -ms-transform: translate(0, -50%);
-o-transform: translate(0,-50%); -o-transform: translate(0, -50%);
transform: translate(0,-50%); transform: translate(0, -50%);
margin: auto; margin: auto;
z-index: 1 z-index: 1
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel-actions { .panel-actions {
right:20px right: 20px
} }
} }
@ -158,12 +158,12 @@ ul .panel-actions {
list-style: none list-style: none
} }
ul .panel-actions>li { ul .panel-actions > li {
display: inline-block; display: inline-block;
margin-left: 8px margin-left: 8px
} }
ul .panel-actions>li:first-child { ul .panel-actions > li:first-child {
margin-left: 0 margin-left: 0
} }
@ -209,12 +209,12 @@ ul.panel-actions {
list-style: none list-style: none
} }
ul.panel-actions>li { ul.panel-actions > li {
display: inline-block; display: inline-block;
margin-left: 8px margin-left: 8px
} }
ul.panel-actions>li:first-child { ul.panel-actions > li:first-child {
margin-left: 0 margin-left: 0
} }
@ -240,7 +240,7 @@ ul.panel-actions>li:first-child {
text-align: center text-align: center
} }
.panel-toolbar .btn.active,.panel-toolbar .btn:active,.panel-toolbar .btn:hover { .panel-toolbar .btn.active, .panel-toolbar .btn:active, .panel-toolbar .btn:hover {
color: #76838f color: #76838f
} }
@ -260,19 +260,19 @@ ul.panel-actions>li:first-child {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
-webkit-transform: translate(-50%,-50%); -webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%,-50%); -ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%,-50%); -o-transform: translate(-50%, -50%);
transform: translate(-50%,-50%) transform: translate(-50%, -50%)
} }
.panel>:not(.panel-loading):not(.collapsing) { .panel > :not(.panel-loading):not(.collapsing) {
-webkit-transition: opacity .3s; -webkit-transition: opacity .3s;
-o-transition: opacity .3s; -o-transition: opacity .3s;
transition: opacity .3s transition: opacity .3s
} }
.panel.is-loading>:not(.panel-loading) { .panel.is-loading > :not(.panel-loading) {
opacity: .3 opacity: .3
} }
@ -294,23 +294,23 @@ ul.panel-actions>li:first-child {
} }
.panel-body.scrollable-vertical { .panel-body.scrollable-vertical {
padding-left: 0!important; padding-left: 0 !important;
padding-right: 0!important padding-right: 0 !important
} }
.panel-body.scrollable-vertical>.scrollable-container>.scrollable-content { .panel-body.scrollable-vertical > .scrollable-container > .scrollable-content {
padding-left: 30px; padding-left: 30px;
padding-right: 30px padding-right: 30px
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel-body.scrollable-vertical>.scrollable-container>.scrollable-content { .panel-body.scrollable-vertical > .scrollable-container > .scrollable-content {
padding-left:20px; padding-left: 20px;
padding-right: 20px padding-right: 20px
} }
} }
.panel-body.scrollable-vertical>.scrollable-bar { .panel-body.scrollable-vertical > .scrollable-bar {
margin-top: 0; margin-top: 0;
margin-bottom: 30px; margin-bottom: 30px;
height: -webkit-calc(100% - 30px); height: -webkit-calc(100% - 30px);
@ -321,28 +321,28 @@ ul.panel-actions>li:first-child {
transform: translateX(-26px) transform: translateX(-26px)
} }
.panel-bordered>.panel-body.scrollable-vertical>.scrollable-bar { .panel-bordered > .panel-body.scrollable-vertical > .scrollable-bar {
margin-bottom: 30px; margin-bottom: 30px;
height: -webkit-calc(100% - 60px); height: -webkit-calc(100% - 60px);
height: calc(100% - 60px) height: calc(100% - 60px)
} }
.panel-body.scrollable-horizontal { .panel-body.scrollable-horizontal {
padding-top: 0!important; padding-top: 0 !important;
padding-bottom: 0!important padding-bottom: 0 !important
} }
.panel-body.scrollable-horizontal>.scrollable-container>.scrollable-content { .panel-body.scrollable-horizontal > .scrollable-container > .scrollable-content {
padding-top: 0; padding-top: 0;
padding-bottom: 30px padding-bottom: 30px
} }
.panel-bordered>.panel-body.scrollable-horizontal>.scrollable-container>.scrollable-content { .panel-bordered > .panel-body.scrollable-horizontal > .scrollable-container > .scrollable-content {
padding-top: 30px; padding-top: 30px;
padding-bottom: 30px padding-bottom: 30px
} }
.panel-body.scrollable-horizontal>.scrollable-bar { .panel-body.scrollable-horizontal > .scrollable-bar {
margin-left: 0; margin-left: 0;
margin-right: 30px; margin-right: 30px;
width: -webkit-calc(100% - 60px); width: -webkit-calc(100% - 60px);
@ -354,38 +354,38 @@ ul.panel-actions>li:first-child {
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel-body.scrollable-horizontal>.scrollable-bar { .panel-body.scrollable-horizontal > .scrollable-bar {
margin-right:20px; margin-right: 20px;
width: -webkit-calc(100% - 40px); width: -webkit-calc(100% - 40px);
width: calc(100% - 40px) width: calc(100% - 40px)
} }
} }
.panel-bordered>.panel-body.scrollable-horizontal>.scrollable-bar { .panel-bordered > .panel-body.scrollable-horizontal > .scrollable-bar {
-webkit-transform: translateY(-26px); -webkit-transform: translateY(-26px);
-ms-transform: translateY(-26px); -ms-transform: translateY(-26px);
-o-transform: translateY(-26px); -o-transform: translateY(-26px);
transform: translateY(-26px) transform: translateY(-26px)
} }
.panel-bordered>.panel-heading { .panel-bordered > .panel-heading {
border-bottom: 1px solid #e4eaec border-bottom: 1px solid #e4eaec
} }
.panel-bordered>.panel-heading>.panel-title { .panel-bordered > .panel-heading > .panel-title {
padding-bottom: 20px padding-bottom: 20px
} }
.panel-bordered>.panel-footer { .panel-bordered > .panel-footer {
border-top: 1px solid #e4eaec; border-top: 1px solid #e4eaec;
padding-top: 15px padding-top: 15px
} }
.panel-bordered>.panel-body { .panel-bordered > .panel-body {
padding-top: 30px padding-top: 30px
} }
.panel-bordered>.table>tbody:first-child>tr:first-child td,.panel-bordered>.table>tbody:first-child>tr:first-child th { .panel-bordered > .table > tbody:first-child > tr:first-child td, .panel-bordered > .table > tbody:first-child > tr:first-child th {
border-top: 0 border-top: 0
} }
@ -397,20 +397,20 @@ ul.panel-actions>li:first-child {
cursor: move cursor: move
} }
.panel>.nav-tabs-vertical .nav-tabs { .panel > .nav-tabs-vertical .nav-tabs {
margin-left: -1px margin-left: -1px
} }
.panel>.nav-tabs-vertical .nav-tabs>li>a { .panel > .nav-tabs-vertical .nav-tabs > li > a {
border-left: none; border-left: none;
border-radius: 0 border-radius: 0
} }
.panel>.nav-tabs-vertical .nav-tabs.nav-tabs-reverse { .panel > .nav-tabs-vertical .nav-tabs.nav-tabs-reverse {
margin-right: -1px margin-right: -1px
} }
.panel>.nav-tabs-vertical .nav-tabs.nav-tabs-reverse>li>a { .panel > .nav-tabs-vertical .nav-tabs.nav-tabs-reverse > li > a {
border-right: none; border-right: none;
border-radius: 0 border-radius: 0
} }
@ -450,170 +450,171 @@ ul.panel-actions>li:first-child {
height: 0 height: 0
} }
.panel>.alert { .panel > .alert {
padding-left: 30px; padding-left: 30px;
padding-right: 30px padding-right: 30px
} }
.panel>.alert-dismissible { .panel > .alert-dismissible {
padding-right: 50px padding-right: 50px
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel>.alert { .panel > .alert {
padding-left:20px; padding-left: 20px;
padding-right: 20px padding-right: 20px
} }
.panel>.alert-dismissible { .panel > .alert-dismissible {
padding-right: 40px padding-right: 40px
} }
} }
.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table { .panel > .panel-collapse > .table, .panel > .table, .panel > .table-responsive > .table {
margin-bottom: 0 margin-bottom: 0
} }
.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption { .panel > .panel-collapse > .table caption, .panel > .table caption, .panel > .table-responsive > .table caption {
padding-left: 30px 30px; padding-left: 30px 30px;
padding-right: 30px 30px padding-right: 30px 30px
} }
.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child { .panel > .table-responsive:first-child > .table:first-child, .panel > .table:first-child {
border-top-right-radius: .214rem; border-top-right-radius: .214rem;
border-top-left-radius: .214rem border-top-left-radius: .214rem
} }
.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child { .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table:first-child > thead:first-child > tr:first-child {
border-top-left-radius: .214rem; border-top-left-radius: .214rem;
border-top-right-radius: .214rem border-top-right-radius: .214rem
} }
.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child { .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child {
border-top-left-radius: .214rem border-top-left-radius: .214rem
} }
.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child { .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child {
border-top-right-radius: .214rem border-top-right-radius: .214rem
} }
.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child { .panel > .table-responsive:last-child > .table:last-child, .panel > .table:last-child {
border-bottom-right-radius: .214rem; border-bottom-right-radius: .214rem;
border-bottom-left-radius: .214rem border-bottom-left-radius: .214rem
} }
.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child { .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child {
border-bottom-left-radius: .214rem; border-bottom-left-radius: .214rem;
border-bottom-right-radius: .214rem border-bottom-right-radius: .214rem
} }
.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child { .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
border-bottom-left-radius: .214rem border-bottom-left-radius: .214rem
} }
.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child { .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
border-bottom-right-radius: .214rem border-bottom-right-radius: .214rem
} }
.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body { .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body {
border-top: 1px solid #e4eaec border-top: 1px solid #e4eaec
} }
.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th { .panel > .table > tbody:first-child > tr:first-child td, .panel > .table > tbody:first-child > tr:first-child th {
border-top: 0 border-top: 0
} }
.panel>.table-bordered,.panel>.table-responsive>.table-bordered { .panel > .table-bordered, .panel > .table-responsive > .table-bordered {
border: 0 border: 0
} }
.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child { .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child {
border-left: 0 border-left: 0
} }
.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child { .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child {
border-right: 0 border-right: 0
} }
.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th { .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th {
border-bottom: 0 border-bottom: 0
} }
.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th { .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
border-bottom: 0 border-bottom: 0
} }
.panel>.table-responsive { .panel > .table-responsive {
border: 0; border: 0;
margin-bottom: 0 margin-bottom: 0
} }
.panel>.table-responsive .table>tbody>tr>td:first-child,.panel>.table-responsive .table>tbody>tr>th:first-child,.panel>.table-responsive .table>tfoot>tr>td:first-child,.panel>.table-responsive .table>tfoot>tr>th:first-child,.panel>.table-responsive .table>thead>tr>td:first-child,.panel>.table-responsive .table>thead>tr>th:first-child,.panel>.table-responsive .table>tr>td:first-child,.panel>.table-responsive .table>tr>th:first-child,.panel>.table>tbody>tr>td:first-child,.panel>.table>tbody>tr>th:first-child,.panel>.table>tfoot>tr>td:first-child,.panel>.table>tfoot>tr>th:first-child,.panel>.table>thead>tr>td:first-child,.panel>.table>thead>tr>th:first-child,.panel>.table>tr>td:first-child,.panel>.table>tr>th:first-child { .panel > .table-responsive .table > tbody > tr > td:first-child, .panel > .table-responsive .table > tbody > tr > th:first-child, .panel > .table-responsive .table > tfoot > tr > td:first-child, .panel > .table-responsive .table > tfoot > tr > th:first-child, .panel > .table-responsive .table > thead > tr > td:first-child, .panel > .table-responsive .table > thead > tr > th:first-child, .panel > .table-responsive .table > tr > td:first-child, .panel > .table-responsive .table > tr > th:first-child, .panel > .table > tbody > tr > td:first-child, .panel > .table > tbody > tr > th:first-child, .panel > .table > tfoot > tr > td:first-child, .panel > .table > tfoot > tr > th:first-child, .panel > .table > thead > tr > td:first-child, .panel > .table > thead > tr > th:first-child, .panel > .table > tr > td:first-child, .panel > .table > tr > th:first-child {
padding-left: 30px padding-left: 30px
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel>.table-responsive .table>tbody>tr>td:first-child,.panel>.table-responsive .table>tbody>tr>th:first-child,.panel>.table-responsive .table>tfoot>tr>td:first-child,.panel>.table-responsive .table>tfoot>tr>th:first-child,.panel>.table-responsive .table>thead>tr>td:first-child,.panel>.table-responsive .table>thead>tr>th:first-child,.panel>.table-responsive .table>tr>td:first-child,.panel>.table-responsive .table>tr>th:first-child,.panel>.table>tbody>tr>td:first-child,.panel>.table>tbody>tr>th:first-child,.panel>.table>tfoot>tr>td:first-child,.panel>.table>tfoot>tr>th:first-child,.panel>.table>thead>tr>td:first-child,.panel>.table>thead>tr>th:first-child,.panel>.table>tr>td:first-child,.panel>.table>tr>th:first-child { .panel > .table-responsive .table > tbody > tr > td:first-child, .panel > .table-responsive .table > tbody > tr > th:first-child, .panel > .table-responsive .table > tfoot > tr > td:first-child, .panel > .table-responsive .table > tfoot > tr > th:first-child, .panel > .table-responsive .table > thead > tr > td:first-child, .panel > .table-responsive .table > thead > tr > th:first-child, .panel > .table-responsive .table > tr > td:first-child, .panel > .table-responsive .table > tr > th:first-child, .panel > .table > tbody > tr > td:first-child, .panel > .table > tbody > tr > th:first-child, .panel > .table > tfoot > tr > td:first-child, .panel > .table > tfoot > tr > th:first-child, .panel > .table > thead > tr > td:first-child, .panel > .table > thead > tr > th:first-child, .panel > .table > tr > td:first-child, .panel > .table > tr > th:first-child {
padding-left:20px padding-left: 20px
} }
} }
.panel>.table-responsive .table>tbody>tr>td:last-child,.panel>.table-responsive .table>tbody>tr>th:last-child,.panel>.table-responsive .table>tfoot>tr>td:last-child,.panel>.table-responsive .table>tfoot>tr>th:last-child,.panel>.table-responsive .table>thead>tr>td:last-child,.panel>.table-responsive .table>thead>tr>th:last-child,.panel>.table-responsive .table>tr>td:last-child,.panel>.table-responsive .table>tr>th:last-child,.panel>.table>tbody>tr>td:last-child,.panel>.table>tbody>tr>th:last-child,.panel>.table>tfoot>tr>td:last-child,.panel>.table>tfoot>tr>th:last-child,.panel>.table>thead>tr>td:last-child,.panel>.table>thead>tr>th:last-child,.panel>.table>tr>td:last-child,.panel>.table>tr>th:last-child { .panel > .table-responsive .table > tbody > tr > td:last-child, .panel > .table-responsive .table > tbody > tr > th:last-child, .panel > .table-responsive .table > tfoot > tr > td:last-child, .panel > .table-responsive .table > tfoot > tr > th:last-child, .panel > .table-responsive .table > thead > tr > td:last-child, .panel > .table-responsive .table > thead > tr > th:last-child, .panel > .table-responsive .table > tr > td:last-child, .panel > .table-responsive .table > tr > th:last-child, .panel > .table > tbody > tr > td:last-child, .panel > .table > tbody > tr > th:last-child, .panel > .table > tfoot > tr > td:last-child, .panel > .table > tfoot > tr > th:last-child, .panel > .table > thead > tr > td:last-child, .panel > .table > thead > tr > th:last-child, .panel > .table > tr > td:last-child, .panel > .table > tr > th:last-child {
padding-right: 30px padding-right: 30px
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel>.table-responsive .table>tbody>tr>td:last-child,.panel>.table-responsive .table>tbody>tr>th:last-child,.panel>.table-responsive .table>tfoot>tr>td:last-child,.panel>.table-responsive .table>tfoot>tr>th:last-child,.panel>.table-responsive .table>thead>tr>td:last-child,.panel>.table-responsive .table>thead>tr>th:last-child,.panel>.table-responsive .table>tr>td:last-child,.panel>.table-responsive .table>tr>th:last-child,.panel>.table>tbody>tr>td:last-child,.panel>.table>tbody>tr>th:last-child,.panel>.table>tfoot>tr>td:last-child,.panel>.table>tfoot>tr>th:last-child,.panel>.table>thead>tr>td:last-child,.panel>.table>thead>tr>th:last-child,.panel>.table>tr>td:last-child,.panel>.table>tr>th:last-child { .panel > .table-responsive .table > tbody > tr > td:last-child, .panel > .table-responsive .table > tbody > tr > th:last-child, .panel > .table-responsive .table > tfoot > tr > td:last-child, .panel > .table-responsive .table > tfoot > tr > th:last-child, .panel > .table-responsive .table > thead > tr > td:last-child, .panel > .table-responsive .table > thead > tr > th:last-child, .panel > .table-responsive .table > tr > td:last-child, .panel > .table-responsive .table > tr > th:last-child, .panel > .table > tbody > tr > td:last-child, .panel > .table > tbody > tr > th:last-child, .panel > .table > tfoot > tr > td:last-child, .panel > .table > tfoot > tr > th:last-child, .panel > .table > thead > tr > td:last-child, .panel > .table > thead > tr > th:last-child, .panel > .table > tr > td:last-child, .panel > .table > tr > th:last-child {
padding-right:20px padding-right: 20px
} }
} }
.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th { .panel > .table > tbody:first-child > tr:first-child td, .panel > .table > tbody:first-child > tr:first-child th {
border-top: 1px solid #e4eaec border-top: 1px solid #e4eaec
} }
.panel>.list-group,.panel>.panel-collapse>.list-group { .panel > .list-group, .panel > .panel-collapse > .list-group {
margin-bottom: 0 margin-bottom: 0
} }
.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item,.panel>.panel-body>.list-group .list-group-item{
.panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item, .panel > .panel-body > .list-group .list-group-item {
border-width: 1px 0; border-width: 1px 0;
border-radius: 0 border-radius: 0
} }
.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child { .panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
border-top: 0; border-top: 0;
border-top-right-radius: .214rem; border-top-right-radius: .214rem;
border-top-left-radius: .214rem border-top-left-radius: .214rem
} }
.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child { .panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
border-bottom: 0; border-bottom: 0;
border-bottom-right-radius: .214rem; border-bottom-right-radius: .214rem;
border-bottom-left-radius: .214rem border-bottom-left-radius: .214rem
} }
.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child { .panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
border-top-right-radius: 0; border-top-right-radius: 0;
border-top-left-radius: 0 border-top-left-radius: 0
} }
.panel>.list-group .list-group-item { .panel > .list-group .list-group-item {
padding-right: 30px; padding-right: 30px;
padding-left: 30px padding-left: 30px
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel>.list-group .list-group-item { .panel > .list-group .list-group-item {
padding-left:20px; padding-left: 20px;
padding-right: 20px padding-right: 20px
} }
} }
.panel-heading+.list-group .list-group-item:first-child { .panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0 border-top-width: 0
} }
.list-group+.panel-footer { .list-group + .panel-footer {
border-top-width: 0 border-top-width: 0
} }
@ -624,7 +625,7 @@ ul.panel-actions>li:first-child {
box-shadow: none box-shadow: none
} }
.panel.panel-transparent>.panel-footer,.panel.panel-transparent>.panel-heading { .panel.panel-transparent > .panel-footer, .panel.panel-transparent > .panel-heading {
border-color: transparent border-color: transparent
} }
@ -634,7 +635,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-default .panel-heading+.panel-collapse>.panel-body { .panel-default .panel-heading + .panel-collapse > .panel-body {
border-top-color: #e4eaec border-top-color: #e4eaec
} }
@ -651,7 +652,7 @@ ul.panel-actions>li:first-child {
color: #76838f color: #76838f
} }
.panel-default .panel-footer+.panel-collapse>.panel-body { .panel-default .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #e4eaec border-bottom-color: #e4eaec
} }
@ -665,7 +666,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-primary .panel-heading+.panel-collapse>.panel-body { .panel-primary .panel-heading + .panel-collapse > .panel-body {
border-top-color: #62a8ea border-top-color: #62a8ea
} }
@ -682,7 +683,7 @@ ul.panel-actions>li:first-child {
color: #fff color: #fff
} }
.panel-primary .panel-footer+.panel-collapse>.panel-body { .panel-primary .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #62a8ea border-bottom-color: #62a8ea
} }
@ -692,7 +693,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-success .panel-heading+.panel-collapse>.panel-body { .panel-success .panel-heading + .panel-collapse > .panel-body {
border-top-color: #3dae6a border-top-color: #3dae6a
} }
@ -709,7 +710,7 @@ ul.panel-actions>li:first-child {
color: #fff color: #fff
} }
.panel-success .panel-footer+.panel-collapse>.panel-body { .panel-success .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #3dae6a border-bottom-color: #3dae6a
} }
@ -719,7 +720,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-info .panel-heading+.panel-collapse>.panel-body { .panel-info .panel-heading + .panel-collapse > .panel-body {
border-top-color: #3bcdc4 border-top-color: #3bcdc4
} }
@ -736,7 +737,7 @@ ul.panel-actions>li:first-child {
color: #fff color: #fff
} }
.panel-info .panel-footer+.panel-collapse>.panel-body { .panel-info .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #3bcdc4 border-bottom-color: #3bcdc4
} }
@ -746,7 +747,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-warning .panel-heading+.panel-collapse>.panel-body { .panel-warning .panel-heading + .panel-collapse > .panel-body {
border-top-color: #f18246 border-top-color: #f18246
} }
@ -763,7 +764,7 @@ ul.panel-actions>li:first-child {
color: #fff color: #fff
} }
.panel-warning .panel-footer+.panel-collapse>.panel-body { .panel-warning .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #f18246 border-bottom-color: #f18246
} }
@ -773,7 +774,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-danger .panel-heading+.panel-collapse>.panel-body { .panel-danger .panel-heading + .panel-collapse > .panel-body {
border-top-color: #f85974 border-top-color: #f85974
} }
@ -790,7 +791,7 @@ ul.panel-actions>li:first-child {
color: #fff color: #fff
} }
.panel-danger .panel-footer+.panel-collapse>.panel-body { .panel-danger .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #f85974 border-bottom-color: #f85974
} }
@ -800,7 +801,7 @@ ul.panel-actions>li:first-child {
border: none border: none
} }
.panel-dark .panel-heading+.panel-collapse>.panel-body { .panel-dark .panel-heading + .panel-collapse > .panel-body {
border-top-color: #526069 border-top-color: #526069
} }
@ -817,7 +818,7 @@ ul.panel-actions>li:first-child {
color: #fff color: #fff
} }
.panel-dark .panel-footer+.panel-collapse>.panel-body { .panel-dark .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #526069 border-bottom-color: #526069
} }
@ -935,7 +936,7 @@ ul.panel-actions>li:first-child {
@media (max-width: 767px) { @media (max-width: 767px) {
.panel-actions { .panel-actions {
position:relative; position: relative;
top: auto; top: auto;
right: auto; right: auto;
display: block; display: block;
@ -952,16 +953,16 @@ ul.panel-actions>li:first-child {
top: 50%; top: 50%;
right: 30px; right: 30px;
padding: 0; padding: 0;
-webkit-transform: translate(0,-50%); -webkit-transform: translate(0, -50%);
-ms-transform: translate(0,-50%); -ms-transform: translate(0, -50%);
-o-transform: translate(0,-50%); -o-transform: translate(0, -50%);
transform: translate(0,-50%) transform: translate(0, -50%)
} }
} }
@media (max-width: 479px) { @media (max-width: 479px) {
.panel-actions { .panel-actions {
padding-left:20px padding-left: 20px
} }
.panel-actions-keep { .panel-actions-keep {
@ -976,7 +977,7 @@ ul.panel-actions>li:first-child {
display: none display: none
} }
.panel-body,.panel-footer,.panel-title { .panel-body, .panel-footer, .panel-title {
padding-left: 20px; padding-left: 20px;
padding-right: 20px padding-right: 20px
} }
@ -993,7 +994,7 @@ ul.panel-actions>li:first-child {
box-shadow: none box-shadow: none
} }
.panel-group .panel+.panel { .panel-group .panel + .panel {
margin-top: 10px margin-top: 10px
} }
@ -1003,7 +1004,7 @@ ul.panel-actions>li:first-child {
font-size: 1rem font-size: 1rem
} }
.panel-group .panel-title:after,.panel-group .panel-title:before { .panel-group .panel-title:after, .panel-group .panel-title:before {
position: absolute; position: absolute;
top: 15px; top: 15px;
right: 30px; right: 30px;
@ -1045,7 +1046,7 @@ ul.panel-actions>li:first-child {
opacity: 1 opacity: 1
} }
.panel-group .panel-title:focus,.panel-group .panel-title:hover { .panel-group .panel-title:focus, .panel-group .panel-title:hover {
color: #76838f; color: #76838f;
text-decoration: none text-decoration: none
} }
@ -1058,11 +1059,11 @@ ul.panel-actions>li:first-child {
border-bottom: 0 border-bottom: 0
} }
.panel-group .panel-heading+.panel-collapse { .panel-group .panel-heading + .panel-collapse {
margin: 0 margin: 0
} }
.panel-group .panel-heading+.panel-collapse>.list-group { .panel-group .panel-heading + .panel-collapse > .list-group {
border-top: 1px solid #e4eaec border-top: 1px solid #e4eaec
} }
@ -1074,7 +1075,7 @@ ul.panel-actions>li:first-child {
border-top: 0 border-top: 0
} }
.panel-group .panel-footer+.panel-collapse .panel-body { .panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #e4eaec border-bottom: 1px solid #e4eaec
} }
@ -1090,7 +1091,7 @@ ul.panel-actions>li:first-child {
border-radius: 0 0 .286rem .286rem border-radius: 0 0 .286rem .286rem
} }
.panel-group-continuous .panel+.panel { .panel-group-continuous .panel + .panel {
margin-top: 0; margin-top: 0;
border-top: 1px solid #e4eaec border-top: 1px solid #e4eaec
} }
@ -1104,7 +1105,7 @@ ul.panel-actions>li:first-child {
padding-bottom: 10px padding-bottom: 10px
} }
.panel-group-simple .panel-title:after,.panel-group-simple .panel-title:before { .panel-group-simple .panel-title:after, .panel-group-simple .panel-title:before {
right: 5px right: 5px
} }
@ -1114,21 +1115,30 @@ ul.panel-actions>li:first-child {
padding-top: 10px padding-top: 10px
} }
.panel-group-simple .panel+.panel { .panel-group-simple .panel + .panel {
margin-top: 0 margin-top: 0
} }
/*自定义样式*/ /*自定义样式*/
html, body{height: 100%;} html, body {
.app-sub-nav .nav-tabs{border-bottom:none;} height: 100%;
.btn-cursor-pointer{cursor:pointer;} }
.app-sub-nav .nav-tabs {
border-bottom: none;
}
.btn-cursor-pointer {
cursor: pointer;
}
/*把脑残替换的恢复过来*/ /*把脑残替换的恢复过来*/
.form-inline .form-group { .form-inline .form-group {
margin-right: 20px; margin-right: 20px;
} }
@media (min-width: 480px){
@media (min-width: 480px) {
.form-inline .form-group, .form-inline .form-control { .form-inline .form-group, .form-inline .form-control {
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
@ -1136,28 +1146,34 @@ html, body{height: 100%;}
vertical-align: middle; vertical-align: middle;
} }
} }
/*在帮脑残修复一下*/ /*在帮脑残修复一下*/
table .form-inline .form-group { table .form-inline .form-group {
margin-right: 0px; margin-right: 0px;
} }
@media (min-width: 480px){
@media (min-width: 480px) {
table .form-inline .form-group, table .form-inline .form-control { table .form-inline .form-group, table .form-inline .form-control {
display: block; display: block;
width: 100%; width: 100%;
} }
} }
.modal-open .select2-container{
z-index:auto!important; .modal-open .select2-container {
z-index: auto !important;
} }
/*CSS*/ /*CSS*/
@media (min-width: 767px){ @media (min-width: 767px) {
.metadmin-fmbx dl .city-css .form-control{ .metadmin-fmbx dl .city-css .form-control {
width: auto; width: auto;
} }
.metadmin-fmbx dl .city-css .form-control{
.metadmin-fmbx dl .city-css .form-control {
width: auto; width: auto;
} }
.appmain #showmap{
.appmain #showmap {
width: 60%; width: 60%;
} }
} }
@ -1169,31 +1185,32 @@ table .form-inline .form-group {
height: 60px; height: 60px;
margin-left: -15px; margin-left: -15px;
width: 100%; width: 100%;
margin-bottom:0; margin-bottom: 0;
} }
.line_through{ .line_through {
text-decoration: line-through; text-decoration: line-through;
} }
.float-left { .float-left {
float: left!important float: left !important
} }
.float-right { .float-right {
float: right!important float: right !important
} }
.float-none { .float-none {
float: none!important float: none !important
} }
/*统计总页面*/ /*统计总页面*/
.page-profile .card-shadow { .page-profile .card-shadow {
-webkit-box-shadow:none; -webkit-box-shadow: none;
box-shadow:none; box-shadow: none;
} }
.page-profile .card-footer { .page-profile .card-footer {
padding: 0px; padding: 0px;
border-radius: .215rem; border-radius: .215rem;
@ -1201,7 +1218,7 @@ table .form-inline .form-group {
border-top: none; border-top: none;
} }
.page-profile .card-footer>div>div{ .page-profile .card-footer > div > div {
padding: 10px 0px; padding: 10px 0px;
} }
@ -1218,47 +1235,63 @@ table .form-inline .form-group {
} }
/*表格头部排序样式*/ /*表格头部排序样式*/
.orderby-arrow.desc:before{ content: '\2193'; font-weight: bold; margin-left: 5px;} .orderby-arrow.desc:before {
.orderby-arrow.asc:before{ content: '\2191'; font-weight: bold; margin-left: 5px;} content: '\2193';
font-weight: bold;
margin-left: 5px;
}
.metadmin-main table td .loader-ellipsis{ .orderby-arrow.asc:before {
content: '\2191';
font-weight: bold;
margin-left: 5px;
}
.metadmin-main table td .loader-ellipsis {
width: 0.45em; width: 0.45em;
height: 0.45em; height: 0.45em;
font-size: 15px; font-size: 15px;
} }
.h-700{ .h-700 {
height: 700px; height: 700px;
} }
li.village-list-item > button.close{ li.village-list-item > button.close {
position: static!important; position: static !important;
font-size: 1.2rem; font-size: 1.2rem;
outline: none; outline: none;
} }
.filterList li.village-list-item > button.close{
.filterList li.village-list-item > button.close {
margin-top: 10px; margin-top: 10px;
} }
li.village-list-item > button.close:hover{
li.village-list-item > button.close:hover {
color: #f2353c; color: #f2353c;
} }
li.village-list-item>h5{
font-weight: 600!important; li.village-list-item > h5 {
display: inline-block!important; font-weight: 600 !important;
display: inline-block !important;
margin-bottom: .5rem; margin-bottom: .5rem;
} }
li.village-list-item>p{
margin-bottom: 0!important; li.village-list-item > p {
margin-bottom: 0 !important;
} }
.villageList li.village-list-item>h5{
cursor:pointer .villageList li.village-list-item > h5 {
cursor: pointer
} }
.btn-group-toggle-menu{
left: -49px!important; .btn-group-toggle-menu {
left: -49px !important;
padding: 5px; padding: 5px;
min-width: 120px; min-width: 120px;
} }
.btn-group-toggle-menu a, .btn-group-toggle-menu button{
.btn-group-toggle-menu a, .btn-group-toggle-menu button {
display: inherit; display: inherit;
border-radius:0; border-radius: 0;
} }

View File

@ -47,7 +47,8 @@ $met_title = $data['met_title'];
required data-fv-notEmpty-message="不能为空"></select> required data-fv-notEmpty-message="不能为空"></select>
</div> </div>
<div class="form-group clearfix"> <div class="form-group clearfix">
<input type="text" name="c_address" value="{$data.data.c_address}" placeholder="请输入详细地址" class="form-control" <input type="text" name="c_address" value="{$data.data.c_address}" placeholder="请输入详细地址"
class="form-control"
required data-fv-notEmpty-message="不能为空"> required data-fv-notEmpty-message="不能为空">
</div> </div>
</dd> </dd>
@ -64,14 +65,16 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>联系电话</label></dt> <dt><label class='form-control-label'>联系电话</label></dt>
<dd> <dd>
<input type="text" name="c_tel" value="{$data.data.c_tel}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="c_tel" value="{$data.data.c_tel}" data-plugin='tokenfield'
data-delimiter=','/>
<span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span> <span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="c_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.c_text}</textarea> <textarea name="c_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.c_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -3,9 +3,9 @@ defined('IN_MET') or exit('No permission');
$met_title = $data['met_title']; $met_title = $data['met_title'];
?> ?>
<include file='sys_admin/head_v2'/> <include file='sys_admin/head_v2'/>
<!--二级导航--> <!--二级导航-->
{$data.nav_sub} {$data.nav_sub}
<div class="page-profile"> <div class="page-profile">
<div class="card card-shadow text-xs-center"> <div class="card card-shadow text-xs-center">
<div class="card-footer"> <div class="card-footer">
<div class="row no-space"> <div class="row no-space">
@ -22,28 +22,32 @@ $met_title = $data['met_title'];
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="今天空闲的广告位总数,包含禁用的广告位">广告位空闲数 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="今天空闲的广告位总数,包含禁用的广告位">广告位空闲数 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.vlease}</strong> <strong class="profile-stat-count">{$data.num.vlease}</strong>
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="今天正在排期中的广告位">广告位排期中 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="今天正在排期中的广告位">广告位排期中 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.vendday}</strong> <strong class="profile-stat-count">{$data.num.vendday}</strong>
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="7天内即将到期的广告位总数">7天内到期 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="7天内即将到期的广告位总数">7天内到期 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.vprerow}</strong> <strong class="profile-stat-count">{$data.num.vprerow}</strong>
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="投放开始时间大于今天的广告位">广告位预排数 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="投放开始时间大于今天的广告位">广告位预排数 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.contract}</strong> <strong class="profile-stat-count">{$data.num.contract}</strong>
@ -76,9 +80,9 @@ $met_title = $data['met_title'];
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row dzadsod_list"> <div class="row dzadsod_list">
<!-- <!--
<div class="col-md-4 col-lg-4 col-4"> <div class="col-md-4 col-lg-4 col-4">
<div class="panel panel-info "> <div class="panel panel-info ">
<div class="panel-heading"> <div class="panel-heading">
@ -94,7 +98,7 @@ $met_title = $data['met_title'];
</div> </div>
</div> </div>
</div> </div>
--> -->
<div class="col-md-12 col-lg-12 col-12"> <div class="col-md-12 col-lg-12 col-12">
<div class="panel panel-info panel-line "> <div class="panel panel-info panel-line ">
<div class="panel-heading"> <div class="panel-heading">
@ -102,12 +106,15 @@ $met_title = $data['met_title'];
<small>包含根据设置的到期提醒天数内的订单以及订单投放结束到期的订单符合条件的数据展示3天</small> <small>包含根据设置的到期提醒天数内的订单以及订单投放结束到期的订单符合条件的数据展示3天</small>
</h3> </h3>
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist" data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable"> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist"
data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable">
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody> <tbody>
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -115,5 +122,5 @@ $met_title = $data['met_title'];
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<include file='sys_admin/foot_v2'/> <include file='sys_admin/foot_v2'/>

View File

@ -69,8 +69,9 @@ $met_title = $data['met_title'];
<dt><label class='form-control-label'>是否启用</label></dt> <dt><label class='form-control-label'>是否启用</label></dt>
<dd class="form-group"> <dd class="form-group">
<div class="radio-custom radio-primary radio-inline"> <div class="radio-custom radio-primary radio-inline">
<input type="radio" id="e_enable0" name="e_enable" value='0' data-checked='{$data.data.e_enable}' <input type="radio" id="e_enable0" name="e_enable" value='0'
required data-fv-notEmpty-message='不能为空' /> data-checked='{$data.data.e_enable}'
required data-fv-notEmpty-message='不能为空'/>
<label for="e_enable0">禁用</label> <label for="e_enable0">禁用</label>
</div> </div>
<div class="radio-custom radio-primary radio-inline"> <div class="radio-custom radio-primary radio-inline">
@ -82,14 +83,16 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>自主标签</label></dt> <dt><label class='form-control-label'>自主标签</label></dt>
<dd> <dd>
<input type="text" name="e_label" placeholder="输入标签" value="{$data.data.e_label}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="e_label" placeholder="输入标签" value="{$data.data.e_label}"
data-plugin='tokenfield' data-delimiter=','/>
<span class="text-help m-l-10">自定义广告位相关标签,可设置多个</span> <span class="text-help m-l-10">自定义广告位相关标签,可设置多个</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="e_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.e_text}</textarea> <textarea name="e_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.e_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -5,7 +5,7 @@ $met_title = $data['app']['appname'];
?> ?>
<include file='sys_admin/head_v2'/> <include file='sys_admin/head_v2'/>
<link href="{$_M['url']['own_tem']}css/appcheck.min.css" rel='stylesheet' type='text/css'> <link href="{$_M['url']['own_tem']}css/appcheck.min.css" rel='stylesheet' type='text/css'>
<div class="appcheck" data-ckitem="{$data.ckitem}" > <div class="appcheck" data-ckitem="{$data.ckitem}">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-4 offset-md-4"> <div class="col-xs-12 col-md-4 offset-md-4">
@ -14,7 +14,8 @@ $met_title = $data['app']['appname'];
<div class="topimg"> <div class="topimg">
<div class="topimg-image"> <div class="topimg-image">
<div class="avatar"> <div class="avatar">
<img class="img-circle img-bordered img-bordered-info" src="{$data.app.icon}" alt="image"> <img class="img-circle img-bordered img-bordered-info" src="{$data.app.icon}"
alt="image">
</div> </div>
</div> </div>
<div class="topimg-body p-10 p-l-5"> <div class="topimg-body p-10 p-l-5">
@ -33,7 +34,8 @@ $met_title = $data['app']['appname'];
</div> </div>
</div> </div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="appmodal" aria-hidden="true" data-keyboard="false" data-backdrop="false" role="dialog" tabindex="-1"> <div class="modal fade" id="appmodal" aria-hidden="true" data-keyboard="false" data-backdrop="false" role="dialog"
tabindex="-1">
<div class="modal-dialog modal-center"> <div class="modal-dialog modal-center">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">

View File

@ -1,15 +1,13 @@
//应用JS后期语法框架 //应用JS后期语法框架
(function($){ (function ($) {
//内部初始化入口 //内部初始化入口
var appmap = function(){ var appmap = function () {
}; };
//扩展方法 //扩展方法
appmap.prototype = { appmap.prototype = {};
};
//外部入口 //外部入口
$.fn.maps = function () { $.fn.maps = function () {

View File

@ -1,79 +1,79 @@
//应用JS后期语法框架 //应用JS后期语法框架
(function($){ (function ($) {
//内部初始化入口 //内部初始化入口
var applan = function(){ var applan = function () {
var $self = this, var $self = this,
strArr = $self.aparr(); strArr = $self.aparr();
//计算选中广告位个数 //计算选中广告位个数
$self.addnum(strArr); $self.addnum(strArr);
//提交处理 //提交处理
$(document).on('submit', '.add_ap_list form', function(event) { $(document).on('submit', '.add_ap_list form', function (event) {
event.preventDefault(); //阻止默认提交 event.preventDefault(); //阻止默认提交
}) })
//修改form提交方式 //修改form提交方式
$(document).on('click', '.add_ap_list form button[type="submit"]', function(event) { $(document).on('click', '.add_ap_list form button[type="submit"]', function (event) {
event.preventDefault(); //阻止默认提交 event.preventDefault(); //阻止默认提交
var $form = $(this).parents('form'); var $form = $(this).parents('form');
//手动触发全部验证 //手动触发全部验证
// $form.data('formValidation').resetForm(); // $form.data('formValidation').resetForm();
$form.data('formValidation').validate({debug:true}); $form.data('formValidation').validate({debug: true});
//查看验证结果,若为false 则阻止 //查看验证结果,若为false 则阻止
var flag = $form.data("formValidation").isValid(); var flag = $form.data("formValidation").isValid();
//验证时间是否合法 //验证时间是否合法
if(flag != false){ if (flag != false) {
//执行入库操作返回ID //执行入库操作返回ID
$self.laaajx($form.attr('action'),$self.formdata($form)); $self.laaajx($form.attr('action'), $self.formdata($form));
} }
//修改表格按钮禁止操作 //修改表格按钮禁止操作
// $(this).attr("disabled",true); // $(this).attr("disabled",true);
}); });
//解决被禁用前选中的,点击取消后则不能再勾选 //解决被禁用前选中的,点击取消后则不能再勾选
$('table tbody').on('click', '.ap-one-disabled', function(event) { $('table tbody').on('click', '.ap-one-disabled', function (event) {
$(this).removeClass('ap-one-disabled'); $(this).removeClass('ap-one-disabled');
$(this).find('input').attr("disabled",true); $(this).find('input').attr("disabled", true);
}) })
// $(document).on('change',"[data-table-search]",function(){ // $(document).on('change',"[data-table-search]",function(){
// return false; // return false;
// }) // })
//全选 //全选
$(document).on('click','.ap-all input',function(){ $(document).on('click', '.ap-all input', function () {
var idArr = []; var idArr = [];
//选中值 //选中值
var table = $(this).parents('table').find('tbody'); var table = $(this).parents('table').find('tbody');
table.find('.ap-one').each(function(index,element){ table.find('.ap-one').each(function (index, element) {
var oneid = $(this).find('input[name="id"]').val(), var oneid = $(this).find('input[name="id"]').val(),
disabled = $(this).find('input[name="id"]').prop('disabled'); disabled = $(this).find('input[name="id"]').prop('disabled');
if(APPFUN.isEmpty(disabled)) idArr.push(oneid); if (APPFUN.isEmpty(disabled)) idArr.push(oneid);
}) })
this.checked === true?$self.addap(idArr):$self.apdelall(idArr); this.checked === true ? $self.addap(idArr) : $self.apdelall(idArr);
}); });
//必须定位到 table tbody on方法才生效 //必须定位到 table tbody on方法才生效
$('table tbody').on('click','.ap-one input',function(){ $('table tbody').on('click', '.ap-one input', function () {
var idStr = $(this).val(); var idStr = $(this).val();
this.checked === true?$self.addap(idStr):$self.delap(idStr); this.checked === true ? $self.addap(idStr) : $self.delap(idStr);
}); });
}; };
//扩展方法 //扩展方法
applan.prototype = { applan.prototype = {
addnum:function(strArr){ addnum : function (strArr) {
var $self = this; var $self = this;
strArr = $.unique(strArr); strArr = $.unique(strArr);
$('.addnum').text(strArr.length); $('.addnum').text(strArr.length);
}, },
apdelall:function(idArr){ apdelall : function (idArr) {
var $self = this; var $self = this;
$.each(idArr,function(i,idStr){ $.each(idArr, function (i, idStr) {
$self.delap(idStr); $self.delap(idStr);
}) })
}, },
addap:function(idStrArr){ addap : function (idStrArr) {
//新增选中值 //新增选中值
var $self = this, var $self = this,
strArr = $self.aparr(); strArr = $self.aparr();
@ -82,61 +82,61 @@
//排序 //排序
strArr.sort(); strArr.sort();
//去重 //去重
strArr =$.unique(strArr); strArr = $.unique(strArr);
$self.apinput(strArr.join(","),true); $self.apinput(strArr.join(","), true);
//选中个数 //选中个数
$self.addnum(strArr); $self.addnum(strArr);
}, },
delap:function(idStr){ delap : function (idStr) {
//删除选中值 //删除选中值
var $self = this, var $self = this,
strArr = $self.aparr(), strArr = $self.aparr(),
strlen = $.inArray(idStr, strArr); strlen = $.inArray(idStr, strArr);
//删除选中值 //删除选中值
if(strlen != '-1') strArr.splice(strlen, 1); if (strlen != '-1') strArr.splice(strlen, 1);
//排序 //排序
strArr.sort(); strArr.sort();
//重新写会 //重新写会
$self.apinput(strArr.join(","),true); $self.apinput(strArr.join(","), true);
//选中个数 //选中个数
$self.addnum(strArr); $self.addnum(strArr);
}, },
apinput:function(str,type){ apinput : function (str, type) {
//获取或者写入 //获取或者写入
//true 为写入 false为获取 //true 为写入 false为获取
var input = $('input[name="l_selectenum"]'); var input = $('input[name="l_selectenum"]');
return APPFUN.isEmpty(type)?input.val():input.val(str); return APPFUN.isEmpty(type) ? input.val() : input.val(str);
}, },
aparr:function(){ aparr : function () {
//选中广告位编号 //选中广告位编号
var $self = this, var $self = this,
str = $self.apinput(); str = $self.apinput();
return !APPFUN.isEmpty(str)?str.split(","):[]; return !APPFUN.isEmpty(str) ? str.split(",") : [];
}, },
formdata:function(form){ formdata : function (form) {
var Array = form.serializeArray(), var Array = form.serializeArray(),
dataOjb = {}; dataOjb = {};
//转成一对一 //转成一对一
$.each(Array,function(key,val){ $.each(Array, function (key, val) {
dataOjb[val.name] = val.value; dataOjb[val.name] = val.value;
}); });
return dataOjb; return dataOjb;
}, },
laaajx:function(url,data){ laaajx : function (url, data) {
var $self = this, var $self = this,
scrollable_this = $('[data-plugin="scrollable"]'); scrollable_this = $('[data-plugin="scrollable"]');
//点击保存后,先处理保存,再执行点位 //点击保存后,先处理保存,再执行点位
$.post(url,data,function(json){ $.post(url, data, function (json) {
if(json.code){ if (json.code) {
// // 执行成功,则自动跳转到下一步 // // 执行成功,则自动跳转到下一步
window.location.replace(window.location.href + '&slid='+json.slid+'&nextstep=1'); window.location.replace(window.location.href + '&slid=' + json.slid + '&nextstep=1');
}else{ } else {
$self.addappend(scrollable_this,json.text,0); $self.addappend(scrollable_this, json.text, 0);
$self.alerthtml(false,json.text); $self.alerthtml(false, json.text);
} }
},'json'); }, 'json');
}, },
nextstep:function(){ nextstep : function () {
var $self = this, var $self = this,
scrollable_this = $('[data-plugin="scrollable"]'), scrollable_this = $('[data-plugin="scrollable"]'),
//获取广告位数组 //获取广告位数组
@ -150,79 +150,79 @@
$self.scrollable(scrollable_this); //先重新初始化显示 $self.scrollable(scrollable_this); //先重新初始化显示
//去重 //去重
strArr =$.unique(strArr); strArr = $.unique(strArr);
$.each(strArr,function(i,idStr){ $.each(strArr, function (i, idStr) {
data['ap_enumber'] = idStr; data['ap_enumber'] = idStr;
$.post(url,data,function(json){ $.post(url, data, function (json) {
// 将操作结果反馈给页面 // 将操作结果反馈给页面
$self.addappend(scrollable_this,json.text,json.code?1:2); $self.addappend(scrollable_this, json.text, json.code ? 1 : 2);
var inputid = $('input[value="'+json.eid+'"]').parent('.ap-one'); var inputid = $('input[value="' + json.eid + '"]').parent('.ap-one');
if(json.code){ if (json.code) {
truei++; truei++;
inputid.removeClass('checkbox-danger').addClass('checkbox-success'); inputid.removeClass('checkbox-danger').addClass('checkbox-success');
}else{ } else {
falsei++; falsei++;
inputid.removeClass('checkbox-success').addClass('checkbox-danger'); inputid.removeClass('checkbox-success').addClass('checkbox-danger');
} }
//输出最终结果 //输出最终结果
if(strArr.length == truei*1 + falsei*1){ if (strArr.length == truei * 1 + falsei * 1) {
//再执行将最终的结果保存到对应的投放ID内 //再执行将最终的结果保存到对应的投放ID内
var urls = M.url.own_name + 'c=ajax&a=dolenumber&lang=' + M.lang; var urls = M.url.own_name + 'c=ajax&a=dolenumber&lang=' + M.lang;
// 将缓存表内保存的排期成功数据保存到表内 // 将缓存表内保存的排期成功数据保存到表内
$.post(urls,data,function(dajson){ $.post(urls, data, function (dajson) {
var text = '本次广告投放计划共涉及('+strArr.length+')个广告位,排期成功的('+truei+')个广告位,排期失败的('+falsei+')个广告位。', var text = '本次广告投放计划共涉及(' + strArr.length + ')个广告位,排期成功的(' + truei + ')个广告位,排期失败的(' + falsei + ')个广告位。',
falseicode = falsei == 0?true:false; falseicode = falsei == 0 ? true : false;
if(dajson.code == false){ if (dajson.code == false) {
falseicode = false; falseicode = false;
text += dajson.text; text += dajson.text;
} }
//同步给排期成功的字段 //同步给排期成功的字段
if(dajson.code) $('input[name="l_enumber"]').val(dajson.idstr); if (dajson.code) $('input[name="l_enumber"]').val(dajson.idstr);
//信息反馈页面 //信息反馈页面
$self.addappend(scrollable_this,dajson.text,dajson.code?0:2); $self.addappend(scrollable_this, dajson.text, dajson.code ? 0 : 2);
$self.addappend(scrollable_this,text,0); $self.addappend(scrollable_this, text, 0);
$self.alerthtml(falseicode,text); $self.alerthtml(falseicode, text);
scrollable_this.asScrollable('scrollTo','vertical','100%'); scrollable_this.asScrollable('scrollTo', 'vertical', '100%');
},'json'); }, 'json');
} }
},'json'); }, 'json');
}); });
}, },
alerthtml:function(bool,text){ alerthtml : function (bool, text) {
var color = bool?'alert-success':'alert-danger', var color = bool ? 'alert-success' : 'alert-danger',
url = M.url.own_name + 'c=table_on&a=dolaunch', url = M.url.own_name + 'c=table_on&a=dolaunch',
alert = '<div class="launch_affix_save alert dark alert-icon alert-dismissible text-xs-center ' + color + '" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><span><i class="icon wb-bell p-r-10" aria-hidden="true"></i>'+text+'</span><button class="btn btn-sm btn-danger btn-inverse btn-outline launchlist" type="button">返回列表</button></div>'; alert = '<div class="launch_affix_save alert dark alert-icon alert-dismissible text-xs-center ' + color + '" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><span><i class="icon wb-bell p-r-10" aria-hidden="true"></i>' + text + '</span><button class="btn btn-sm btn-danger btn-inverse btn-outline launchlist" type="button">返回列表</button></div>';
$('.launch_affix_save').remove(); $('.launch_affix_save').remove();
$('form').append(alert); $('form').append(alert);
$(document).on('click','.launchlist',function(e){ $(document).on('click', '.launchlist', function (e) {
window.location.replace(url); window.location.replace(url);
}) })
}, },
addappend:function(_this_,text,code){ addappend : function (_this_, text, code) {
var color = ['blue-600','green-600','red-600'], var color = ['blue-600', 'green-600', 'red-600'],
icon = ['wb-bell','wb-check','wb-close'], icon = ['wb-bell', 'wb-check', 'wb-close'],
litext = '<li class="' + color[code] + '"><i class="' + icon[code] + '" aria-hidden="true"></i>' + text + '</li>'; litext = '<li class="' + color[code] + '"><i class="' + icon[code] + '" aria-hidden="true"></i>' + text + '</li>';
$('.launchshow').append(litext); $('.launchshow').append(litext);
_this_.asScrollable('scrollTo','vertical','100%'); _this_.asScrollable('scrollTo', 'vertical', '100%');
}, },
scrollable:function(_this_){ scrollable : function (_this_) {
M['plugin']['asscrollable']=[ M['plugin']['asscrollable'] = [
// M['url']['static2_vendor']+'asscrollable/asScrollable.min.css', // M['url']['static2_vendor']+'asscrollable/asScrollable.min.css',
M['url']['static2_vendor']+'asscrollbar/jquery-asScrollbar.min.js', M['url']['static2_vendor'] + 'asscrollbar/jquery-asScrollbar.min.js',
M['url']['static2_vendor']+'asscrollable/jquery-asScrollable.min.js', M['url']['static2_vendor'] + 'asscrollable/jquery-asScrollable.min.js',
]; ];
$.include(M['plugin']['asscrollable'], function () { $.include(M['plugin']['asscrollable'], function () {
_this_.asScrollable('destroy'); _this_.asScrollable('destroy');
_this_.asScrollable({ _this_.asScrollable({
namespace: "scrollable", namespace : "scrollable",
contentSelector: "> [data-role='content']", contentSelector : "> [data-role='content']",
containerSelector: "> [data-role='container']" containerSelector: "> [data-role='container']"
}); });
}); });
}, },
scrollToEnd:function(){ scrollToEnd: function () {
//滚动到底部 //滚动到底部
var h = $(document).height()-$(window).height(); var h = $(document).height() - $(window).height();
$(document).scrollTop(h); $(document).scrollTop(h);
} }
}; };
@ -230,8 +230,8 @@
//外部入口 //外部入口
$.fn.aplist = function () { $.fn.aplist = function () {
var naplan = new applan(); var naplan = new applan();
if( !APPFUN.isEmpty($('input[name="nextstep"]').val()) ) { if (!APPFUN.isEmpty($('input[name="nextstep"]').val())) {
$('#tables-list').on( 'draw.dt', function ( e,settings ) { $('#tables-list').on('draw.dt', function (e, settings) {
naplan.scrollToEnd(); naplan.scrollToEnd();
}) })
naplan.nextstep(); naplan.nextstep();

View File

@ -1,18 +0,0 @@
//用来阻止广告位重复添加的
(function($){
//内部初始化入口
var appmap = function(){
};
//扩展方法
appmap.prototype = {
};
//外部入口
$.fn.maps = function () {
};
})(jQuery);

View File

@ -36,7 +36,7 @@
*/ */
$(function () { $(function () {
var myDate = new Date().getTime() var myDate = new Date().getTime()
$.include(M.url.own_tem + 'js/appcheck.min.js?'+myDate); $.include(M.url.own_tem + 'js/appcheck.min.js?' + myDate);
$.ajax({ $.ajax({
type : "GET", type : "GET",
@ -61,12 +61,12 @@ $(function () {
}) })
// 表格数据加载状态 // 表格数据加载状态
$('#tableslist').on('processing.dt', function (e, settings, processing) { $('#tableslist').on('processing.dt', function (e, settings, processing) {
if(processing) { if (processing) {
$self.tableProcessing(this) $self.tableProcessing(this)
} }
}) })
$('#tables-list').on('processing.dt', function (e, settings, processing) { $('#tables-list').on('processing.dt', function (e, settings, processing) {
if(processing) { if (processing) {
$self.tableProcessing(this) $self.tableProcessing(this)
} }
}) })
@ -211,7 +211,7 @@ $(function () {
}); });
}); });
}, },
datepicker: function () { datepicker : function () {
var $self = this; var $self = this;
M['plugin']['datetimepicker'] = [ M['plugin']['datetimepicker'] = [
M['url']['epl'] + 'time/jquery.datetimepicker.css', M['url']['epl'] + 'time/jquery.datetimepicker.css',
@ -319,11 +319,11 @@ $(function () {
$form.find('[name="all_id"]').val(all_id); $form.find('[name="all_id"]').val(all_id);
} }
}, },
tableProcessing:function (_this_){ tableProcessing: function (_this_) {
// 表格数据加载状态 // 表格数据加载状态
var tbody = $(_this_).find('tbody') var tbody = $(_this_).find('tbody')
var colspan = tbody.data('colspan') var colspan = tbody.data('colspan')
var html= `<tr> var html = `<tr>
<td colspan="${colspan}"> <td colspan="${colspan}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div>
</td> </td>

View File

@ -44,7 +44,7 @@ $met_title = $data['met_title'];
<dd class="form-group"> <dd class="form-group">
<div class="radio-custom radio-primary radio-inline"> <div class="radio-custom radio-primary radio-inline">
<input type="radio" id="k_state0" name="k_state" value='0' data-checked='{$data.data.k_state}' <input type="radio" id="k_state0" name="k_state" value='0' data-checked='{$data.data.k_state}'
required data-fv-notEmpty-message='不能为空' /> required data-fv-notEmpty-message='不能为空'/>
<label for="k_state0">禁用</label> <label for="k_state0">禁用</label>
</div> </div>
<div class="radio-custom radio-primary radio-inline"> <div class="radio-custom radio-primary radio-inline">
@ -56,7 +56,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="k_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.k_text}</textarea> <textarea name="k_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.k_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -4,11 +4,12 @@ $met_title = $data['met_title'];
?> ?>
<include file='sys_admin/head_v2'/> <include file='sys_admin/head_v2'/>
<div class="add_ap_list"> <div class="add_ap_list">
<form method="POST" action="{$data.url.action}" enctype="multipart/form-data"> <form method="POST" action="{$data.url.action}" enctype="multipart/form-data">
<!--二级导航--> <!--二级导航-->
{$data.nav_sub} {$data.nav_sub}
<div class="metadmin-fmbx"> <div class="metadmin-fmbx">
<h3 class='example-title'>订单信息:<span class="text-help">{$data.data.h_cid}{$data.data.l_hnumber}</span></h3> <h3 class='example-title'>订单信息:<span class="text-help">{$data.data.h_cid}{$data.data.l_hnumber}</span>
</h3>
<dl class="col-md-6 col-lg-6 col-6"> <dl class="col-md-6 col-lg-6 col-6">
<dt><label class='form-control-label'>投放计划名称</label></dt> <dt><label class='form-control-label'>投放计划名称</label></dt>
<dd class="form-group"> <dd class="form-group">
@ -65,7 +66,8 @@ $met_title = $data['met_title'];
<dl class="col-md-4 col-lg-4 col-4"> <dl class="col-md-4 col-lg-4 col-4">
<dt><label class='form-control-label'>投放计划备注</label></dt> <dt><label class='form-control-label'>投放计划备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="l_text" rows="3" placeholder='备注描述' class='form-control m-r-10'>{$data.data.l_text}</textarea> <textarea name="l_text" rows="3" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.l_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>
@ -86,12 +88,15 @@ $met_title = $data['met_title'];
<!--头部搜索--> <!--头部搜索-->
{$data.table.search} {$data.table.search}
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tables-list" data-table-ajaxurl="{$data.table.ajaxurl}" data-table-pagelength='15' data-plugin="selectable"> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tables-list"
data-table-ajaxurl="{$data.table.ajaxurl}" data-table-pagelength='15' data-plugin="selectable">
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody data-colspan="{$data.table.tdcol}"> <tbody data-colspan="{$data.table.tdcol}">
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -112,6 +117,6 @@ $met_title = $data['met_title'];
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<include file='sys_admin/foot_v2'/> <include file='sys_admin/foot_v2'/>

View File

@ -11,12 +11,15 @@ $met_title = $data['met_title'];
<!--头部搜索--> <!--头部搜索-->
{$data.table.search} {$data.table.search}
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist" data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable"> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist"
data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable">
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody data-colspan="{$data.table.tdcol}"> <tbody data-colspan="{$data.table.tdcol}">
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -34,7 +34,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>场所地址</label></dt> <dt><label class='form-control-label'>场所地址</label></dt>
<dd> <dd>
<div data-plugin="select-linkage" data-select-url="{$data.url.city}" class="city-css city-js form-group"> <div data-plugin="select-linkage" data-select-url="{$data.url.city}"
class="city-css city-js form-group">
<select name="v_province" class="form-control m-r-5 prov" data-checked="{$data.data.v_province}" <select name="v_province" class="form-control m-r-5 prov" data-checked="{$data.data.v_province}"
required data-fv-notEmpty-message="不能为空"></select> required data-fv-notEmpty-message="不能为空"></select>
<select name="v_city" class="form-control m-r-5 city" data-checked="{$data.data.v_city}" <select name="v_city" class="form-control m-r-5 city" data-checked="{$data.data.v_city}"
@ -75,7 +76,8 @@ $met_title = $data['met_title'];
</dd> </dd>
</dl> </dl>
<!-- Modal 百度地图JS V3--> <!-- Modal 百度地图JS V3-->
<script type="text/javascript" src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak={$data.mapkey}"></script> <script type="text/javascript"
src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak={$data.mapkey}"></script>
<div class="modal fade" id="appmaps" aria-hidden="true" data-keyboard="false" role="dialog" tabindex="-1"> <div class="modal fade" id="appmaps" aria-hidden="true" data-keyboard="false" role="dialog" tabindex="-1">
<div class="modal-dialog modal-center modal-lg"> <div class="modal-dialog modal-center modal-lg">
<div class="modal-content"> <div class="modal-content">

View File

@ -27,14 +27,16 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>联系电话</label></dt> <dt><label class='form-control-label'>联系电话</label></dt>
<dd> <dd>
<input type="text" name="w_tel" value="{$data.data.w_tel}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="w_tel" value="{$data.data.w_tel}" data-plugin='tokenfield'
data-delimiter=','/>
<span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span> <span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="w_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.w_text}</textarea> <textarea name="w_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.w_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -3,29 +3,32 @@ defined('IN_MET') or exit ('No permission');
load::sys_func('file'); load::sys_func('file');
class uninstall { class uninstall
{
private $appno; //应用NO值 private $appno; //应用NO值
private $m_name; //应用文件夹 private $m_name; //应用文件夹
private $del_dirs = []; //需要删除的文件夹,以根目录为准 private $del_dirs = []; //需要删除的文件夹,以根目录为准
public function __construct() { public function __construct()
{
global $_M; global $_M;
$this->appno = $_M['form']['no']; //获取NO $this->appno = $_M['form']['no']; //获取NO
//需要删除的文件名 //需要删除的文件名
$this->del_dirs[] = self::firstsql(); $this->del_dirs[] = self::firstsql();
$this->del_dirs[] = $this->m_name?'app/app/'.$this->m_name:''; $this->del_dirs[] = $this->m_name ? 'app/app/' . $this->m_name : '';
//判断是否允许卸载 //判断是否允许卸载
if(file_exists(PATH_ALL_APP. $this->m_name."/config/uninstall.lock")){ if (file_exists(PATH_ALL_APP . $this->m_name . "/config/uninstall.lock")) {
turnover("{$_M['url']['own_form']}a=doindex","禁止卸载"); turnover("{$_M['url']['own_form']}a=doindex", "禁止卸载");
} }
} }
public function dodel() { public function dodel()
{
global $_M; global $_M;
//删除一些提前删除的内容 //删除一些提前删除的内容
@ -36,49 +39,52 @@ class uninstall {
self::appsql(); self::appsql();
//删除应用文件 //删除应用文件
// $this->delfile(); // $this->delfile();
} }
//优先执行代码[推荐] //优先执行代码[推荐]
private function firstsql() { private function firstsql()
{
global $_M; global $_M;
//查询应用的文件夹 //查询应用的文件夹
$mname = self::sqlone('applist'); $mname = self::sqlone('applist');
$this->m_name = $mname['m_name']; $this->m_name = $mname['m_name'];
//查询应用是否使用栏目 //查询应用是否使用栏目
$file = self::sqlone('column'," module='{$this->appno}' "); $file = self::sqlone('column', " module='{$this->appno}' ");
return $file['foldername']; return $file['foldername'];
} }
//删除自定义表 //删除自定义表
private function zdysql() { private function zdysql()
{
global $_M; global $_M;
//公用表 //公用表
$cloud = ['cloud_config']; $cloud = ['cloud_config'];
//自定义表 //自定义表
$table = file_get_contents(PATH_ALL_APP.$this->m_name.'/config/table'); $table = file_get_contents(PATH_ALL_APP . $this->m_name . '/config/table');
$table = stringto_array($table,','); $table = stringto_array($table, ',');
//自定义表删除 //自定义表删除
$zdy = array_diff($table,$cloud); $zdy = array_diff($table, $cloud);
$zdys = []; $zdys = [];
foreach ($zdy as $val){ foreach ($zdy as $val) {
$zdys[] = $this->m_name.'_'.$val; $zdys[] = $this->m_name . '_' . $val;
} }
//删除公用表对应应用数据,并查询是否符合删除表的要求 //删除公用表对应应用数据,并查询是否符合删除表的要求
foreach ($cloud as $val) { foreach ($cloud as $val) {
//判断是否要删除 //判断是否要删除
if(in_array($val, $table)) $zdys[] = self::cloud($val); if (in_array($val, $table)) $zdys[] = self::cloud($val);
} }
//删除表 //删除表
foreach ($zdys as $val){ foreach ($zdys as $val) {
self::deltablesql($val); self::deltablesql($val);
} }
//删除配置文件 //删除配置文件
del_table(arrayto_string($zdys,'|')); del_table(arrayto_string($zdys, '|'));
} }
//删除固定的app表 //删除固定的app表
private function appsql() { private function appsql()
{
global $_M; global $_M;
//删除栏目接口表 //删除栏目接口表
self::delsql('ifcolumn'); self::delsql('ifcolumn');
@ -94,75 +100,82 @@ class uninstall {
//删除网站后台栏目信息表 //删除网站后台栏目信息表
$where = "field='{$this->appno}'"; $where = "field='{$this->appno}'";
self::delsql('admin_column',$where); self::delsql('admin_column', $where);
//删除网站栏目信息表 //删除网站栏目信息表
$where = "module='{$this->appno}'"; $where = "module='{$this->appno}'";
self::delsql('column',$where); self::delsql('column', $where);
//删除语言表 //删除语言表
$where = "app='{$this->appno}'"; $where = "app='{$this->appno}'";
self::delsql('language',$where); self::delsql('language', $where);
//删除应用注册表 //删除应用注册表
self::delsql('applist'); self::delsql('applist');
} }
//删除应用文件夹 //删除应用文件夹
private function delfile() { private function delfile()
foreach ($this->del_dirs as $dir){ {
if(file_exists(PATH_WEB.$dir) && $dir != null) deldir(PATH_WEB.$dir); foreach ($this->del_dirs as $dir) {
if (file_exists(PATH_WEB . $dir) && $dir != null) deldir(PATH_WEB . $dir);
} }
} }
//对公用配置表卸载处理 //对公用配置表卸载处理
private function cloud($tname) { private function cloud($tname)
{
global $_M; global $_M;
$where = "m_name='{$this->m_name}'"; $where = "m_name='{$this->m_name}'";
if(self::sqlcounter($tname,$where) > 0){ if (self::sqlcounter($tname, $where) > 0) {
self::delsql($tname,$where); self::delsql($tname, $where);
} }
if(self::sqlcounter($tname) == 0){ if (self::sqlcounter($tname) == 0) {
return $tname; return $tname;
} }
} }
//公共查询方法 //公共查询方法
private function sqlone($tname,$where = '') { private function sqlone($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
if(!$where){ if (!$where) {
$where = "no='{$this->appno}'"; $where = "no='{$this->appno}'";
} }
return DB::get_one("select * from {$table} where {$where}"); return DB::get_one("select * from {$table} where {$where}");
} }
//公共查询方法 //公共查询方法
private function sqlcounter($tname,$where = '') { private function sqlcounter($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
if($where){ if ($where) {
$where = 'WHERE '.$where; $where = 'WHERE ' . $where;
} }
return DB::counter("{$table} {$where}"); return DB::counter("{$table} {$where}");
} }
//公共删除数据 //公共删除数据
private function delsql($tname,$where = '') { private function delsql($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
if(!$where){ if (!$where) {
$where = "no='{$this->appno}'"; $where = "no='{$this->appno}'";
} }
DB::query("DELETE FROM {$table} WHERE {$where}"); DB::query("DELETE FROM {$table} WHERE {$where}");
} }
//公共删除表 //公共删除表
private function deltablesql($tname) { private function deltablesql($tname)
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
DB::query("DROP TABLE `{$table}`"); DB::query("DROP TABLE `{$table}`");
} }
} }
?> ?>

View File

@ -7,7 +7,8 @@ load::own_func('appcmp');
load::own_class('../traits/appcmp'); load::own_class('../traits/appcmp');
//后台类 //后台类
class appadmin extends admin{ class appadmin extends admin
{
# URL上c的值 # URL上c的值
public $u_urlc; public $u_urlc;
@ -17,31 +18,33 @@ class appadmin extends admin{
public $u_para; public $u_para;
# 管理员权限 # 管理员权限
public $adop = ['met'=>false,'add'=>false,'del'=>false]; public $adop = ['met' => false, 'add' => false, 'del' => false];
// 调用类 // 调用类
public $tsql; public $tsql;
public $cloud; public $cloud;
# 初始化 # 初始化
public function __construct() { public function __construct()
global $_M,$_YW; {
global $_M, $_YW;
parent::__construct(); parent::__construct();
//调试使用 //调试使用
ini_set("display_errors", "On"); ini_set("display_errors", "On");
error_reporting(E_ERROR); error_reporting(E_ERROR);
$this->tsql = load::own_class('tsql','new'); $this->tsql = load::own_class('tsql', 'new');
self::cmp_load(); self::cmp_load();
self::adminop(); self::adminop();
$this->cloud = load::own_class('cloud','new'); $this->cloud = load::own_class('cloud', 'new');
} }
use appcmp; use appcmp;
//调试使用 //调试使用
public function bug() { public function bug()
{
$this->destruct = false; $this->destruct = false;
} }
@ -50,14 +53,15 @@ class appadmin extends admin{
* @$select string 最终菜单选项 * @$select string 最终菜单选项
* @$title string 当前页面标题 * @$title string 当前页面标题
*/ */
public function appnav($select = '',$title = '') { public function appnav($select = '', $title = '')
{
global $_M, $_YW; global $_M, $_YW;
if(is_array($select)) list($select,$title) = $select; if (is_array($select)) list($select, $title) = $select;
//当前的CA组合 //当前的CA组合
$select = empty($select)?$_M['form']['c'].'__'.$_M['form']['a']:$select; $select = empty($select) ? $_M['form']['c'] . '__' . $_M['form']['a'] : $select;
//导航公用参数 //导航公用参数
$glpara = [ $glpara = [
'navon'=> $_M['form']['navon'], 'navon' => $_M['form']['navon'],
]; ];
/* /*
@ -81,7 +85,7 @@ class appadmin extends admin{
'table_on__docontract' => ['订单管理'], 'table_on__docontract' => ['订单管理'],
'table_on__dolaunch' => ['投放计划'], 'table_on__dolaunch' => ['投放计划'],
// 'info_on__douplaunch' => ['调整投放'], // 'info_on__douplaunch' => ['调整投放'],
'table_on__docustomer' => ['合作企业'], 'table_on__docustomer' => ['合作企业'],
'table_on__doworkers' => ['企业联系人'], 'table_on__doworkers' => ['企业联系人'],
'table_on__dokeylist' => ['巡查人员'], 'table_on__dokeylist' => ['巡查人员'],
@ -104,116 +108,120 @@ class appadmin extends admin{
] ]
], ],
'index__doindex' => [ 'index__doindex' => [
['更新检测',['check' => 1] ] ['更新检测', ['check' => 1]]
] ]
]; ];
$i = 0; $i = 0;
foreach ($nav as $key => $val) { foreach ($nav as $key => $val) {
list($info,$sub) = $val; list($info, $sub) = $val;
//判断是否执行当前二级目录 //判断是否执行当前二级目录
$li = ''; $li = '';
if(is_array($info) && ($select == $key || array_key_exists($select, $sub)) ){ if (is_array($info) && ($select == $key || array_key_exists($select, $sub))) {
//执行二级目录的操作 //执行二级目录的操作
$sub = array_merge([$key => $info ],$sub); $sub = array_merge([$key => $info], $sub);
foreach ($sub as $skey => $sval){ foreach ($sub as $skey => $sval) {
if($key == $skey) $sval = array_replace($info,$sval); if ($key == $skey) $sval = array_replace($info, $sval);
//执行一级目录的操作 //执行一级目录的操作
list($sname,$surl) = self::nav_para($skey,$sval,$glpara); list($sname, $surl) = self::nav_para($skey, $sval, $glpara);
//二级选项和页面title //二级选项和页面title
$active = ''; $active = '';
if($select == $skey) { if ($select == $skey) {
$select = $key; $select = $key;
$active = 'active'; $active = 'active';
$this->input['met_title'] = empty($title)?$sname:$title; $this->input['met_title'] = empty($title) ? $sname : $title;
} }
//二级导航HTML //二级导航HTML
$li .= "<li class='nav-item'><a class='nav-link {$active}' href='{$surl}'>{$sname}</a></li>"; $li .= "<li class='nav-item'><a class='nav-link {$active}' href='{$surl}'>{$sname}</a></li>";
} }
$this->input['nav_sub'] = empty($li)?'':'<div class="m-t-10 app-sub-nav"><ul class="p-b-10 nav nav-tabs nav-tabs-line">'.$li.'</ul></div>'; $this->input['nav_sub'] = empty($li) ? '' : '<div class="m-t-10 app-sub-nav"><ul class="p-b-10 nav nav-tabs nav-tabs-line">' . $li . '</ul></div>';
} }
//执行一级目录的操作 //执行一级目录的操作
if(!is_array($info)) $info = $val; if (!is_array($info)) $info = $val;
list($name,$url) = self::nav_para($key,$info,$glpara); list($name, $url) = self::nav_para($key, $info, $glpara);
//填充HTML //填充HTML
nav::set_nav($i, $name, $url); nav::set_nav($i, $name, $url);
$select_nav[$key] = $i; $select_nav[ $key ] = $i;
//页面title //页面title
if($select == $key && empty($this->input['met_title'])) $this->input['met_title'] = empty($title)?$name:$title; if ($select == $key && empty($this->input['met_title'])) $this->input['met_title'] = empty($title) ? $name : $title;
$i++; $i++;
} }
//指定当前方法属于哪个主导航 //指定当前方法属于哪个主导航
if(array_key_exists($select, $nav)) nav::select_nav($select_nav[$select]); if (array_key_exists($select, $nav)) nav::select_nav($select_nav[ $select ]);
} }
//导航NAME和URL //导航NAME和URL
private function nav_para($key,$info,$glpara){ private function nav_para($key, $info, $glpara)
global $_M,$_YW; {
global $_M, $_YW;
//合并c和a //合并c和a
list($c,$a) = stringto_array($key,'__'); list($c, $a) = stringto_array($key, '__');
//合并默认参数值 //合并默认参数值
$arr = array_merge(['c' => $c, 'a' => $a ],$glpara); $arr = array_merge(['c' => $c, 'a' => $a], $glpara);
list($name,$para,$links) = $info; list($name, $para, $links) = $info;
//判断是否有设置单独的参数,有则增加 //判断是否有设置单独的参数,有则增加
if(is_array($para)) $arr = array_merge($arr,$para); if (is_array($para)) $arr = array_merge($arr, $para);
//生成URL //生成URL
$url = empty($links)?$_M['url']['own_name']:$links; $url = empty($links) ? $_M['url']['own_name'] : $links;
return [$name, self::http_build_query($url,$arr)]; return [$name, self::http_build_query($url, $arr)];
} }
#URL上c的值 a的值 #URL上c的值 a的值
#$appshow 全局模板文件,指整个文件的模板 #$appshow 全局模板文件,指整个文件的模板
public function point($c,$a,$appshow = '') { public function point($c, $a, $appshow = '')
global $_M,$_YW; {
global $_M, $_YW;
$this->u_urlc = $c; $this->u_urlc = $c;
$this->u_urla = $a; $this->u_urla = $a;
if(!empty($appshow)) $this->appshow = 'app/'.$appshow; if (!empty($appshow)) $this->appshow = 'app/' . $appshow;
} }
#URL处理 #URL处理
#$appshow 单独定义模板 某个方法内定义 #$appshow 单独定义模板 某个方法内定义
public function appurl($tname = '',$query = [],$appshow = '') { public function appurl($tname = '', $query = [], $appshow = '')
global $_M,$_YW; {
global $_M, $_YW;
//数据库表简写 //数据库表简写
$this->tname = empty($tname)?self::tname():$tname; $this->tname = empty($tname) ? self::tname() : $tname;
//URL参数 //URL参数
if(!is_array($query)) $query = [$query]; if (!is_array($query)) $query = [$query];
$query['tname'] = $this->tname; $query['tname'] = $this->tname;
$this->u_para = '&'.http_build_query($query); $this->u_para = '&' . http_build_query($query);
//URL //URL
$this->input['url'] = [ $this->input['url'] = [
'action' => $_M['url']['own_name']."c={$this->u_urlc}&a={$this->u_urla}".$this->u_para, // 表单提交URL 'action' => $_M['url']['own_name'] . "c={$this->u_urlc}&a={$this->u_urla}" . $this->u_para, // 表单提交URL
'ajaxurl' => $_M['url']['own_name']."c=table_ajax&a={$this->u_urla}".$this->u_para, // table数据获取URL 'ajaxurl' => $_M['url']['own_name'] . "c=table_ajax&a={$this->u_urla}" . $this->u_para, // table数据获取URL
'addlist' => $_M['url']['own_name'].'c=table_ajax&a=do_table_add_list'.$this->u_para, // table新增行URL 'addlist' => $_M['url']['own_name'] . 'c=table_ajax&a=do_table_add_list' . $this->u_para, // table新增行URL
'backup' => $_M['url']['own_name'].'c=backups&a=doindex'.$this->u_para, // table备份URL 'backup' => $_M['url']['own_name'] . 'c=backups&a=doindex' . $this->u_para, // table备份URL
'select' => $_M['url']['own_name'].'c=select&a=doselect' // 下拉选择器 'select' => $_M['url']['own_name'] . 'c=select&a=doselect' // 下拉选择器
]; ];
$this->input['tname'] = $this->tname; $this->input['tname'] = $this->tname;
$_YW['url'] = $this->input['url']; $_YW['url'] = $this->input['url'];
if(!empty($appshow)) $this->appshow = 'app/'.$appshow; if (!empty($appshow)) $this->appshow = 'app/' . $appshow;
} }
//权限 //权限
private function adminop() { private function adminop()
global $_M,$_YW; {
global $_M, $_YW;
$admin_op = background_privilege(); $admin_op = background_privilege();
$adminop = array_filter(explode('-',$admin_op['admin_op'])); $adminop = array_filter(explode('-', $admin_op['admin_op']));
//1查看 【不勾选任何的操作即可实现】 //1查看 【不勾选任何的操作即可实现】
//2编辑 不含删除 【不勾选删除权限即可实现】 //2编辑 不含删除 【不勾选删除权限即可实现】
//3不限制权限 【全部勾选即可】 //3不限制权限 【全部勾选即可】
if(in_array('metinfo', $adminop)){ if (in_array('metinfo', $adminop)) {
$this->adop = ['met'=>true,'add'=>true,'del'=>true]; $this->adop = ['met' => true, 'add' => true, 'del' => true];
}else{ } else {
if(in_array('add', $adminop) || in_array('editor', $adminop)){ if (in_array('add', $adminop) || in_array('editor', $adminop)) {
$this->adop['add'] = true; $this->adop['add'] = true;
} }
if(in_array('del', $adminop)){ if (in_array('del', $adminop)) {
$this->adop['del'] = true; $this->adop['del'] = true;
} }
if($this->adop['add'] && $this->adop['del']){ if ($this->adop['add'] && $this->adop['del']) {
$this->adop['met'] = true; $this->adop['met'] = true;
} }
} }
@ -221,27 +229,29 @@ class appadmin extends admin{
} }
//添加设置参数HTML //添加设置参数HTML
public function setparahtml($ptype = 0,&$html) { public function setparahtml($ptype = 0, &$html)
global $_M,$_YW; {
$addparaurl = $_M['url']['own_name'].'c=table_on&a=dopara&p_type='.$ptype; global $_M, $_YW;
$html .= '<span class="text-help m-l-10"><a target="_blank" href="'.$addparaurl.'">设置选项</a></span>'; $addparaurl = $_M['url']['own_name'] . 'c=table_on&a=dopara&p_type=' . $ptype;
$html .= '<span class="text-help m-l-10"><a target="_blank" href="' . $addparaurl . '">设置选项</a></span>';
} }
//参数单选组成 //参数单选组成
public function para_radio($para,$name,$checked,&$html,$exists = false) { public function para_radio($para, $name, $checked, &$html, $exists = false)
global $_M,$_YW; {
global $_M, $_YW;
$html = ''; $html = '';
$first = 'data-checked="'.$checked.'" required data-fv-notEmpty-message="不能为空"'; $first = 'data-checked="' . $checked . '" required data-fv-notEmpty-message="不能为空"';
foreach ($para as $key => $val) { foreach ($para as $key => $val) {
if($exists) { if ($exists) {
list($p_name,$p_value,$p_text) = $val; list($p_name, $p_value, $p_text) = $val;
}else{ } else {
extract($val); extract($val);
} }
$html .= '<div class="radio-custom radio-primary radio-inline"> $html .= '<div class="radio-custom radio-primary radio-inline">
<input type="radio" id="'.$name.$key.'" name="'.$name.'" value="'.$p_value.'" '.$first.' /> <input type="radio" id="' . $name . $key . '" name="' . $name . '" value="' . $p_value . '" ' . $first . ' />
<label for="'.$name.$key.'">'.$p_name.'</label> <label for="' . $name . $key . '">' . $p_name . '</label>
<span class="text-help m-l-10">'.$p_text.'</span> <span class="text-help m-l-10">' . $p_text . '</span>
</div>'; </div>';
$first = ''; $first = '';
} }
@ -249,20 +259,21 @@ class appadmin extends admin{
} }
//参数多选组成 //参数多选组成
public function para_checkbox($para,$name,$checked,&$html,$exists = false) { public function para_checkbox($para, $name, $checked, &$html, $exists = false)
global $_M,$_YW; {
global $_M, $_YW;
$html = ''; $html = '';
$first = 'data-checked="'.$checked.'" required data-fv-notEmpty-message="不能为空" '; // data-delimiter="," 因为暂时无效 $first = 'data-checked="' . $checked . '" required data-fv-notEmpty-message="不能为空" '; // data-delimiter="," 因为暂时无效
foreach ($para as $key => $val) { foreach ($para as $key => $val) {
if($exists) { if ($exists) {
list($p_name,$p_value,$p_text) = $val; list($p_name, $p_value, $p_text) = $val;
}else{ } else {
extract($val); extract($val);
} }
$html .= '<div class="checkbox-custom checkbox-primary checkbox-inline"> $html .= '<div class="checkbox-custom checkbox-primary checkbox-inline">
<input type="checkbox" id="'.$name.$key.'" name="'.$name.'" value="'.$p_value.'" '.$first.' /> <input type="checkbox" id="' . $name . $key . '" name="' . $name . '" value="' . $p_value . '" ' . $first . ' />
<label for="'.$name.$key.'">'.$p_name.'</label> <label for="' . $name . $key . '">' . $p_name . '</label>
<span class="text-help m-l-10">'.$p_text.'</span> <span class="text-help m-l-10">' . $p_text . '</span>
</div>'; </div>';
$first = ''; $first = '';
} }
@ -270,116 +281,129 @@ class appadmin extends admin{
} }
//参数处理 //参数处理
public function translate($p_type = 0) { public function translate($p_type = 0)
global $_M,$_YW; {
global $_M, $_YW;
$para = self::paralist($p_type); $para = self::paralist($p_type);
return array_combine(array_column($para,'p_value'), array_column($para,'p_name')); return array_combine(array_column($para, 'p_value'), array_column($para, 'p_name'));
} }
//场所名称 //场所名称
public function villagelist($id,$key = 'v_name') { public function villagelist($id, $key = 'v_name')
global $_M,$_YW; {
global $_M, $_YW;
$village = $this->tsql->table('village')->where(['id' => $id])->one(); $village = $this->tsql->table('village')->where(['id' => $id])->one();
return $village[$key]; return $village[ $key ];
} }
//公司名称 //公司名称
public function customerlist($id,$key = 'c_allname') { public function customerlist($id, $key = 'c_allname')
global $_M,$_YW; {
global $_M, $_YW;
$customer = $this->tsql->table('customer')->where(['id' => $id])->one(); $customer = $this->tsql->table('customer')->where(['id' => $id])->one();
return $customer[$key]; return $customer[ $key ];
} }
//相关人员 //相关人员
public function workerslist($id,$key = 'w_name') { public function workerslist($id, $key = 'w_name')
global $_M,$_YW; {
global $_M, $_YW;
$workers = $this->tsql->table('workers')->where(['id' => $id])->one(); $workers = $this->tsql->table('workers')->where(['id' => $id])->one();
return $key == false?$workers:$workers[$key]; return $key == false ? $workers : $workers[ $key ];
} }
//返回广告位对照地址 //返回广告位对照地址
public function e_address($elevator) { public function e_address($elevator)
global $_M,$_YW; {
global $_M, $_YW;
//门口方位 //门口方位
$e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno'] ]); $e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno']]);
//广告位置 //广告位置
$e_aps = self::paralist(['p_type' => 0, 'p_value' => $elevator['e_aps'] ]); $e_aps = self::paralist(['p_type' => 0, 'p_value' => $elevator['e_aps']]);
//场所 //场所
$e_vid = self::villagelist($elevator['e_vid']); $e_vid = self::villagelist($elevator['e_vid']);
return "{$elevator['e_number']}".$e_vid.$e_bno['p_name'].$e_aps['p_name']; return "{$elevator['e_number']}" . $e_vid . $e_bno['p_name'] . $e_aps['p_name'];
} }
//字段颜色 //字段颜色
public function state_color($state,$array = []) { public function state_color($state, $array = [])
global $_M,$_YW; {
$color = ['red-600','green-600','purple-600']; global $_M, $_YW;
$str = count($array) > 0?$array:['无效','有效']; $color = ['red-600', 'green-600', 'purple-600'];
return '<font class="'.$color[$state].'">'.$str[$state].'</font>'; $str = count($array) > 0 ? $array : ['无效', '有效'];
return '<font class="' . $color[ $state ] . '">' . $str[ $state ] . '</font>';
} }
//字体颜色 //字体颜色
public function str_color($state,$str,$weight = 'unset') { public function str_color($state, $str, $weight = 'unset')
global $_M,$_YW; {
$color = ['red-600','green-600','cyan-600','blue-600']; global $_M, $_YW;
return '<font class="'.$color[$state].' font-weight-'.$weight.'">'.$str.'</font>'; $color = ['red-600', 'green-600', 'cyan-600', 'blue-600'];
return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>';
} }
//标签形式的分割显示 //标签形式的分割显示
public function tab_tokenfield($ver,$type = 0,$decollator = ',',$length = 0) { public function tab_tokenfield($ver, $type = 0, $decollator = ',', $length = 0)
global $_M,$_YW; {
$class = ['tag-default','tag-primary','tag-warning']; global $_M, $_YW;
$array = stringto_array($ver,$decollator); $class = ['tag-default', 'tag-primary', 'tag-warning'];
$array = stringto_array($ver, $decollator);
$i = 0; $i = 0;
foreach ($array as $val) { foreach ($array as $val) {
$html .= '<span class="tag tag-sm '.$class[$type].'">'.$val.'</span> '; $html .= '<span class="tag tag-sm ' . $class[ $type ] . '">' . $val . '</span> ';
$i++; $i++;
if($length > 0 && $length == $i) break; if ($length > 0 && $length == $i) break;
} }
return $html; return $html;
} }
//广告位的合同编号 //广告位的合同编号
public function e_state($title) { public function e_state($title)
global $_M,$_YW; {
$class = ['tag-danger','tag-primary']; global $_M, $_YW;
$title = $title > 0?'已租赁':'空置'; $class = ['tag-danger', 'tag-primary'];
$type = $title > 0?1:0; $title = $title > 0 ? '已租赁' : '空置';
return '<span class="tag tag-sm '.$class[$type].'">'.$title.'</span> '; $type = $title > 0 ? 1 : 0;
return '<span class="tag tag-sm ' . $class[ $type ] . '">' . $title . '</span> ';
} }
//参数的对应值获取 //参数的对应值获取
public function paralist($p_type = 0) { public function paralist($p_type = 0)
global $_M,$_YW; {
global $_M, $_YW;
$this->tsql->table('para') $this->tsql->table('para')
->where(is_array($p_type)?$p_type:['p_type' => $p_type]) ->where(is_array($p_type) ? $p_type : ['p_type' => $p_type])
->order('p_order DESC'); ->order('p_order DESC');
return is_array($p_type)?$this->tsql->one():$this->tsql->all(); return is_array($p_type) ? $this->tsql->one() : $this->tsql->all();
} }
//转化字符串形式 //转化字符串形式
public function strchange($strarr = []) { public function strchange($strarr = [])
global $_M,$_YW; {
foreach($strarr as $val) { global $_M, $_YW;
if($val != null) $idstr[] = "'{$val}'"; foreach ($strarr as $val) {
if ($val != null) $idstr[] = "'{$val}'";
} }
return arrayto_string($idstr,','); return arrayto_string($idstr, ',');
} }
//广告位状态变更 //广告位状态变更
public function type_onoff($field,$value,$id,$array = ['无效','有效']) { public function type_onoff($field, $value, $id, $array = ['无效', '有效'])
global $_M,$_YW; {
$color = ['tag-danger','tag-success']; global $_M, $_YW;
$url = $_M['url']['own_name']."c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax"; $color = ['tag-danger', 'tag-success'];
return '<span data-href="'.$url.'" class="btn-cursor-pointer tag tag-sm tag-outline '.$color[$value].'" >'.$array[$value].'</span>'; $url = $_M['url']['own_name'] . "c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax";
return '<span data-href="' . $url . '" class="btn-cursor-pointer tag tag-sm tag-outline ' . $color[ $value ] . '" >' . $array[ $value ] . '</span>';
} }
//处理多选的ID //处理多选的ID
public function where_id(&$where) { public function where_id(&$where)
global $_M,$_YW; {
$allid = array_filter(stringto_array($_M['form']['all_id'],',')); global $_M, $_YW;
if($allid){ $allid = array_filter(stringto_array($_M['form']['all_id'], ','));
if($where) $where .= " AND "; if ($allid) {
if ($where) $where .= " AND ";
$idstr = self::strchange($allid); $idstr = self::strchange($allid);
switch ($this->tname) { switch ($this->tname) {
case 'elevators': case 'elevators':
@ -395,8 +419,9 @@ class appadmin extends admin{
} }
// 对现有广告位进行裂变,已经不再需要 // 对现有广告位进行裂变,已经不再需要
public function fission() { public function fission()
global $_M,$_YW; {
global $_M, $_YW;
//获取所有广告位 //获取所有广告位
$elevator = $this->tsql->table('elevator')->all(); $elevator = $this->tsql->table('elevator')->all();
//划定什么位置裂变成什么 1裂变出2 //划定什么位置裂变成什么 1裂变出2
@ -409,8 +434,8 @@ class appadmin extends admin{
//拼装数据 //拼装数据
foreach ($elevator as $val) { foreach ($elevator as $val) {
//计算广告位编号 //计算广告位编号
$neweaps = $e_aps[$val['e_aps']]; $neweaps = $e_aps[ $val['e_aps'] ];
self::e_number($val['e_number'],$neweaps); self::e_number($val['e_number'], $neweaps);
$field = [ $field = [
'e_number' => $val['e_number'], 'e_number' => $val['e_number'],
'e_vid' => $val['e_vid'], 'e_vid' => $val['e_vid'],
@ -429,17 +454,18 @@ class appadmin extends admin{
} }
//对字符串处理 //对字符串处理
public function e_number(&$num,$neweaps,$type = false) { public function e_number(&$num, $neweaps, $type = false)
global $_M,$_YW; {
if($type) $neweaps++; global $_M, $_YW;
if ($type) $neweaps++;
//新的编号 //新的编号
$enum = $num.$neweaps; $enum = $num . $neweaps;
//验证 //验证
$elevator = $this->tsql->table('elevator')->where(['e_number' => $enum ])->one(); $elevator = $this->tsql->table('elevator')->where(['e_number' => $enum])->one();
if($elevator == false){ if ($elevator == false) {
$num = $enum; $num = $enum;
}else{ } else {
self::e_number($num,$neweaps,true); self::e_number($num, $neweaps, true);
} }
} }

View File

@ -6,7 +6,8 @@ load::sys_class('web');
load::own_class('../traits/appcmp'); load::own_class('../traits/appcmp');
//前台类 //前台类
class appweb extends web { class appweb extends web
{
//开始时间 //开始时间
public $time; public $time;
@ -25,7 +26,8 @@ class appweb extends web {
public $postdata = []; public $postdata = [];
public $tem_id = ''; public $tem_id = '';
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
self::cmp_load(); self::cmp_load();
@ -33,9 +35,9 @@ class appweb extends web {
//开始时间 //开始时间
$this->time = time(); $this->time = time();
$this->datetime = self::data_time($this->time); $this->datetime = self::data_time($this->time);
$this->tsql = load::own_class('tsql','new'); $this->tsql = load::own_class('tsql', 'new');
$this->cloud = load::own_class('cloud','new'); $this->cloud = load::own_class('cloud', 'new');
// self::basics(); // self::basics();
ini_set("display_errors", "On"); ini_set("display_errors", "On");
error_reporting(E_ERROR); error_reporting(E_ERROR);
@ -44,21 +46,24 @@ class appweb extends web {
use appcmp; use appcmp;
//生成CSS //生成CSS
public function metcss() { public function metcss()
global $_M,$_YW; {
$metcss = PATH_APP_FILE.'web/templates/met/css/metinfo.css'; global $_M, $_YW;
if(!file_exists($metcss)) self::merge_css(); $metcss = PATH_APP_FILE . 'web/templates/met/css/metinfo.css';
if (!file_exists($metcss)) self::merge_css();
} }
//前台常用信息 //前台常用信息
protected function basics() { protected function basics()
global $_M,$_YW; {
$this->input['appcore'] .= ' data-m_name="'.$this->m_name.'" '; global $_M, $_YW;
$this->input['appcore'] .= ' data-own_name="'.$_M['url']['own_name'].'" '; $this->input['appcore'] .= ' data-m_name="' . $this->m_name . '" ';
$this->input['appcore'] .= ' data-own_name="' . $_M['url']['own_name'] . '" ';
} }
//合同内容 //合同内容
public function postdata($type,$arr) { public function postdata($type, $arr)
{
global $_M, $_YW; global $_M, $_YW;
//清理缓存 //清理缓存
$this->postdata = []; $this->postdata = [];
@ -72,17 +77,17 @@ class appweb extends web {
//内容 //内容
$this->postdata = [ $this->postdata = [
//开头 提醒的内容 //开头 提醒的内容
'first' => ['value' => $arr['first']['value'], 'color' => $arr['first']['color'] ], 'first' => ['value' => $arr['first']['value'], 'color' => $arr['first']['color']],
// 合同开始日期 // 合同开始日期
'keyword1' => ['value' => $arr['h_starttime'] ], 'keyword1' => ['value' => $arr['h_starttime']],
// 合同结束日期 // 合同结束日期
'keyword2' => ['value' => $arr['h_endtime'] ], 'keyword2' => ['value' => $arr['h_endtime']],
//结尾 //结尾
'remark' => ['value' => 'remark' => ['value' =>
"合同编号:{$arr['h_number']}".PHP_EOL "合同编号:{$arr['h_number']}" . PHP_EOL
."签定企业:{$arr['c_allname']}".PHP_EOL . "签定企业:{$arr['c_allname']}" . PHP_EOL
."相关人员:{$arr['wnamestr']}".PHP_EOL . "相关人员:{$arr['wnamestr']}" . PHP_EOL
."提醒时间:{$this->datetime}" . "提醒时间:{$this->datetime}"
], ],
]; ];
break; break;
@ -93,18 +98,18 @@ class appweb extends web {
//内容 //内容
$this->postdata = [ $this->postdata = [
//开头 提醒的内容 //开头 提醒的内容
'first' => ['value' => $arr['first']['value'], 'color' => $arr['first']['color'] ], 'first' => ['value' => $arr['first']['value'], 'color' => $arr['first']['color']],
// 合同编号 // 合同编号
'keyword1' => ['value' => $arr['h_number'] ], 'keyword1' => ['value' => $arr['h_number']],
// 合同开始日期 // 合同开始日期
'keyword2' => ['value' => $arr['h_starttime'] ], 'keyword2' => ['value' => $arr['h_starttime']],
// 合同结束日期 // 合同结束日期
'keyword3' => ['value' => $arr['h_endtime'] ], 'keyword3' => ['value' => $arr['h_endtime']],
//结尾 //结尾
'remark' => ['value' => 'remark' => ['value' =>
"签定企业:{$arr['c_allname']}".PHP_EOL "签定企业:{$arr['c_allname']}" . PHP_EOL
."相关人员:{$arr['wnamestr']}".PHP_EOL . "相关人员:{$arr['wnamestr']}" . PHP_EOL
."通知时间:{$this->datetime}" . "通知时间:{$this->datetime}"
], ],
]; ];
break; break;
@ -117,17 +122,17 @@ class appweb extends web {
//开头 提醒的内容 //开头 提醒的内容
'first' => ['value' => '合同提醒汇总结果,请登录后台查看详情', 'color' => '#BDBDBD'], 'first' => ['value' => '合同提醒汇总结果,请登录后台查看详情', 'color' => '#BDBDBD'],
// 合同编号 // 合同编号
'keyword1' => ['value' => '山东梯美广告有限公司' ], 'keyword1' => ['value' => '山东梯美广告有限公司'],
// 合同开始日期 // 合同开始日期
'keyword2' => ['value' => $this->datetime ], 'keyword2' => ['value' => $this->datetime],
// 合同结束日期 // 合同结束日期
'keyword3' => ['value' => array_sum($arr) ], 'keyword3' => ['value' => array_sum($arr)],
//结尾 //结尾
'remark' => ['value' => 'remark' => ['value' =>
"定时提醒:{$arr['daya']}".PHP_EOL "定时提醒:{$arr['daya']}" . PHP_EOL
."三天到期:{$arr['dayb']}".PHP_EOL . "三天到期:{$arr['dayb']}" . PHP_EOL
."今天到期:{$arr['dayc']}".PHP_EOL . "今天到期:{$arr['dayc']}" . PHP_EOL
."今天投放开始总数:{$arr['dayd']}" . "今天投放开始总数:{$arr['dayd']}"
], ],
]; ];
break; break;
@ -144,10 +149,10 @@ class appweb extends web {
public function openid($openid = '') public function openid($openid = '')
{ {
global $_M, $_YW; global $_M, $_YW;
$openid .= ','.$_YW['c']['openid']; $openid .= ',' . $_YW['c']['openid'];
$openid = stringto_array($openid,','); $openid = stringto_array($openid, ',');
foreach ($openid as $id) { foreach ($openid as $id) {
if($id) self::temmsg($id); if ($id) self::temmsg($id);
} }
return $this; return $this;
} }
@ -157,17 +162,17 @@ class appweb extends web {
{ {
global $_M, $_YW; global $_M, $_YW;
$return = ['errcode' => -1, 'errmsg' => "系统错误用户openid{$openid}消息模板Tem_id{$this->tem_id}"]; $return = ['errcode' => -1, 'errmsg' => "系统错误用户openid{$openid}消息模板Tem_id{$this->tem_id}"];
if($openid && $this->tem_id){ if ($openid && $this->tem_id) {
$return = $this->webase->post_template_msg($openid, $this->tem_id, '', $this->postdata); $return = $this->webase->post_template_msg($openid, $this->tem_id, '', $this->postdata);
} }
$json = is_array($return)?json_encode($return,JSON_UNESCAPED_UNICODE):$return; $json = is_array($return) ? json_encode($return, JSON_UNESCAPED_UNICODE) : $return;
//发送记录 //发送记录
$field = [ $field = [
'openid' => $openid, 'openid' => $openid,
'text' => $this->postdata['first']['value'], 'text' => $this->postdata['first']['value'],
'content' => json_encode($this->postdata,JSON_UNESCAPED_UNICODE), 'content' => json_encode($this->postdata, JSON_UNESCAPED_UNICODE),
'returntext' => $json, 'returntext' => $json,
'state' => $return['errcode'] == 0?1:0, 'state' => $return['errcode'] == 0 ? 1 : 0,
'exetime' => $this->datetime, 'exetime' => $this->datetime,
'addtime' => $this->datetime 'addtime' => $this->datetime
]; ];
@ -176,121 +181,130 @@ class appweb extends web {
} }
//参数处理 //参数处理
public function translate($p_type = 0) { public function translate($p_type = 0)
global $_M,$_YW; {
global $_M, $_YW;
$para = self::paralist($p_type); $para = self::paralist($p_type);
return array_combine(array_column($para,'p_value'), array_column($para,'p_name')); return array_combine(array_column($para, 'p_value'), array_column($para, 'p_name'));
} }
//场所名称 //场所名称
public function villagelist($id,$key = 'v_name') { public function villagelist($id, $key = 'v_name')
global $_M,$_YW; {
global $_M, $_YW;
$village = $this->tsql->table('village')->where(['id' => $id])->one(); $village = $this->tsql->table('village')->where(['id' => $id])->one();
return $village[$key]; return $village[ $key ];
} }
//公司名称 //公司名称
public function customerlist($id,$key = 'c_allname') { public function customerlist($id, $key = 'c_allname')
global $_M,$_YW; {
global $_M, $_YW;
$customer = $this->tsql->table('customer')->where(['id' => $id])->one(); $customer = $this->tsql->table('customer')->where(['id' => $id])->one();
return $customer[$key]; return $customer[ $key ];
} }
//相关人员 //相关人员
public function workerslist($id,$key = 'w_name') { public function workerslist($id, $key = 'w_name')
global $_M,$_YW; {
global $_M, $_YW;
$workers = $this->tsql->table('workers')->where(['id' => $id])->one(); $workers = $this->tsql->table('workers')->where(['id' => $id])->one();
return $key == false?$workers:$workers[$key]; return $key == false ? $workers : $workers[ $key ];
} }
//返回广告位对照地址 //返回广告位对照地址
public function e_address($elevator) { public function e_address($elevator)
global $_M,$_YW; {
global $_M, $_YW;
//门口方位 //门口方位
$e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno'] ]); $e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno']]);
//广告位置 //广告位置
$e_aps = self::paralist(['p_type' => 0, 'p_value' => $elevator['e_aps'] ]); $e_aps = self::paralist(['p_type' => 0, 'p_value' => $elevator['e_aps']]);
//场所 //场所
$e_vid = self::villagelist($elevator['e_vid']); $e_vid = self::villagelist($elevator['e_vid']);
return "{$elevator['e_number']}".$e_vid.$e_bno['p_name'].$e_aps['p_name']; return "{$elevator['e_number']}" . $e_vid . $e_bno['p_name'] . $e_aps['p_name'];
} }
//字段颜色 //字段颜色
public function state_color($state,$array = []) { public function state_color($state, $array = [])
global $_M,$_YW; {
$color = ['red-600','green-600','purple-600']; global $_M, $_YW;
$str = count($array) > 0?$array:['无效','有效']; $color = ['red-600', 'green-600', 'purple-600'];
return '<font class="'.$color[$state].'">'.$str[$state].'</font>'; $str = count($array) > 0 ? $array : ['无效', '有效'];
return '<font class="' . $color[ $state ] . '">' . $str[ $state ] . '</font>';
} }
//字体颜色 //字体颜色
public function str_color($state,$str,$weight = 'unset') { public function str_color($state, $str, $weight = 'unset')
global $_M,$_YW; {
$color = ['red-600','green-600','cyan-600','blue-600']; global $_M, $_YW;
return '<font class="'.$color[$state].' font-weight-'.$weight.'">'.$str.'</font>'; $color = ['red-600', 'green-600', 'cyan-600', 'blue-600'];
return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>';
} }
//标签形式的分割显示 //标签形式的分割显示
public function tab_tokenfield($ver,$type = 0,$decollator = ',',$length = 0) { public function tab_tokenfield($ver, $type = 0, $decollator = ',', $length = 0)
global $_M,$_YW; {
$class = ['tag-default','tag-primary','tag-warning']; global $_M, $_YW;
$array = stringto_array($ver,$decollator); $class = ['tag-default', 'tag-primary', 'tag-warning'];
$array = stringto_array($ver, $decollator);
$i = 0; $i = 0;
foreach ($array as $val) { foreach ($array as $val) {
$html .= '<span class="tag tag-sm '.$class[$type].'">'.$val.'</span> '; $html .= '<span class="tag tag-sm ' . $class[ $type ] . '">' . $val . '</span> ';
$i++; $i++;
if($length > 0 && $length == $i) break; if ($length > 0 && $length == $i) break;
} }
return $html; return $html;
} }
//广告位的合同编号 //广告位的合同编号
public function e_state($title) { public function e_state($title)
global $_M,$_YW; {
$class = ['tag-danger','tag-primary']; global $_M, $_YW;
$title = $title > 0?'已租赁':'空置'; $class = ['tag-danger', 'tag-primary'];
$type = $title > 0?1:0; $title = $title > 0 ? '已租赁' : '空置';
return '<span class="tag tag-sm '.$class[$type].'">'.$title.'</span> '; $type = $title > 0 ? 1 : 0;
return '<span class="tag tag-sm ' . $class[ $type ] . '">' . $title . '</span> ';
} }
//参数的对应值获取 //参数的对应值获取
public function paralist($p_type = 0) { public function paralist($p_type = 0)
global $_M,$_YW; {
global $_M, $_YW;
$this->tsql->table('para') $this->tsql->table('para')
->where(is_array($p_type)?$p_type:['p_type' => $p_type]) ->where(is_array($p_type) ? $p_type : ['p_type' => $p_type])
->order('p_order DESC'); ->order('p_order DESC');
return is_array($p_type)?$this->tsql->one():$this->tsql->all(); return is_array($p_type) ? $this->tsql->one() : $this->tsql->all();
} }
//转化字符串形式 //转化字符串形式
public function strchange($strarr = []) { public function strchange($strarr = [])
global $_M,$_YW; {
foreach($strarr as $val) { global $_M, $_YW;
if($val != null) $idstr[] = "'{$val}'"; foreach ($strarr as $val) {
if ($val != null) $idstr[] = "'{$val}'";
} }
return arrayto_string($idstr,','); return arrayto_string($idstr, ',');
} }
//广告位状态变更 //广告位状态变更
public function type_onoff($field,$value,$id,$array = ['无效','有效']) { public function type_onoff($field, $value, $id, $array = ['无效', '有效'])
global $_M,$_YW; {
$color = ['tag-danger','tag-success']; global $_M, $_YW;
$url = $_M['url']['own_name']."c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax"; $color = ['tag-danger', 'tag-success'];
return '<span data-href="'.$url.'" class="btn-cursor-pointer tag tag-sm tag-outline '.$color[$value].'" >'.$array[$value].'</span>'; $url = $_M['url']['own_name'] . "c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax";
return '<span data-href="' . $url . '" class="btn-cursor-pointer tag tag-sm tag-outline ' . $color[ $value ] . '" >' . $array[ $value ] . '</span>';
} }
//处理多选的ID //处理多选的ID
public function where_id(&$where) { public function where_id(&$where)
global $_M,$_YW; {
$allid = array_filter(stringto_array($_M['form']['all_id'],',')); global $_M, $_YW;
if($allid){ $allid = array_filter(stringto_array($_M['form']['all_id'], ','));
if($where) $where .= " AND "; if ($allid) {
if ($where) $where .= " AND ";
$idstr = self::strchange($allid); $idstr = self::strchange($allid);
switch ($this->tname) { switch ($this->tname) {
case 'elevators': case 'elevators':
@ -306,8 +320,9 @@ class appweb extends web {
} }
// 对现有广告位进行裂变,已经不再需要 // 对现有广告位进行裂变,已经不再需要
public function fission() { public function fission()
global $_M,$_YW; {
global $_M, $_YW;
//获取所有广告位 //获取所有广告位
$elevator = $this->tsql->table('elevator')->all(); $elevator = $this->tsql->table('elevator')->all();
//划定什么位置裂变成什么 1裂变出2 //划定什么位置裂变成什么 1裂变出2
@ -320,8 +335,8 @@ class appweb extends web {
//拼装数据 //拼装数据
foreach ($elevator as $val) { foreach ($elevator as $val) {
//计算广告位编号 //计算广告位编号
$neweaps = $e_aps[$val['e_aps']]; $neweaps = $e_aps[ $val['e_aps'] ];
self::e_number($val['e_number'],$neweaps); self::e_number($val['e_number'], $neweaps);
$field = [ $field = [
'e_number' => $val['e_number'], 'e_number' => $val['e_number'],
'e_vid' => $val['e_vid'], 'e_vid' => $val['e_vid'],
@ -340,17 +355,18 @@ class appweb extends web {
} }
//对字符串处理 //对字符串处理
public function e_number(&$num,$neweaps,$type = false) { public function e_number(&$num, $neweaps, $type = false)
global $_M,$_YW; {
if($type) $neweaps++; global $_M, $_YW;
if ($type) $neweaps++;
//新的编号 //新的编号
$enum = $num.$neweaps; $enum = $num . $neweaps;
//验证 //验证
$elevator = $this->tsql->table('elevator')->where(['e_number' => $enum ])->one(); $elevator = $this->tsql->table('elevator')->where(['e_number' => $enum])->one();
if($elevator == false){ if ($elevator == false) {
$num = $enum; $num = $enum;
}else{ } else {
self::e_number($num,$neweaps,true); self::e_number($num, $neweaps, true);
} }
} }

View File

@ -3,13 +3,15 @@
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
//所有公用方法 //所有公用方法
class cloud{ class cloud
{
public $tsql; public $tsql;
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
$this->tsql = load::own_class('tsql','new'); $this->tsql = load::own_class('tsql', 'new');
} }
/* /*
@ -17,91 +19,95 @@ class cloud{
* @param array $back 输出字符串或数组 * @param array $back 输出字符串或数组
* @param string $callback ajax的回调函数的名称 * @param string $callback ajax的回调函数的名称
*/ */
public function jsoncallback($back, $callback = 'callback') { public function jsoncallback($back, $callback = 'callback')
{
global $_M; global $_M;
header('Content-type: application/x-javascript'); header('Content-type: application/x-javascript');
$callback = $_M['form'][$callback]; $callback = $_M['form'][ $callback ];
$json = json_encode($back,JSON_UNESCAPED_UNICODE); $json = json_encode($back, JSON_UNESCAPED_UNICODE);
echo $callback?$callback . '(' . $json . ')':$json; echo $callback ? $callback . '(' . $json . ')' : $json;
} }
//城市信息 //城市信息
public function citydata() { public function citydata()
global $_M,$_YW; {
$dirfile = PATH_APP_FILE.'public/js/city/city.min.json'; global $_M, $_YW;
if (!file_exists($dirfile)){ $dirfile = PATH_APP_FILE . 'public/js/city/city.min.json';
$citys = json_decode(file_get_contents(PATH_SYS."include/static2/vendor/select-linkage/citydata.min.json"),true); if (!file_exists($dirfile)) {
$citys = json_decode(file_get_contents(PATH_SYS . "include/static2/vendor/select-linkage/citydata.min.json"), true);
$i = 0; $i = 0;
$array = []; $array = [];
foreach ($citys['citylist'] as $key => $val) { foreach ($citys['citylist'] as $key => $val) {
if(version_compare($_M['config']['metcms_v'],'6.2.0','>=')){ if (version_compare($_M['config']['metcms_v'], '6.2.0', '>=')) {
$val['p'] = substr($val['p'],0,stripos($val['p'],'(')); $val['p'] = substr($val['p'], 0, stripos($val['p'], '('));
$array[$key] = $val; $array[ $key ] = $val;
}else{ } else {
foreach ($val as $pkey => $pval) { foreach ($val as $pkey => $pval) {
array_unshift($pval,['n'=>'请选择']); array_unshift($pval, ['n' => '请选择']);
if(array_level($pval) == 4){ if (array_level($pval) == 4) {
foreach ($pval as $akey => $aval) { foreach ($pval as $akey => $aval) {
if(array_level($aval['a']) == 2) array_unshift($aval['a'],['s'=>'请选择']); if (array_level($aval['a']) == 2) array_unshift($aval['a'], ['s' => '请选择']);
$array[$key][$pkey][$akey] = $aval; $array[ $key ][ $pkey ][ $akey ] = $aval;
} }
//跳过 //跳过
continue; continue;
} }
$array[$key][$pkey] = $pval; $array[ $key ][ $pkey ] = $pval;
} }
} }
} }
$citydata = ['citylist'=>$array]; $citydata = ['citylist' => $array];
//生成缓存 //生成缓存
$jsonstr = json_encode($citydata,JSON_UNESCAPED_UNICODE); $jsonstr = json_encode($citydata, JSON_UNESCAPED_UNICODE);
load::sys_func('file'); load::sys_func('file');
makefile($dirfile); makefile($dirfile);
file_put_contents($dirfile, $jsonstr); file_put_contents($dirfile, $jsonstr);
$citystr = self::jsoncallback($citydata); $citystr = self::jsoncallback($citydata);
}else{ } else {
$citystr = file_get_contents($dirfile); $citystr = file_get_contents($dirfile);
} }
//返回信息 //返回信息
echo $citystr; echo $citystr;
} }
public function city_url() { public function city_url()
global $_M,$_YW; {
$dirfile = PATH_APP_FILE.'public/js/city/city.min.json'; global $_M, $_YW;
if(file_exists($dirfile)){ $dirfile = PATH_APP_FILE . 'public/js/city/city.min.json';
$url = $_M['url']['app']."{$_YW['n']}/public/js/city/city.min.json"; if (file_exists($dirfile)) {
}else{ $url = $_M['url']['app'] . "{$_YW['n']}/public/js/city/city.min.json";
$url = class_exists('appadmin')?$_M['url']['own_name']."c=ajax&a=docitys":$_M['url']['own_name']."c=index&a=docitys"; } else {
$url = class_exists('appadmin') ? $_M['url']['own_name'] . "c=ajax&a=docitys" : $_M['url']['own_name'] . "c=index&a=docitys";
} }
return $url; return $url;
} }
//计算时间相差天数 //计算时间相差天数
public function summary() { public function summary()
global $_M,$_YW; {
global $_M, $_YW;
$summoney = $this->tsql->table('contract')->qfield(" Sum(h_tprice) as tprice ")->where(" h_tprice IS NOT NULL ")->one(); $summoney = $this->tsql->table('contract')->qfield(" Sum(h_tprice) as tprice ")->where(" h_tprice IS NOT NULL ")->one();
return [ return [
'village' => $this->tsql->table('village')->count(), 'village' => $this->tsql->table('village')->count(),
'elevator' => $this->tsql->table('elevator')->count(), 'elevator' => $this->tsql->table('elevator')->count(),
'vfree' => $this->tsql->table_unset() 'vfree' => $this->tsql->table_unset()
->tables(['elevator','el'], 'LEFT JOIN') ->tables(['elevator', 'el'], 'LEFT JOIN')
->tables(['launch','la'], 'ON find_in_set( el.e_number, la.l_enumber )') ->tables(['launch', 'la'], 'ON find_in_set( el.e_number, la.l_enumber )')
->where(" la.l_endtime < CURDATE() OR la.l_starttime > CURDATE() OR la.id IS NULL ") ->where(" la.l_endtime < CURDATE() OR la.l_starttime > CURDATE() OR la.id IS NULL ")
->count(" distinct e_number "), ->count(" distinct e_number "),
'vlease' => $this->tsql->table_unset() 'vlease' => $this->tsql->table_unset()
->tables(['elevator','el'], 'LEFT JOIN') ->tables(['elevator', 'el'], 'LEFT JOIN')
->tables(['launch','la'], 'ON find_in_set( el.e_number, la.l_enumber )') ->tables(['launch', 'la'], 'ON find_in_set( el.e_number, la.l_enumber )')
->where(" NOT(la.l_endtime < CURDATE() OR la.l_starttime > CURDATE() ) ") ->where(" NOT(la.l_endtime < CURDATE() OR la.l_starttime > CURDATE() ) ")
->count(" distinct e_number "), ->count(" distinct e_number "),
'vendday' => $this->tsql->table_unset() 'vendday' => $this->tsql->table_unset()
->tables(['elevator','el'], 'LEFT JOIN') ->tables(['elevator', 'el'], 'LEFT JOIN')
->tables(['launch','la'], 'ON find_in_set( el.e_number, la.l_enumber )') ->tables(['launch', 'la'], 'ON find_in_set( el.e_number, la.l_enumber )')
->where(" la.l_endtime BETWEEN CURDATE( ) AND date_add( CURDATE( ), INTERVAL 7 DAY ) ") ->where(" la.l_endtime BETWEEN CURDATE( ) AND date_add( CURDATE( ), INTERVAL 7 DAY ) ")
->count(" distinct e_number "), ->count(" distinct e_number "),
'vprerow' => $this->tsql->table_unset() 'vprerow' => $this->tsql->table_unset()
->tables(['elevator','el'], 'LEFT JOIN') ->tables(['elevator', 'el'], 'LEFT JOIN')
->tables(['launch','la'], 'ON find_in_set( el.e_number, la.l_enumber )') ->tables(['launch', 'la'], 'ON find_in_set( el.e_number, la.l_enumber )')
->where(" la.l_starttime > CURDATE() ") ->where(" la.l_starttime > CURDATE() ")
->count(" distinct e_number "), ->count(" distinct e_number "),
'contract' => $this->tsql->table('contract')->count(), 'contract' => $this->tsql->table('contract')->count(),
@ -109,13 +115,12 @@ class cloud{
'endcontract' => $this->tsql->table('contract')->where(" h_endtime < CURDATE() ")->count(), 'endcontract' => $this->tsql->table('contract')->where(" h_endtime < CURDATE() ")->count(),
'endlaunch' => $this->tsql->table('launch')->where(" l_endtime < CURDATE() ")->count(), 'endlaunch' => $this->tsql->table('launch')->where(" l_endtime < CURDATE() ")->count(),
'customer' => $this->tsql->table('customer')->count(), 'customer' => $this->tsql->table('customer')->count(),
// 'workers' => $this->tsql->table('workers')->count(), // 'workers' => $this->tsql->table('workers')->count(),
'summoney' => intval($summoney['tprice']), 'summoney' => intval($summoney['tprice']),
]; ];
} }
} }
?> ?>

View File

@ -834,7 +834,7 @@ class table_theme
if ($this->search_bool) { if ($this->search_bool) {
$this->search['left'][] = self::th_toolmap('地图筛选'); $this->search['left'][] = self::th_toolmap('地图筛选');
$para = [['正常-按照广告位置排序', 0], ['推荐-将适合投放的提前排序', 1], ['选中-将选择中广告位提前排序', 2]]; $para = [['正常-按照广告位置排序', 0], ['推荐-将适合投放的提前排序', 1], ['选中-将选择中广告位提前排序', 2]];
$this->search['left'][] = self::para_select($para, ['eaps_order', '广告位排序',$_M['form']['eaps_order']], true, false); $this->search['left'][] = self::para_select($para, ['eaps_order', '广告位排序', $_M['form']['eaps_order']], true, false);
$tsql = load::own_class('tsql', 'new'); $tsql = load::own_class('tsql', 'new');
$this->select2 = [ $this->select2 = [
'_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']], '_fiend' => ['e_vid', '选择场所', $_M['form']['e_vid']],

View File

@ -7,15 +7,18 @@ defined('IN_MET') or exit('No permission');
/** /**
* 表格数据获取类 * 表格数据获取类
*
* @param array $rearray 表格数组返回数组 * @param array $rearray 表格数组返回数组
*/ */
class tabledata { class tabledata
{
protected $rearray; protected $rearray;
public $error; public $error;
/** /**
* 获取表查询数据 * 获取表查询数据
*
* @param string $table 表名 * @param string $table 表名
* @param string $field 表字段 * @param string $field 表字段
* @param string $where where条件 * @param string $where where条件
@ -23,7 +26,8 @@ class tabledata {
* @param string $sql 自定义SQL语句 * @param string $sql 自定义SQL语句
* @return array 查询数据 * @return array 查询数据
*/ */
public function getdata($table, $field = '*', $where = '', $order = '', $sql = '',$multi_table = false) { public function getdata($table, $field = '*', $where = '', $order = '', $sql = '', $multi_table = false)
{
global $_M; global $_M;
//dump( $_M['form']); //dump( $_M['form']);
/* 获取表格ajax传递的参数 */ /* 获取表格ajax传递的参数 */
@ -64,12 +68,12 @@ class tabledata {
$query = $sql . " LIMIT {$start},{$length}"; $query = $sql . " LIMIT {$start},{$length}";
$array = DB::get_all($query); $array = DB::get_all($query);
$error = DB::error(); $error = DB::error();
$this->error = $error?$query . "<br />" . $error:0; $this->error = $error ? $query . "<br />" . $error : 0;
//总数 //总数
$where = trim($where); $where = trim($where);
if (strtolower(substr($where, 0, 5)) != 'where' && $where) $where = "WHERE " . $where; if (strtolower(substr($where, 0, 5)) != 'where' && $where) $where = "WHERE " . $where;
$countsql = " SELECT COUNT(*) FROM {$table} {$where} "; $countsql = " SELECT COUNT(*) FROM {$table} {$where} ";
if($multi_table) $countsql = " SELECT count(*) FROM ($sql) num "; if ($multi_table) $countsql = " SELECT count(*) FROM ($sql) num ";
$result = DB::query($countsql); $result = DB::query($countsql);
$fetch_row = DB::fetch_row($result); $fetch_row = DB::fetch_row($result);
$total = $fetch_row[0]; $total = $fetch_row[0];
@ -81,21 +85,23 @@ class tabledata {
$this->rarray['recordsTotal'] = $total; //回传总数量 $this->rarray['recordsTotal'] = $total; //回传总数量
$this->rarray['recordsFiltered'] = $total; //回传筛选过的总数量,暂无作用,但必须回传 $this->rarray['recordsFiltered'] = $total; //回传筛选过的总数量,暂无作用,但必须回传
// if(class_exists('admin') || class_exists('app')){ // if(class_exists('admin') || class_exists('app')){
$this->rarray['sql'] = $query; //返回sql语句 $this->rarray['sql'] = $query; //返回sql语句
$this->rarray['array'] = $array; //返回sql语句 $this->rarray['array'] = $array; //返回sql语句
$this->rarray['form'] = $_M['form']; //返回sql语句 $this->rarray['form'] = $_M['form']; //返回sql语句
$this->rarray['sqlse'] = $sql; //返回sql语句 $this->rarray['sqlse'] = $sql; //返回sql语句
$this->rarray['sqltotal'] = $countsql; //返回sql语句 $this->rarray['sqltotal'] = $countsql; //返回sql语句
// } // }
return $array; return $array;
} }
/** /**
* 把处理后的数组已json方式输出到页面上供AJAX读取。 * 把处理后的数组已json方式输出到页面上供AJAX读取。
*
* @param array $rdata 需要转成json的数组 * @param array $rdata 需要转成json的数组
*/ */
public function rdata($rdata) { public function rdata($rdata)
{
if ($rdata) { if ($rdata) {
$this->rarray['data'] = $rdata; $this->rarray['data'] = $rdata;
} else { } else {

View File

@ -3,7 +3,8 @@
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
# 数据结构处理 # 数据结构处理
class tsql { class tsql
{
private $sql = []; private $sql = [];
private $m_name = M_NAME; private $m_name = M_NAME;
@ -12,24 +13,27 @@ class tsql {
private $query; private $query;
private $multi_table = false; //采用分组才会采用子查询计算总数 private $multi_table = false; //采用分组才会采用子查询计算总数
public function __construct() { public function __construct()
{
global $_M; global $_M;
self::table_unset(); self::table_unset();
} }
# 清空 # 清空
public function table_unset() { public function table_unset()
{
global $_M; global $_M;
unset($this->sql, $this->special,$this->ufield); unset($this->sql, $this->special, $this->ufield);
return $this; return $this;
} }
# 数据库 # 数据库
# $sign false 不添加应用文件名前缀 # $sign false 不添加应用文件名前缀
public function table($tname,$sign = true) { public function table($tname, $sign = true)
{
global $_M; global $_M;
self::table_unset(); self::table_unset();
$this->sql['table'] = self::full_table_name($tname,$sign); $this->sql['table'] = self::full_table_name($tname, $sign);
return $this; return $this;
} }
@ -38,89 +42,99 @@ class tsql {
# $join 数据库连接方式 # $join 数据库连接方式
# $sign false 不添加应用文件名前缀 # $sign false 不添加应用文件名前缀
# #
public function tables($tname = [],$join = '',$sign = true) { public function tables($tname = [], $join = '', $sign = true)
{
global $_M; global $_M;
list($name,$ab) = $tname; list($name, $ab) = $tname;
$table = self::full_table_name($name,$sign); $table = self::full_table_name($name, $sign);
$this->sql['table'] .= $table." AS {$ab} {$join} "; $this->sql['table'] .= $table . " AS {$ab} {$join} ";
return $this; return $this;
} }
# 需要特殊处理的值例如counts+1 等类似的 或者执行函数 # 需要特殊处理的值例如counts+1 等类似的 或者执行函数
# 传入的为特殊处理的值,并 非字段名 # 传入的为特殊处理的值,并 非字段名
public function special($_special) { public function special($_special)
{
global $_M; global $_M;
$this->special = is_array($_special)?$_special:[$_special]; $this->special = is_array($_special) ? $_special : [$_special];
return $this; return $this;
} }
# 需要删除的字段,仅支持约束条件下 # 需要删除的字段,仅支持约束条件下
# 目前仅用于adup()时的 unique() 方法 # 目前仅用于adup()时的 unique() 方法
public function ufield($_field = '') { public function ufield($_field = '')
{
global $_M; global $_M;
$this->ufield = is_array($_field)?$_field:[$_field]; $this->ufield = is_array($_field) ? $_field : [$_field];
return $this; return $this;
} }
# 查询字段 # 查询字段
# 查询或者多条插入信息 # 查询或者多条插入信息
public function qfield($_field = '*') { public function qfield($_field = '*')
{
global $_M; global $_M;
if(is_array($_field)) $_field = arrayto_string($_field, ','); if (is_array($_field)) $_field = arrayto_string($_field, ',');
$this->sql['field'] = $_field; $this->sql['field'] = $_field;
return $this; return $this;
} }
# 插入更新字段 # 插入更新字段
# $sign 单条插入或者更新设置其他值查询或者多条插入信息时使用qfield() # $sign 单条插入或者更新设置其他值查询或者多条插入信息时使用qfield()
public function field($_field = '') { public function field($_field = '')
{
global $_M; global $_M;
if(is_array($_field)) $_field = self::field_arr($_field); if (is_array($_field)) $_field = self::field_arr($_field);
$this->sql['field'] = $_field; $this->sql['field'] = $_field;
return $this; return $this;
} }
# 分组查询 $_having 同where 一样 # 分组查询 $_having 同where 一样
public function group($_group = '',$_having = '') { public function group($_group = '', $_having = '')
{
global $_M; global $_M;
if(is_array($_group)) $_group = arrayto_string($_group, ','); if (is_array($_group)) $_group = arrayto_string($_group, ',');
if(!empty($_group)) $this->sql['group'] = " GROUP BY " . $_where; if (!empty($_group)) $this->sql['group'] = " GROUP BY " . $_where;
if($_group){ if ($_group) {
$this->multi_table = true; $this->multi_table = true;
if(is_array($_having)) $_having = self::where_arr($_having); if (is_array($_having)) $_having = self::where_arr($_having);
if(!empty($_having)) $this->sql['group'] .= " HAVING " . $_having; if (!empty($_having)) $this->sql['group'] .= " HAVING " . $_having;
} }
return $this; return $this;
} }
# 查询条件 # 查询条件
public function where($_where = '1=1') { public function where($_where = '1=1')
{
global $_M; global $_M;
if(is_array($_where)) $_where = self::where_arr($_where); if (is_array($_where)) $_where = self::where_arr($_where);
if(!empty($_where)) $this->sql['where'] = " WHERE " . $_where; if (!empty($_where)) $this->sql['where'] = " WHERE " . $_where;
return $this; return $this;
} }
# 排序条件 # 排序条件
public function order($_order = 'id DESC') { public function order($_order = 'id DESC')
{
global $_M; global $_M;
$this->sql['order'] = " ORDER BY " . $_order; $this->sql['order'] = " ORDER BY " . $_order;
return $this; return $this;
} }
# 单独值,用于 多条信息插入,或者约束插入更新 # 单独值,用于 多条信息插入,或者约束插入更新
public function values($_values = '') { public function values($_values = '')
{
global $_M; global $_M;
if(is_array($_values)) $_values = self::values_arr($_values); if (is_array($_values)) $_values = self::values_arr($_values);
$this->sql['values'] = $_values; $this->sql['values'] = $_values;
return $this; return $this;
} }
# 约束条件下的UPDATE # 约束条件下的UPDATE
public function unique($_unique = '') { public function unique($_unique = '')
{
global $_M; global $_M;
if(is_array($_unique)) { if (is_array($_unique)) {
$_unique = self::field_del($_unique); $_unique = self::field_del($_unique);
$_unique = self::unique_arr($_unique); $_unique = self::unique_arr($_unique);
} }
@ -129,17 +143,19 @@ class tsql {
} }
# 查询条数限制 # 查询条数限制
public function limit($_limit = '30',$_start = '0') { public function limit($_limit = '30', $_start = '0')
{
global $_M; global $_M;
$this->sql['limit'] = " LIMIT {$_start}," . $_limit; $this->sql['limit'] = " LIMIT {$_start}," . $_limit;
return $this; return $this;
} }
# 删除 # 删除
public function del($_where) { public function del($_where)
{
global $_M; global $_M;
if(empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if(!empty($_where) && empty($this->sql['where'])) self::where($_where); if (!empty($_where) && empty($this->sql['where'])) self::where($_where);
$this->query = "DELETE FROM {$this->sql['table']} {$this->sql['where']} "; $this->query = "DELETE FROM {$this->sql['table']} {$this->sql['where']} ";
unset($this->sql); unset($this->sql);
DB::query($this->query); DB::query($this->query);
@ -147,9 +163,10 @@ class tsql {
} }
# 单条修改 # 单条修改
public function upd() { public function upd()
{
global $_M; global $_M;
if(empty($this->sql['table']) || empty($this->sql['field'])) return false; if (empty($this->sql['table']) || empty($this->sql['field'])) return false;
$this->query = "UPDATE {$this->sql['table']} SET {$this->sql['field']} {$this->sql['where']} "; $this->query = "UPDATE {$this->sql['table']} SET {$this->sql['field']} {$this->sql['where']} ";
unset($this->sql); unset($this->sql);
DB::query($this->query); DB::query($this->query);
@ -157,10 +174,11 @@ class tsql {
} }
# 单条新增 # 单条新增
public function add($_field) { public function add($_field)
{
global $_M; global $_M;
if(!empty($_field) && empty($this->sql['field'])) self::field($_field); if (!empty($_field) && empty($this->sql['field'])) self::field($_field);
if(empty($this->sql['table']) || empty($this->sql['field'])) return false; if (empty($this->sql['table']) || empty($this->sql['field'])) return false;
$this->query = "INSERT INTO {$this->sql['table']} SET {$this->sql['field']} "; $this->query = "INSERT INTO {$this->sql['table']} SET {$this->sql['field']} ";
unset($this->sql); unset($this->sql);
DB::query($this->query); DB::query($this->query);
@ -171,21 +189,22 @@ class tsql {
# field 字段需要查询类型的 qfield() # field 字段需要查询类型的 qfield()
# $data 一维二维都可以key = field # $data 一维二维都可以key = field
# $sign false 并且也没有单独调用unique()是多条信息插入, true 为是约束更新插入 # $sign false 并且也没有单独调用unique()是多条信息插入, true 为是约束更新插入
public function adup($data = [],$sign = true) { public function adup($data = [], $sign = true)
{
global $_M; global $_M;
if(empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if(is_array($data)){ if (is_array($data)) {
$arr = array_level($data) == 1?$data:reset($data); $arr = array_level($data) == 1 ? $data : reset($data);
$qfield = array_keys($arr); $qfield = array_keys($arr);
if(empty($this->sql['field'])) self::qfield($qfield); if (empty($this->sql['field'])) self::qfield($qfield);
if(empty($this->sql['values'])) self::values($data); if (empty($this->sql['values'])) self::values($data);
if($sign == true && empty($this->sql['unique'])) { if ($sign == true && empty($this->sql['unique'])) {
$unique = []; $unique = [];
$arr = self::field_del($arr); $arr = self::field_del($arr);
foreach ($arr as $key => $val) { foreach ($arr as $key => $val) {
if(in_array($val, $this->special,true)){ if (in_array($val, $this->special, true)) {
$unique[$key] = $val; $unique[ $key ] = $val;
}else{ } else {
$unique[] = $key; $unique[] = $key;
} }
} }
@ -199,39 +218,42 @@ class tsql {
} }
# 查询单条 # 查询单条
public function one() { public function one()
{
global $_M; global $_M;
if(empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if(empty($this->sql['field'])) $this->sql['field'] = '*'; if (empty($this->sql['field'])) $this->sql['field'] = '*';
$this->query = "SELECT {$this->sql['field']} FROM {$this->sql['table']} {$this->sql['where']} {$this->sql['group']} {$this->sql['order']} {$this->sql['limit']} "; $this->query = "SELECT {$this->sql['field']} FROM {$this->sql['table']} {$this->sql['where']} {$this->sql['group']} {$this->sql['order']} {$this->sql['limit']} ";
unset($this->sql); unset($this->sql);
return DB::get_one($this->query); return DB::get_one($this->query);
} }
# 查询更多条数 # 查询更多条数
public function all($key = 'id') { public function all($key = 'id')
{
global $_M; global $_M;
if(empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if(empty($this->sql['field'])) $this->sql['field'] = '*'; if (empty($this->sql['field'])) $this->sql['field'] = '*';
$this->query = "SELECT {$this->sql['field']} FROM {$this->sql['table']} {$this->sql['where']} {$this->sql['group']} {$this->sql['order']} {$this->sql['limit']} "; $this->query = "SELECT {$this->sql['field']} FROM {$this->sql['table']} {$this->sql['where']} {$this->sql['group']} {$this->sql['order']} {$this->sql['limit']} ";
unset($this->sql); unset($this->sql);
$res = []; $res = [];
$result = DB::query($this->query); $result = DB::query($this->query);
while ($val = DB::fetch_array($result)) { while ($val = DB::fetch_array($result)) {
$res[$val[$key]] = $val; $res[ $val[ $key ] ] = $val;
} }
return $res; return $res;
} }
# 获取表结构 # 获取表结构
public function show() { public function show()
{
global $_M; global $_M;
if(empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
$this->query = "SHOW FULL COLUMNS FROM .{$this->sql['table']}"; $this->query = "SHOW FULL COLUMNS FROM .{$this->sql['table']}";
unset($this->sql); unset($this->sql);
$res = []; $res = [];
$rescolumns = DB::query($this->query) ; $rescolumns = DB::query($this->query);
while($row = DB::fetch_array($rescolumns)){ while ($row = DB::fetch_array($rescolumns)) {
$res[] = $row; $res[] = $row;
} }
return $res; return $res;
@ -240,70 +262,76 @@ class tsql {
# 条数统计 # 条数统计
# field 采用查询方法 qfield # field 采用查询方法 qfield
# $multi_table 若是采用分组了计算方式要调整为 子查询计算总条数 # $multi_table 若是采用分组了计算方式要调整为 子查询计算总条数
public function count($_field = '*') { public function count($_field = '*')
{
global $_M; global $_M;
if(empty($this->sql['table'])) return 0; if (empty($this->sql['table'])) return 0;
if(empty($this->sql['field'])) $this->sql['field'] = "COUNT({$_field})"; if (empty($this->sql['field'])) $this->sql['field'] = "COUNT({$_field})";
$this->query = " SELECT {$this->sql['field']} FROM {$this->sql['table']} {$this->sql['where']} "; $this->query = " SELECT {$this->sql['field']} FROM {$this->sql['table']} {$this->sql['where']} ";
if($this->multi_table) $this->query = " SELECT count(*) FROM ($this->query) num "; if ($this->multi_table) $this->query = " SELECT count(*) FROM ($this->query) num ";
$result = DB::query($this->query); $result = DB::query($this->query);
$fetch_row = DB::fetch_row($result); $fetch_row = DB::fetch_row($result);
return $fetch_row[0]; return $fetch_row[0];
} }
# 获取刚才插入的信息ID # 获取刚才插入的信息ID
public function id() { public function id()
{
global $_M; global $_M;
return DB::insert_id(); return DB::insert_id();
} }
# 错误信息(对查询是无效的) # 错误信息(对查询是无效的)
public function error() { public function error()
{
global $_M; global $_M;
return DB::error(); return DB::error();
} }
# 返回完整数据库名 # 返回完整数据库名
public function full_table_name($tname,$sign = true) { public function full_table_name($tname, $sign = true)
{
global $_M; global $_M;
return $sign == true?$_M['table'][$this->m_name.'_'.$tname]:$_M['table'][$tname]; return $sign == true ? $_M['table'][ $this->m_name . '_' . $tname ] : $_M['table'][ $tname ];
} }
# 字段删除方法 # 字段删除方法
public function field_del($array = []) { public function field_del($array = [])
{
global $_M; global $_M;
foreach ($this->ufield as $val) { foreach ($this->ufield as $val) {
unset($array[$val]); unset($array[ $val ]);
} }
return $array; return $array;
} }
# where条件的转换 # where条件的转换
# 仅是值等于的处理,例如某个字段判断为不等于或者其他的方法,切勿使用数组传递 # 仅是值等于的处理,例如某个字段判断为不等于或者其他的方法,切勿使用数组传递
public function where_arr($arr) { public function where_arr($arr)
{
global $_M; global $_M;
$and = []; $and = [];
foreach ($arr as $key => $val) { foreach ($arr as $key => $val) {
// 函数的使用 数字键名采用函数模式 // 函数的使用 数字键名采用函数模式
if(is_numeric($key)) { if (is_numeric($key)) {
$and[] = $val; $and[] = $val;
continue; continue;
} }
// 仅是值等于的处理 // 仅是值等于的处理
if(is_array($val)){ if (is_array($val)) {
$or = []; $or = [];
foreach ($val as $ky => $kv) { foreach ($val as $ky => $kv) {
$or[] = " {$key} = '{$kv}' "; $or[] = " {$key} = '{$kv}' ";
// 函数的使用,非数字则采用函数模式 // 函数的使用,非数字则采用函数模式
if(!is_numeric($ky)) { if (!is_numeric($ky)) {
$or[] = $val; $or[] = $val;
continue; continue;
} }
} }
$orstr = arrayto_string($or, ' OR '); $orstr = arrayto_string($or, ' OR ');
$and[] = " ({$orstr}) "; $and[] = " ({$orstr}) ";
}else{ } else {
$and[] = " {$key} = '{$val}' "; $and[] = " {$key} = '{$val}' ";
} }
} }
@ -311,14 +339,15 @@ class tsql {
} }
# 入库字段转换 # 入库字段转换
public function field_arr($arr) { public function field_arr($arr)
{
global $_M; global $_M;
$str = []; $str = [];
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
if (strstr($v, "'")) $v = str_replace("'", "\'", $v); if (strstr($v, "'")) $v = str_replace("'", "\'", $v);
if(in_array($v, $this->special,true)){ if (in_array($v, $this->special, true)) {
$str[] = " {$k} = {$v} "; $str[] = " {$k} = {$v} ";
}else{ } else {
$str[] = " {$k} = '{$v}' "; $str[] = " {$k} = '{$v}' ";
} }
} }
@ -326,33 +355,35 @@ class tsql {
} }
# 单独值的字符串转换 # 单独值的字符串转换
public function values_arr($arr) { public function values_arr($arr)
{
global $_M; global $_M;
$str = []; $str = [];
foreach ($arr as $val) { foreach ($arr as $val) {
if(is_array($val)){ if (is_array($val)) {
$str[] = self::values_arr($val); $str[] = self::values_arr($val);
}else{ } else {
if(in_array($val, $this->special,true)){ if (in_array($val, $this->special, true)) {
$str[] = " $val "; $str[] = " $val ";
}else{ } else {
$str[] = " '$val' "; $str[] = " '$val' ";
} }
} }
} }
$arrtostr = arrayto_string($str, ','); $arrtostr = arrayto_string($str, ',');
return array_level($arr) == 1?"({$arrtostr})":$arrtostr; return array_level($arr) == 1 ? "({$arrtostr})" : $arrtostr;
} }
# 约束条件新增的语句更新值的规则(最后一段) # 约束条件新增的语句更新值的规则(最后一段)
# 数组key值为字段名非数字 说明是要单独处理的值 # 数组key值为字段名非数字 说明是要单独处理的值
public function unique_arr($arr) { public function unique_arr($arr)
{
global $_M; global $_M;
$str = []; $str = [];
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
if(is_numeric($k)){ if (is_numeric($k)) {
$str[] = " $v = VALUES($v) "; $str[] = " $v = VALUES($v) ";
}else{ } else {
$str[] = " $k = $v "; $str[] = " $k = $v ";
} }
} }
@ -360,23 +391,25 @@ class tsql {
} }
# 通过数据库整理出该数据库的字段一般是净化form提交的字段避免一个一个组装 # 通过数据库整理出该数据库的字段一般是净化form提交的字段避免一个一个组装
public function tfield($form,$tablename = '') { public function tfield($form, $tablename = '')
{
global $_M; global $_M;
if(!empty($tablename)){ if (!empty($tablename)) {
if(is_array($tablename)) $tablename = [$tablename,true]; if (is_array($tablename)) $tablename = [$tablename, true];
list($name,$sign) = array_values($tablename); list($name, $sign) = array_values($tablename);
self::table($name,$sign); self::table($name, $sign);
} }
$karr = DB::get_all("DESC {$this->sql['table']}"); $karr = DB::get_all("DESC {$this->sql['table']}");
foreach ($karr as $v) { foreach ($karr as $v) {
$arr[$v['Field']] = $v['Field']; $arr[ $v['Field'] ] = $v['Field'];
} }
#根据数据库字段提炼 #根据数据库字段提炼
return array_intersect_key($form, $arr); return array_intersect_key($form, $arr);
} }
# 查看刚才执行过的sql语句方便核查sql语句 # 查看刚才执行过的sql语句方便核查sql语句
public function query() { public function query()
{
global $_M; global $_M;
return $this->query; return $this->query;
} }

View File

@ -2,17 +2,18 @@
//兼容函数array_column PHP5.5+ //兼容函数array_column PHP5.5+
if (!function_exists('array_column')) { if (!function_exists('array_column')) {
function array_column($input, $columnKey, $indexKey = NULL) { function array_column($input, $columnKey, $indexKey = NULL)
{
$columnKeyIsNumber = (is_numeric($columnKey)) ? TRUE : FALSE; $columnKeyIsNumber = (is_numeric($columnKey)) ? TRUE : FALSE;
$indexKeyIsNull = (is_null($indexKey)) ? TRUE : FALSE; $indexKeyIsNull = (is_null($indexKey)) ? TRUE : FALSE;
$indexKeyIsNumber = (is_numeric($indexKey)) ? TRUE : FALSE; $indexKeyIsNumber = (is_numeric($indexKey)) ? TRUE : FALSE;
$result = array(); $result = array();
foreach ((array) $input AS $key => $row) { foreach ((array)$input as $key => $row) {
if ($columnKeyIsNumber) { if ($columnKeyIsNumber) {
$tmp = array_slice($row, $columnKey, 1); $tmp = array_slice($row, $columnKey, 1);
$tmp = (is_array($tmp) && !empty($tmp)) ? current($tmp) : NULL; $tmp = (is_array($tmp) && !empty($tmp)) ? current($tmp) : NULL;
} else { } else {
$tmp = isset($row[$columnKey]) ? $row[$columnKey] : NULL; $tmp = isset($row[ $columnKey ]) ? $row[ $columnKey ] : NULL;
} }
if (!$indexKeyIsNull) { if (!$indexKeyIsNull) {
if ($indexKeyIsNumber) { if ($indexKeyIsNumber) {
@ -20,10 +21,10 @@ if (!function_exists('array_column')) {
$key = (is_array($key) && !empty($key)) ? current($key) : NULL; $key = (is_array($key) && !empty($key)) ? current($key) : NULL;
$key = is_null($key) ? 0 : $key; $key = is_null($key) ? 0 : $key;
} else { } else {
$key = isset($row[$indexKey]) ? $row[$indexKey] : 0; $key = isset($row[ $indexKey ]) ? $row[ $indexKey ] : 0;
} }
} }
$result[$key] = $tmp; $result[ $key ] = $tmp;
} }
return $result; return $result;
} }
@ -32,7 +33,8 @@ if (!function_exists('array_column')) {
# 计算时间差 # 计算时间差
# $begin_time 起始日期 # $begin_time 起始日期
# $end_time 结束日期 一般指当前日期 # $end_time 结束日期 一般指当前日期
function timediff($begin_time, $end_time,$type) { function timediff($begin_time, $end_time, $type)
{
$time = $end_time - $begin_time; $time = $end_time - $begin_time;
switch ($type) { switch ($type) {
case 'year': case 'year':
@ -74,13 +76,13 @@ function timediff($begin_time, $end_time,$type) {
//总的秒数 //总的秒数
$second = $time; $second = $time;
$timestr = [ $timestr = [
'year' =>$year, //总的年 'year' => $year, //总的年
'month'=>$month, //总的月 'month' => $month, //总的月
'week'=>$week, //总的周 'week' => $week, //总的周
'day'=>$day, //总的天数 'day' => $day, //总的天数
'hour'=>$hour, //总的小时 'hour' => $hour, //总的小时
'min'=>$minute, //总的分钟数 'min' => $minute, //总的分钟数
'sec'=>$second //总的秒数 'sec' => $second //总的秒数
]; ];
break; break;
} }
@ -88,7 +90,8 @@ function timediff($begin_time, $end_time,$type) {
} }
//获取汉子的首字母 //获取汉子的首字母
function getstrcharter($str) { function getstrcharter($str)
{
global $_M, $_YW; global $_M, $_YW;
if (empty($str)) return ''; if (empty($str)) return '';
$fchar = ord($str{0}); $fchar = ord($str{0});

View File

@ -4,7 +4,8 @@
* 表格数据显示,以及数据导出公用处理方案 * 表格数据显示,以及数据导出公用处理方案
*/ */
trait tdata { trait tdata
{
//sql语句采用分组查询后调整为true 使用子查询计算总条数 //sql语句采用分组查询后调整为true 使用子查询计算总条数
public $multi_table = false; public $multi_table = false;
@ -24,31 +25,34 @@ trait tdata {
private $village_whereid = ''; private $village_whereid = '';
// 计算社区类型地图选择返回被选中的小区ID // 计算社区类型地图选择返回被选中的小区ID
private function fun_sqlk_vid(){ private function fun_sqlk_vid()
{
global $_M, $_YW; global $_M, $_YW;
$idArr = $vidArr = []; $idArr = $vidArr = [];
if (is_array($this->form['vtype'])) { if (is_array($this->form['vtype'])) {
$vtype = arrayto_string($this->form['vtype'],','); $vtype = arrayto_string($this->form['vtype'], ',');
$vid = $this->tsql->table('village')->qfield('id')->where("v_type IN({$vtype})")->all(); $vid = $this->tsql->table('village')->qfield('id')->where("v_type IN({$vtype})")->all();
$idArr = array_column($vid,'id'); $idArr = array_column($vid, 'id');
if(count($idArr) == 0) $idArr = [-1]; if (count($idArr) == 0) $idArr = [-1];
} }
if($this->form['v_id']){ if ($this->form['v_id']) {
$vidArr = stringto_array($this->form['v_id'],','); $vidArr = stringto_array($this->form['v_id'], ',');
// 取社区类型和地图筛选的交集重叠ID社区类型没有操作则直接按照地图筛选结果 // 取社区类型和地图筛选的交集重叠ID社区类型没有操作则直接按照地图筛选结果
// $idArr = count($idArr) > 0?array_intersect($vidArr,$idArr):$vidArr; // $idArr = count($idArr) > 0?array_intersect($vidArr,$idArr):$vidArr;
if(count($idArr) > 0){ if (count($idArr) > 0) {
$idArr = array_intersect($vidArr,$idArr); $idArr = array_intersect($vidArr, $idArr);
// 如果交集为空则确实通过此条件进行了筛选就要通知SQL没有任何值满足当前条件将ID设置为0肯定查找不到 // 如果交集为空则确实通过此条件进行了筛选就要通知SQL没有任何值满足当前条件将ID设置为0肯定查找不到
if(count($idArr) == 0) $idArr = [-1]; if (count($idArr) == 0) $idArr = [-1];
}else{ } else {
$idArr = $vidArr; $idArr = $vidArr;
} }
} }
return $idArr; return $idArr;
} }
//表名 //表名
public function td_sqlk() { public function td_sqlk()
{
global $_M, $_YW; global $_M, $_YW;
//当天日期时间 //当天日期时间
$curdate = date('Y-m-d', time()); $curdate = date('Y-m-d', time());
@ -66,15 +70,15 @@ trait tdata {
} }
// 根据小区单个ID // 根据小区单个ID
if($this->form['e_vid']){ if ($this->form['e_vid']) {
$ason .= " nel.e_vid = '{$this->form['e_vid']}' AND "; $ason .= " nel.e_vid = '{$this->form['e_vid']}' AND ";
} }
// 社区类型 不考虑导出 // 社区类型 不考虑导出
$idArr = self::fun_sqlk_vid(); $idArr = self::fun_sqlk_vid();
// 通过ID筛选掉不需要的 // 通过ID筛选掉不需要的
if(count($idArr) > 0){ if (count($idArr) > 0) {
$this->village_whereid = arrayto_string(array_unique($idArr),','); $this->village_whereid = arrayto_string(array_unique($idArr), ',');
$ason .= " nel.e_vid IN({$this->village_whereid}) AND "; $ason .= " nel.e_vid IN({$this->village_whereid}) AND ";
} }
@ -128,8 +132,8 @@ trait tdata {
if (isset($this->form['jsadd_vtype'])) $this->form['vtype'] = stringto_array($this->form['jsadd_vtype'], ','); if (isset($this->form['jsadd_vtype'])) $this->form['vtype'] = stringto_array($this->form['jsadd_vtype'], ',');
$idArr = self::fun_sqlk_vid(); $idArr = self::fun_sqlk_vid();
// 通过ID筛选掉不需要的 // 通过ID筛选掉不需要的
if(count($idArr) > 0){ if (count($idArr) > 0) {
$this->village_whereid = arrayto_string(array_unique($idArr),','); $this->village_whereid = arrayto_string(array_unique($idArr), ',');
$son .= " el.e_vid IN({$this->village_whereid}) AND "; $son .= " el.e_vid IN({$this->village_whereid}) AND ";
} }
@ -140,11 +144,11 @@ trait tdata {
//空置 //空置
$fwhere = " {$son} NOT EXISTS (SELECT ela.e_number FROM {$_YW['k']['countela']} AS ela WHERE NOT ( ela.l_endtime < '{$vs_starttime}' OR ela.l_starttime > '{$vs_endtime}' ) AND ela.e_number = el.e_number) AND ( (el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}' ) OR el.l_id IS NULL ) AND el.e_enable = 1 "; $fwhere = " {$son} NOT EXISTS (SELECT ela.e_number FROM {$_YW['k']['countela']} AS ela WHERE NOT ( ela.l_endtime < '{$vs_starttime}' OR ela.l_starttime > '{$vs_endtime}' ) AND ela.e_number = el.e_number) AND ( (el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}' ) OR el.l_id IS NULL ) AND el.e_enable = 1 ";
// 之前的旧代码 // 之前的旧代码
// $fwhere = " {$son} NOT EXISTS (SELECT ela.e_number FROM {$_YW['k']['countela']} AS ela WHERE NOT ( ela.l_endtime < '{$vs_starttime}' OR ela.l_starttime > '{$vs_endtime}' ) AND NOT(ela.l_endtime < '{$curdate}' OR ela.l_starttime > '{$curdate}' ) AND ela.e_number = el.e_number) AND ( ((el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') AND el.l_endtime < '{$curdate}' ) OR el.l_id IS NULL ) AND el.e_enable = 1 "; // $fwhere = " {$son} NOT EXISTS (SELECT ela.e_number FROM {$_YW['k']['countela']} AS ela WHERE NOT ( ela.l_endtime < '{$vs_starttime}' OR ela.l_starttime > '{$vs_endtime}' ) AND NOT(ela.l_endtime < '{$curdate}' OR ela.l_starttime > '{$curdate}' ) AND ela.e_number = el.e_number) AND ( ((el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') AND el.l_endtime < '{$curdate}' ) OR el.l_id IS NULL ) AND el.e_enable = 1 ";
//排期中的 //排期中的
$lwhere = " {$son} NOT(el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') "; $lwhere = " {$son} NOT(el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') ";
// 之前的旧代码 // 之前的旧代码
// $lwhere = " {$son} NOT(el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') AND NOT(el.l_endtime < '{$curdate}' OR el.l_starttime > '{$curdate}' ) "; // $lwhere = " {$son} NOT(el.l_endtime < '{$vs_starttime}' OR el.l_starttime > '{$vs_endtime}') AND NOT(el.l_endtime < '{$curdate}' OR el.l_starttime > '{$curdate}' ) ";
//多少天到期的 //多少天到期的
$dwhere = " {$son} el.l_endtime BETWEEN '{$vs_starttime}' AND '{$vs_endtime}' "; $dwhere = " {$son} el.l_endtime BETWEEN '{$vs_starttime}' AND '{$vs_endtime}' ";
//预排 //预排
@ -179,14 +183,15 @@ trait tdata {
break; break;
default: default:
$sqlk = $_YW['k'][$this->tname]; $sqlk = $_YW['k'][ $this->tname ];
break; break;
} }
return $sqlk; return $sqlk;
} }
//字段 //字段
public function td_field() { public function td_field()
{
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'elevators': case 'elevators':
@ -220,7 +225,8 @@ trait tdata {
* 同时满足条件的非OR * 同时满足条件的非OR
*/ */
public function td_search($link = true) { public function td_search($link = true)
{
global $_M, $_YW; global $_M, $_YW;
//默认input字段为link搜索 //默认input字段为link搜索
if ($link) if ($link)
@ -233,9 +239,9 @@ trait tdata {
//相对独立的搜索 //相对独立的搜索
$arrwhere = []; $arrwhere = [];
foreach ($field as $val) { foreach ($field as $val) {
$search = trim(strtoupper($this->form[$val])); $search = trim(strtoupper($this->form[ $val ]));
if (strlen($search) > 0) { if (strlen($search) > 0) {
$str = $join_field[$val]; $str = $join_field[ $val ];
if (in_array($val, $this->search_link)) { if (in_array($val, $this->search_link)) {
$arrwhere[] = " {$str} LIKE '%{$search}%' "; $arrwhere[] = " {$str} LIKE '%{$search}%' ";
continue; continue;
@ -254,16 +260,17 @@ trait tdata {
} }
//OR 内容搜索 //OR 内容搜索
public function td_search_or($orfield, $search_field = []) { public function td_search_or($orfield, $search_field = [])
{
global $_M, $_YW; 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 = []; $arrwhere = [];
foreach ($orfield as $val) { foreach ($orfield as $val) {
$search = trim(strtoupper($this->form[$val])); $search = trim(strtoupper($this->form[ $val ]));
if (strlen($search) > 0) { if (strlen($search) > 0) {
$str = $join_field[$val]; $str = $join_field[ $val ];
if (in_array($val, $this->search_link)) { if (in_array($val, $this->search_link)) {
$arrwhere[] = " {$str} LIKE '%{$search}%' "; $arrwhere[] = " {$str} LIKE '%{$search}%' ";
continue; continue;
@ -281,7 +288,8 @@ trait tdata {
} }
//时间区间 //时间区间
public function td_time_search($field, $search_field = []) { public function td_time_search($field, $search_field = [])
{
global $_M, $_YW; global $_M, $_YW;
list($start, $end) = $field; list($start, $end) = $field;
//判断是否为链表查询 //判断是否为链表查询
@ -289,9 +297,9 @@ trait tdata {
//相对独立的搜索 //相对独立的搜索
$arrwhere = []; $arrwhere = [];
foreach ($field as $val) { foreach ($field as $val) {
$search = trim(strtoupper($this->form[$val])); $search = trim(strtoupper($this->form[ $val ]));
if (strlen($search) > 0) { if (strlen($search) > 0) {
$str = $join_field[$val]; $str = $join_field[ $val ];
if ($val == $start) { if ($val == $start) {
$arrwhere[] = " {$str} >= '{$search}' "; $arrwhere[] = " {$str} >= '{$search}' ";
} else { } else {
@ -310,7 +318,8 @@ trait tdata {
//获取重叠的时间区间 //获取重叠的时间区间
// $search_field 开始时间和结束时间的字段互相调换,结束的字段在前面 // $search_field 开始时间和结束时间的字段互相调换,结束的字段在前面
public function td_time_orsearch($field, $search_field = []) { public function td_time_orsearch($field, $search_field = [])
{
global $_M, $_YW; global $_M, $_YW;
list($start, $end) = $field; list($start, $end) = $field;
//判断是否为链表查询 //判断是否为链表查询
@ -318,9 +327,9 @@ trait tdata {
//相对独立的搜索 //相对独立的搜索
$arrwhere = []; $arrwhere = [];
foreach ($field as $val) { foreach ($field as $val) {
$search = trim(strtoupper($this->form[$val])); $search = trim(strtoupper($this->form[ $val ]));
if (strlen($search) > 0) { if (strlen($search) > 0) {
$str = $join_field[$val]; $str = $join_field[ $val ];
if ($val == $start) { if ($val == $start) {
$arrwhere[] = " {$str} < '{$search}' "; //结束字段,搜索为开始时间 $arrwhere[] = " {$str} < '{$search}' "; //结束字段,搜索为开始时间
} else { } else {
@ -342,7 +351,8 @@ trait tdata {
* SQL判断语句$where .= $this->search(); * SQL判断语句$where .= $this->search();
*/ */
public function td_where() { public function td_where()
{
global $_M, $_YW; global $_M, $_YW;
$where = " 1=1 "; $where = " 1=1 ";
switch ($this->tname) { switch ($this->tname) {
@ -469,7 +479,8 @@ trait tdata {
} }
//分组查询 //分组查询
public function td_groupby(&$where) { public function td_groupby(&$where)
{
global $_M; global $_M;
$this->multi_table = true; $this->multi_table = true;
switch ($this->tname) { switch ($this->tname) {
@ -501,7 +512,8 @@ trait tdata {
* SQL排序方式语句 * SQL排序方式语句
*/ */
public function td_order() { public function td_order()
{
global $_M; global $_M;
switch ($this->tname) { switch ($this->tname) {
case 'applan': case 'applan':

View File

@ -4,7 +4,8 @@
* 表格列表的结果处理 * 表格列表的结果处理
*/ */
trait tlist { trait tlist
{
//按钮组 //按钮组
protected $btn = []; protected $btn = [];
@ -23,7 +24,8 @@ trait tlist {
//公用删除 //公用删除
//$query 主要用来替换删除按钮的值 //$query 主要用来替换删除按钮的值
protected function btn_group($val, $checked, $query = []) { protected function btn_group($val, $checked, $query = [])
{
global $_M, $_YW; global $_M, $_YW;
if (empty($checked)) { if (empty($checked)) {
if ($query !== false) { if ($query !== false) {
@ -54,28 +56,29 @@ trait tlist {
$btnstr = arrayto_string($this->btn, ''); $btnstr = arrayto_string($this->btn, '');
unset($this->btn); unset($this->btn);
// 普通按钮组合 // 普通按钮组合
$btngroup = '<div class="btn-group" role="group" >'.$btnstr.'</div>'; $btngroup = '<div class="btn-group" role="group" >' . $btnstr . '</div>';
// 下拉方式的组合按钮组 // 下拉方式的组合按钮组
$btngrouptoggle = '<div class="btn-group" role="group"> $btngrouptoggle = '<div class="btn-group" role="group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
'.$this->btn_group_toggle.' ' . $this->btn_group_toggle . '
</button> </button>
<div class="dropdown-menu btn-group-toggle-menu">'.$btnstr.'</div> <div class="dropdown-menu btn-group-toggle-menu">' . $btnstr . '</div>
</div>'; </div>';
return $this->btn_group_toggle?$btngrouptoggle:$btngroup; return $this->btn_group_toggle ? $btngrouptoggle : $btngroup;
} }
} }
//整合 //整合
private function assemble($key, $base, $val, $checked, $query = []) { private function assemble($key, $base, $val, $checked, $query = [])
{
global $_M, $_YW; global $_M, $_YW;
//搜索处理 //搜索处理
foreach ($this->search_input as $vs) { foreach ($this->search_input as $vs) {
if (in_array($vs, $this->skip_field, true)) if (in_array($vs, $this->skip_field, true))
continue; continue;
$search = trim(strtoupper($this->form[$vs])); $search = trim(strtoupper($this->form[ $vs ]));
if ($search != null) if ($search != null)
$val[$vs] = str_ireplace($search, '<font color="#FF0000">' . $search . '</font>', $val[$vs]); $val[ $vs ] = str_ireplace($search, '<font color="#FF0000">' . $search . '</font>', $val[ $vs ]);
} }
//按钮组处理 //按钮组处理
$operation = []; $operation = [];
@ -86,7 +89,8 @@ trait tlist {
} }
//广告位详细地址转换 //广告位详细地址转换
protected function eaddress(&$val, $_address = 'e_address', $sign = false) { protected function eaddress(&$val, $_address = 'e_address', $sign = false)
{
global $_M, $_YW; global $_M, $_YW;
//门口方位 //门口方位
if (empty(self::$para['e_bno'])) if (empty(self::$para['e_bno']))
@ -95,28 +99,29 @@ trait tlist {
if (empty(self::$para['e_aps'])) if (empty(self::$para['e_aps']))
self::$para['e_aps'] = parent::translate(); self::$para['e_aps'] = parent::translate();
//场所 //场所
if (empty(self::$village[$val['e_vid']])) if (empty(self::$village[ $val['e_vid'] ]))
self::$village[$val['e_vid']] = parent::villagelist($val['e_vid']); self::$village[ $val['e_vid'] ] = parent::villagelist($val['e_vid']);
if ($sign) { if ($sign) {
$val['e_vid'] = self::$village[$val['e_vid']]; $val['e_vid'] = self::$village[ $val['e_vid'] ];
$val['e_bno'] = self::$para['e_bno'][$val['e_bno']]; $val['e_bno'] = self::$para['e_bno'][ $val['e_bno'] ];
$val['e_aps'] = self::$para['e_aps'][$val['e_aps']]; $val['e_aps'] = self::$para['e_aps'][ $val['e_aps'] ];
} else { } else {
$villages = [ $villages = [
self::$village[$val['e_vid']], self::$village[ $val['e_vid'] ],
self::$para['e_bno'][$val['e_bno']], self::$para['e_bno'][ $val['e_bno'] ],
self::$para['e_aps'][$val['e_aps']] self::$para['e_aps'][ $val['e_aps'] ]
]; ];
$val[$_address] = arrayto_string($villages, ' '); $val[ $_address ] = arrayto_string($villages, ' ');
} }
} }
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 各表处理 // | 各表处理
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
//广告位统计 //广告位统计
protected function elevator($val, $checked = '') { protected function elevator($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_elevator(); $key = self::tf_elevator();
@ -134,17 +139,17 @@ trait tlist {
if (empty(self::$para['e_aps'])) if (empty(self::$para['e_aps']))
self::$para['e_aps'] = parent::translate(); self::$para['e_aps'] = parent::translate();
//场所 //场所
if (empty(self::$village[$val['e_vid']])) if (empty(self::$village[ $val['e_vid'] ]))
self::$village[$val['e_vid']] = parent::villagelist($val['e_vid']); self::$village[ $val['e_vid'] ] = parent::villagelist($val['e_vid']);
$scheduleurl = $this->own_name_table . 'elevators&e_number=' . $val['e_number']; $scheduleurl = $this->own_name_table . 'elevators&e_number=' . $val['e_number'];
$val['e_number'] = '<a href="' . $scheduleurl . '"> ' . $val['e_number'] . '</a>'; $val['e_number'] = '<a href="' . $scheduleurl . '"> ' . $val['e_number'] . '</a>';
$val['e_enable'] = parent::type_onoff('e_enable', $val['e_enable'], $val['id'], ['禁用', '启用']); $val['e_enable'] = parent::type_onoff('e_enable', $val['e_enable'], $val['id'], ['禁用', '启用']);
$val['e_vid'] = self::$village[$val['e_vid']]; $val['e_vid'] = self::$village[ $val['e_vid'] ];
$val['e_bno'] = self::$para['e_bno'][$val['e_bno']]; $val['e_bno'] = self::$para['e_bno'][ $val['e_bno'] ];
$val['e_aps'] = self::$para['e_aps'][$val['e_aps']]; $val['e_aps'] = self::$para['e_aps'][ $val['e_aps'] ];
$val['e_state'] = parent::e_state(); $val['e_state'] = parent::e_state();
$val['e_label'] = parent::tab_tokenfield($val['e_label'], 2); $val['e_label'] = parent::tab_tokenfield($val['e_label'], 2);
@ -159,7 +164,8 @@ trait tlist {
} }
//场所统计 //场所统计
protected function village($val, $checked = '') { protected function village($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_village(); $key = self::tf_village();
@ -178,13 +184,13 @@ trait tlist {
$totalstr = arrayto_string([$val['total'], $val['noban'], $val['normal']], ' / '); $totalstr = arrayto_string([$val['total'], $val['noban'], $val['normal']], ' / ');
$val['v_name'] = '<a href="' . $vnameurl . '"> ' . $val['v_name'] . '</a>'; $val['v_name'] = '<a href="' . $vnameurl . '"> ' . $val['v_name'] . '</a>';
$val['v_type'] = self::$para['v_type'][$val['v_type']]; $val['v_type'] = self::$para['v_type'][ $val['v_type'] ];
$val['v_tel'] = parent::tab_tokenfield($val['v_tel'], 1); $val['v_tel'] = parent::tab_tokenfield($val['v_tel'], 1);
$val['v_address'] = $val['v_province'] . $val['v_city'] . $val['v_district'] . $val['v_address']; $val['v_address'] = $val['v_province'] . $val['v_city'] . $val['v_district'] . $val['v_address'];
$val['v_forbidtype'] = parent::tab_tokenfield($val['v_forbidtype'], 2); $val['v_forbidtype'] = parent::tab_tokenfield($val['v_forbidtype'], 2);
$val['v_totalstr'] = $val['noban'] > 0 ? parent::str_color(0, $totalstr, 600) : $totalstr; $val['v_totalstr'] = $val['noban'] > 0 ? parent::str_color(0, $totalstr, 600) : $totalstr;
$val['v_lnglat'] = $val['v_maplng'].$val['v_maplat']; $val['v_lnglat'] = $val['v_maplng'] . $val['v_maplat'];
//执行操作按钮 //执行操作按钮
if (empty($checked)) { if (empty($checked)) {
@ -198,28 +204,30 @@ trait tlist {
} }
//广告合同关联表 //广告合同关联表
protected function schedule($val, $checked = '', $base = []) { protected function schedule($val, $checked = '', $base = [])
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_schedule(); $key = self::tf_schedule();
//对字段处理 //对字段处理
//公司名称 //公司名称
if (empty(self::$customer[$val['h_cid']])) if (empty(self::$customer[ $val['h_cid'] ]))
self::$customer[$val['h_cid']] = parent::customerlist($val['h_cid']); self::$customer[ $val['h_cid'] ] = parent::customerlist($val['h_cid']);
$s_type = strtotime($val['l_endtime']) >= strtotime(date('Y-m-d', time())) ? 1 : 0; $s_type = strtotime($val['l_endtime']) >= strtotime(date('Y-m-d', time())) ? 1 : 0;
if (empty(self::$para['ltype']) && $s_type) if (empty(self::$para['ltype']) && $s_type)
self::$para['ltype'] = parent::translate(2); self::$para['ltype'] = parent::translate(2);
$val['ltype'] = parent::state_color($s_type, ['已经结束', self::$para['ltype'][$val['l_schedule']]]); $val['ltype'] = parent::state_color($s_type, ['已经结束', self::$para['ltype'][ $val['l_schedule'] ]]);
$val['h_cid'] = self::$customer[$val['h_cid']]; $val['h_cid'] = self::$customer[ $val['h_cid'] ];
$val['e_enable'] = $val['e_enable'] == 0 || $this->bsign == false ? parent::state_color($val['e_enable'], ['禁用', '启用']) : ''; $val['e_enable'] = $val['e_enable'] == 0 || $this->bsign == false ? parent::state_color($val['e_enable'], ['禁用', '启用']) : '';
self::eaddress($val, 'l_address', $this->bsign); self::eaddress($val, 'l_address', $this->bsign);
return self::assemble($key, $base, $val, $checked, false); return self::assemble($key, $base, $val, $checked, false);
} }
//合同归档 //合同归档
protected function contract($val, $checked = '') { protected function contract($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_contract(); $key = self::tf_contract();
@ -231,22 +239,22 @@ trait tlist {
</span>'; </span>';
//对字段处理 //对字段处理
//公司名称 //公司名称
if (empty(self::$customer[$val['h_cid']])) if (empty(self::$customer[ $val['h_cid'] ]))
self::$customer[$val['h_cid']] = parent::customerlist($val['h_cid']); self::$customer[ $val['h_cid'] ] = parent::customerlist($val['h_cid']);
//投放媒介 //投放媒介
if (empty(self::$para['h_medium'])) if (empty(self::$para['h_medium']))
self::$para['h_medium'] = parent::translate(4); self::$para['h_medium'] = parent::translate(4);
$h_mediumid = stringto_array($val['h_medium'], '#@met@#'); $h_mediumid = stringto_array($val['h_medium'], '#@met@#');
foreach ($h_mediumid as $hmid) { foreach ($h_mediumid as $hmid) {
$hmediumid[] = self::$para['h_medium'][$hmid]; $hmediumid[] = self::$para['h_medium'][ $hmid ];
} }
//相关人员 //相关人员
$workerswid = stringto_array($val['h_wid'], ','); $workerswid = stringto_array($val['h_wid'], ',');
foreach ($workerswid as $hwid) { foreach ($workerswid as $hwid) {
if (empty(self::$workers[$hwid])) if (empty(self::$workers[ $hwid ]))
self::$workers[$hwid] = parent::workerslist($hwid); self::$workers[ $hwid ] = parent::workerslist($hwid);
$workersstr[] = self::$workers[$hwid]; $workersstr[] = self::$workers[ $hwid ];
} }
//内连接 //内连接
@ -255,7 +263,7 @@ trait tlist {
$curdate = date('Y-m-d', time()); $curdate = date('Y-m-d', time());
$val['h_number'] = '<a href="' . $launchurl . '"> ' . $h_number . '</a>'; $val['h_number'] = '<a href="' . $launchurl . '"> ' . $h_number . '</a>';
$val['h_cid'] = self::$customer[$val['h_cid']]; $val['h_cid'] = self::$customer[ $val['h_cid'] ];
$val['h_wid'] = parent::tab_tokenfield(arrayto_string($workersstr), 1); $val['h_wid'] = parent::tab_tokenfield(arrayto_string($workersstr), 1);
$val['h_noticeday'] = parent::tab_tokenfield($val['h_noticeday'], 2); $val['h_noticeday'] = parent::tab_tokenfield($val['h_noticeday'], 2);
$val['h_medium'] = parent::tab_tokenfield(arrayto_string($hmediumid, ',')); $val['h_medium'] = parent::tab_tokenfield(arrayto_string($hmediumid, ','));
@ -279,7 +287,8 @@ trait tlist {
} }
//公司资料 //公司资料
protected function customer($val, $checked = '') { protected function customer($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_customer(); $key = self::tf_customer();
@ -305,7 +314,8 @@ trait tlist {
} }
//企业联系人 //企业联系人
protected function workers($val, $checked = '') { protected function workers($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_workers(); $key = self::tf_workers();
@ -322,7 +332,7 @@ trait tlist {
self::$para = parent::translate(1); self::$para = parent::translate(1);
//对字段处理 //对字段处理
$val['w_jid'] = self::$para[$val['w_jid']]; $val['w_jid'] = self::$para[ $val['w_jid'] ];
$val['w_tel'] = parent::tab_tokenfield($val['w_tel'], 1); $val['w_tel'] = parent::tab_tokenfield($val['w_tel'], 1);
//执行操作按钮 //执行操作按钮
@ -334,7 +344,8 @@ trait tlist {
} }
//参数统计 //参数统计
protected function para($val, $checked = '') { protected function para($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_para(); $key = self::tf_para();
@ -405,7 +416,8 @@ trait tlist {
} }
//投放计划 //投放计划
protected function launch($val, $checked = '') { protected function launch($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_launch(); $key = self::tf_launch();
@ -429,8 +441,8 @@ trait tlist {
$val['l_totalnum'] = $enum == $snum ? $esstr : parent::state_color(0, [$esstr]); //放在最前面防止后面对l_enumber 字段的处理 $val['l_totalnum'] = $enum == $snum ? $esstr : parent::state_color(0, [$esstr]); //放在最前面防止后面对l_enumber 字段的处理
$val['l_title'] = '<a href="' . $l_titleurl . '"> ' . $val['l_title'] . '</a>'; $val['l_title'] = '<a href="' . $l_titleurl . '"> ' . $val['l_title'] . '</a>';
$val['l_enumber'] = parent::tab_tokenfield($val['l_enumber'], 1, ',', 6); $val['l_enumber'] = parent::tab_tokenfield($val['l_enumber'], 1, ',', 6);
$val['l_schedule'] = parent::tab_tokenfield(self::$para['l_schedule'][$val['l_schedule']], 1); $val['l_schedule'] = parent::tab_tokenfield(self::$para['l_schedule'][ $val['l_schedule'] ], 1);
$val['l_type'] = self::$para['l_type'][$val['l_type']]; $val['l_type'] = self::$para['l_type'][ $val['l_type'] ];
$val['l_starttime'] = strtotime($val['l_starttime']) > strtotime($curdate) ? parent::str_color(2, $val['l_starttime'], 600) : $val['l_starttime']; $val['l_starttime'] = strtotime($val['l_starttime']) > strtotime($curdate) ? parent::str_color(2, $val['l_starttime'], 600) : $val['l_starttime'];
$val['l_endtime'] = strtotime($val['l_endtime']) < strtotime($curdate) ? parent::str_color(0, $val['l_endtime'], 600) : $val['l_endtime']; $val['l_endtime'] = strtotime($val['l_endtime']) < strtotime($curdate) ? parent::str_color(0, $val['l_endtime'], 600) : $val['l_endtime'];
@ -441,16 +453,17 @@ trait tlist {
$this->btn[] = '<a href="' . $l_titleurl . '" class="btn btn-info btn-sm">查看排期</a>'; $this->btn[] = '<a href="' . $l_titleurl . '" class="btn btn-info btn-sm">查看排期</a>';
$addtourl = $_M['url']['own_name'] . 'c=backups&a=doindex&tname=schedule&id=' . $val['id']; $addtourl = $_M['url']['own_name'] . 'c=backups&a=doindex&tname=schedule&id=' . $val['id'];
$this->btn[] = '<a href="' . $addtourl . '" class="btn btn-warning btn-sm">导出排期</a>'; $this->btn[] = '<a href="' . $addtourl . '" class="btn btn-warning btn-sm">导出排期</a>';
$addtourl = $this->own_name_info.__FUNCTION__.'&fzid='.$val['id'].'&eaps_order=2'; $addtourl = $this->own_name_info . __FUNCTION__ . '&fzid=' . $val['id'] . '&eaps_order=2';
$this->btn[] = '<a href="'.$addtourl.'" class="btn btn-primary btn-sm">复制</a>'; $this->btn[] = '<a href="' . $addtourl . '" class="btn btn-primary btn-sm">复制</a>';
$addtourl = $this->own_name_info.__FUNCTION__.'&slid='.$val['id'].'&eaps_order=2'; $addtourl = $this->own_name_info . __FUNCTION__ . '&slid=' . $val['id'] . '&eaps_order=2';
$this->btn[] = '<a href="' . $addtourl . '" class="btn btn-success btn-sm">编辑</a>'; $this->btn[] = '<a href="' . $addtourl . '" class="btn btn-success btn-sm">编辑</a>';
} }
return self::assemble($key, $base, $val, $checked); return self::assemble($key, $base, $val, $checked);
} }
//广告位统计 //广告位统计
protected function applan($val, $checked = '') { protected function applan($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_applan(); $key = self::tf_applan();
@ -467,9 +480,9 @@ trait tlist {
$slid = $this->form['slid']; $slid = $this->form['slid'];
//判断排期表内是否存在 //判断排期表内是否存在
if (!empty($this->form['slid'])) { if (!empty($this->form['slid'])) {
if (empty(self::$para[$slid])) if (empty(self::$para[ $slid ]))
self::$para[$slid] = $this->tsql->table('launch')->where(['id' => $slid])->one(); self::$para[ $slid ] = $this->tsql->table('launch')->where(['id' => $slid])->one();
$l_hnumber = stringto_array(self::$para[$slid]['l_enumber'], ','); $l_hnumber = stringto_array(self::$para[ $slid ]['l_enumber'], ',');
$class = in_array($e_number, $l_hnumber, true) ? ' checkbox-success ' : ' checkbox-danger '; //刚选择默认颜色 $class = in_array($e_number, $l_hnumber, true) ? ' checkbox-success ' : ' checkbox-danger '; //刚选择默认颜色
} }
} }
@ -528,7 +541,8 @@ trait tlist {
} }
//广告位统计 //广告位统计
protected function elevators($val, $checked = '') { protected function elevators($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_elevators(); $key = self::tf_elevators();
@ -562,7 +576,7 @@ trait tlist {
//执行操作按钮 //执行操作按钮
if (empty($checked)) { if (empty($checked)) {
// $this->btn[] = '<a href="'.$uplaunchurl.'" class="btn btn-success btn-sm">调整排期</a>'; // $this->btn[] = '<a href="'.$uplaunchurl.'" class="btn btn-success btn-sm">调整排期</a>';
$this->btn[] = '<a href="' . $scheduleurl . '" class="btn btn-primary btn-sm">查看排期</a>'; $this->btn[] = '<a href="' . $scheduleurl . '" class="btn btn-primary btn-sm">查看排期</a>';
} }
//跳过标记突出处理 //跳过标记突出处理
@ -571,7 +585,8 @@ trait tlist {
} }
//场所统计展示 //场所统计展示
protected function villages($val, $checked = '') { protected function villages($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_villages(); $key = self::tf_villages();
@ -589,7 +604,7 @@ trait tlist {
$scheduleurl = $this->own_name_table . 'schedule&e_vid=' . $val['id']; $scheduleurl = $this->own_name_table . 'schedule&e_vid=' . $val['id'];
$val['v_name'] = '<a href="' . $scheduleurl . '" title="查看排期"> ' . $val['v_name'] . '</a>'; $val['v_name'] = '<a href="' . $scheduleurl . '" title="查看排期"> ' . $val['v_name'] . '</a>';
$val['v_type'] = self::$para['v_type'][$val['v_type']]; $val['v_type'] = self::$para['v_type'][ $val['v_type'] ];
$val['v_free'] = $val['v_free'] ? '<span class="tag tag-sm tag-pill tag-info">' . $val['v_free'] . '</span>' : $val['v_free']; $val['v_free'] = $val['v_free'] ? '<span class="tag tag-sm tag-pill tag-info">' . $val['v_free'] . '</span>' : $val['v_free'];
$val['v_lease'] = $val['v_lease'] ? '<span class="tag tag-sm tag-pill tag-warning">' . $val['v_lease'] . '</span>' : $val['v_lease']; $val['v_lease'] = $val['v_lease'] ? '<span class="tag tag-sm tag-pill tag-warning">' . $val['v_lease'] . '</span>' : $val['v_lease'];
$val['v_endday'] = $val['v_endday'] ? '<span class="tag tag-sm tag-pill tag-success">' . $val['v_endday'] . '</span>' : $val['v_endday']; $val['v_endday'] = $val['v_endday'] ? '<span class="tag tag-sm tag-pill tag-success">' . $val['v_endday'] . '</span>' : $val['v_endday'];
@ -615,7 +630,8 @@ trait tlist {
} }
//场所统计展示 //场所统计展示
protected function noticeday($val, $checked = '', $base = []) { protected function noticeday($val, $checked = '', $base = [])
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_noticeday(); $key = self::tf_noticeday();
@ -623,15 +639,15 @@ trait tlist {
//列表前段 //列表前段
//对字段处理 //对字段处理
//公司 //公司
if (empty(self::$customer[$val['h_cid']])) if (empty(self::$customer[ $val['h_cid'] ]))
self::$customer[$val['h_cid']] = parent::customerlist($val['h_cid']); self::$customer[ $val['h_cid'] ] = parent::customerlist($val['h_cid']);
//相关人员 //相关人员
$workerswid = stringto_array($val['h_wid'], ','); $workerswid = stringto_array($val['h_wid'], ',');
foreach ($workerswid as $hwid) { foreach ($workerswid as $hwid) {
if (empty(self::$workers[$hwid])) if (empty(self::$workers[ $hwid ]))
self::$workers[$hwid] = parent::workerslist($hwid); self::$workers[ $hwid ] = parent::workerslist($hwid);
$workersstr[] = self::$workers[$hwid]; $workersstr[] = self::$workers[ $hwid ];
} }
$h_endtime = strtotime($val['h_endtime']); $h_endtime = strtotime($val['h_endtime']);
@ -658,7 +674,7 @@ trait tlist {
//设置的到期提醒 //设置的到期提醒
//订单到期前后3天提醒 //订单到期前后3天提醒
$val['h_cid'] = self::$customer[$val['h_cid']]; $val['h_cid'] = self::$customer[ $val['h_cid'] ];
$val['h_wid'] = parent::tab_tokenfield(arrayto_string($workersstr), 1); $val['h_wid'] = parent::tab_tokenfield(arrayto_string($workersstr), 1);
$val['htypes'] = $htypes; $val['htypes'] = $htypes;
@ -669,7 +685,8 @@ trait tlist {
} }
//前台巡查 //前台巡查
protected function patrol($val, $checked = '') { protected function patrol($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_patrol(); $key = self::tf_patrol();
@ -689,7 +706,8 @@ trait tlist {
} }
//参数统计 //参数统计
protected function keylist($val, $checked = '') { protected function keylist($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_keylist(); $key = self::tf_keylist();
@ -701,14 +719,14 @@ trait tlist {
</span>'; </span>';
//对字段处理 //对字段处理
if (empty(self::$workers[$val['k_wid']])) { if (empty(self::$workers[ $val['k_wid'] ])) {
$k_wid = parent::workerslist($val['k_wid'], false); $k_wid = parent::workerslist($val['k_wid'], false);
self::$workers[$val['k_wid']] = $k_wid['w_name'] . ',' . $k_wid['w_tel']; self::$workers[ $val['k_wid'] ] = $k_wid['w_name'] . ',' . $k_wid['w_tel'];
} }
$val['k_basekey'] = base64_decode($val['k_basekey']); $val['k_basekey'] = base64_decode($val['k_basekey']);
$val['k_state'] = parent::state_color($val['k_state'], ['禁用', '启用']); $val['k_state'] = parent::state_color($val['k_state'], ['禁用', '启用']);
$val['k_wid'] = parent::tab_tokenfield(self::$workers[$val['k_wid']], 1); $val['k_wid'] = parent::tab_tokenfield(self::$workers[ $val['k_wid'] ], 1);
//执行操作按钮 //执行操作按钮
if (empty($checked)) { if (empty($checked)) {

File diff suppressed because it is too large Load Diff

View File

@ -528,14 +528,14 @@ namespace APPMAP {
//模态框 //模态框
$('#selectMapId').on('shown.bs.modal', () => { $('#selectMapId').on('shown.bs.modal', () => {
// 设置地图高度,达到满屏效果 // 设置地图高度,达到满屏效果
if(!this.selectMapInitType) this.setHeight() if (!this.selectMapInitType) this.setHeight()
// 延迟效果可以让模态框加载时看起来没有卡的感觉 // 延迟效果可以让模态框加载时看起来没有卡的感觉
setTimeout(() => { setTimeout(() => {
// 解决因页面产品滚动条导致的点击地图获取的经纬度不准确问题 // 解决因页面产品滚动条导致的点击地图获取的经纬度不准确问题
// 让滚动条回滚到顶部 // 让滚动条回滚到顶部
document.body.scrollTop = document.documentElement.scrollTop = 0 document.body.scrollTop = document.documentElement.scrollTop = 0
// 初始化模态框 // 初始化模态框
if(!this.selectMapInitType) this.selectInitMap() if (!this.selectMapInitType) this.selectInitMap()
// ajax查找 当前地区点的标注并添加在地图上 // ajax查找 当前地区点的标注并添加在地图上
this.ajaxlnglatList(this.selectMap, { this.ajaxlnglatList(this.selectMap, {
id: '', id: '',
@ -545,7 +545,7 @@ namespace APPMAP {
allinfo: 'all' allinfo: 'all'
}, true) }, true)
// 初始化绘制工具 // 初始化绘制工具
if(!this.selectMapInitType) this.drawingManagerInit() if (!this.selectMapInitType) this.drawingManagerInit()
// 绘制结束后的回调 // 绘制结束后的回调
this.drawingManager.addEventListener("overlaycomplete", (e) => { this.drawingManager.addEventListener("overlaycomplete", (e) => {
let overlay = e.overlay let overlay = e.overlay
@ -604,7 +604,7 @@ namespace APPMAP {
}) })
}); });
// 标记为已经初始化过 // 标记为已经初始化过
if(this.selectMapInitType === false) this.selectMapInitType = true if (this.selectMapInitType === false) this.selectMapInitType = true
}, 100) }, 100)
}); });
@ -873,13 +873,13 @@ namespace APPMAP {
} else { } else {
let listNums = this.villageList ? Object.keys(this.villageList).length : 0 let listNums = this.villageList ? Object.keys(this.villageList).length : 0
$('#selectMapId .listNum').html(listNums) $('#selectMapId .listNum').html(listNums)
$('button[data-target="#selectMapId"] .listNum').html(listNums > 0?listNums:'') $('button[data-target="#selectMapId"] .listNum').html(listNums > 0 ? listNums : '')
if (listNums === 0 && type === 'del') this.mapreset() if (listNums === 0 && type === 'del') this.mapreset()
} }
} }
// 将指传递到input // 将指传递到input
input(keysStr?){ input(keysStr?) {
const inputVid = $('input[name="v_id"]') const inputVid = $('input[name="v_id"]')
inputVid.val(keysStr) inputVid.val(keysStr)
inputVid.trigger('change') inputVid.trigger('change')

View File

@ -1,18 +1,18 @@
declare let $:any declare let $: any
declare let jQuery:any declare let jQuery: any
declare let APPFUN:{ declare let APPFUN: {
isEmpty: (a:any)=>{} isEmpty: (a: any) => {}
} }
declare let BMapGL:any declare let BMapGL: any
declare let M:any declare let M: any
declare let alertify:any declare let alertify: any
declare let CL:any declare let CL: any
declare let BMAP_ANCHOR_TOP_LEFT:any declare let BMAP_ANCHOR_TOP_LEFT: any
declare let BMAP_ANCHOR_BOTTOM_LEFT:any declare let BMAP_ANCHOR_BOTTOM_LEFT: any
declare let BMAP_ANCHOR_TOP_RIGHT:any declare let BMAP_ANCHOR_TOP_RIGHT: any
declare let BMAP_DRAWING_MARKER:any declare let BMAP_DRAWING_MARKER: any
declare let BMAP_DRAWING_POLYLINE:any declare let BMAP_DRAWING_POLYLINE: any
declare let BMAP_DRAWING_RECTANGLE:any declare let BMAP_DRAWING_RECTANGLE: any
declare let BMAP_DRAWING_POLYGON:any declare let BMAP_DRAWING_POLYGON: any
declare let BMAP_DRAWING_CIRCLE:any declare let BMAP_DRAWING_CIRCLE: any
declare let BMapGLLib:any declare let BMapGLLib: any

View File

@ -5,7 +5,8 @@
* 应用支持php5.4+ * 应用支持php5.4+
*/ */
trait appcmp { trait appcmp
{
# 应用文件名 # 应用文件名
public $m_name = M_NAME; public $m_name = M_NAME;
@ -21,94 +22,102 @@ trait appcmp {
protected function show($file, $data) protected function show($file, $data)
{ {
global $_M, $_YW; global $_M, $_YW;
$view =load::sys_class('engine','new'); $view = load::sys_class('engine', 'new');
require_once $view->dodisplay($file, $data); require_once $view->dodisplay($file, $data);
} }
protected function check_auth() { protected function check_auth()
{
global $_M, $_YW; global $_M, $_YW;
self::cmp_a(); self::cmp_a();
$exetime = time(); $exetime = time();
$bool = false; $bool = false;
//解密后的数组 //解密后的数组
$cache = json_decode(authcode($_YW['c']['ac_cache'],'DECODE',md5($_M['config']['met_weburl'])),true); $cache = json_decode(authcode($_YW['c']['ac_cache'], 'DECODE', md5($_M['config']['met_weburl'])), true);
//查看本地是否存在禁止更新锁 //查看本地是否存在禁止更新锁
if(file_exists(PATH_APP_FILE."config/update.lock")) $cache['update'] = 1; if (file_exists(PATH_APP_FILE . "config/update.lock")) $cache['update'] = 1;
//需要对比数据 //需要对比数据
if( $cache['time'] > $exetime || ($cache['time'] > $cache['exetime'] && $cache['time'] < $exetime) ){ if ($cache['time'] > $exetime || ($cache['time'] > $cache['exetime'] && $cache['time'] < $exetime)) {
$check = json_decode(authcode($cache['check'],'DECODE', md5(self::parse_url($_M['config']['met_weburl']).md5($this->m_name.$_YW['app']['addtime']))),true); $check = json_decode(authcode($cache['check'], 'DECODE', md5(self::parse_url($_M['config']['met_weburl']) . md5($this->m_name . $_YW['app']['addtime']))), true);
$state = $check['state'] && $check['app']['v_m_name'] == $this->m_name?true:false; $state = $check['state'] && $check['app']['v_m_name'] == $this->m_name ? true : false;
if($state){ if ($state) {
if($check['vatime']['minute'] > 0){ if ($check['vatime']['minute'] > 0) {
//对有效时间计算 //对有效时间计算
$time = date('Y-m-d H:i:s',$check['vatime']['stime']); $time = date('Y-m-d H:i:s', $check['vatime']['stime']);
$endtime = strtotime("{$time} +{$check['vatime']['minute']} minute"); $endtime = strtotime("{$time} +{$check['vatime']['minute']} minute");
if($endtime <= $exetime ) $state = false; if ($endtime <= $exetime) $state = false;
} }
//最终结果判断 //最终结果判断
$bool = $state && !empty($cache['wechat']) && !empty($cache['update'])?true:false; $bool = $state && !empty($cache['wechat']) && !empty($cache['update']) ? true : false;
} }
} }
if(!$bool) turnover($_M['url']['own_name'].'c=index&a=doindex&check=1','No prompt'); if (!$bool) turnover($_M['url']['own_name'] . 'c=index&a=doindex&check=1', 'No prompt');
} }
# 加载方法 # 加载方法
public function loadp($str = '') { public function loadp($str = '')
{
global $_M, $_YW; global $_M, $_YW;
$arr = explode(",",$str); $arr = explode(",", $str);
foreach ($arr as $val) { foreach ($arr as $val) {
self::$val(); self::$val();
} }
} }
# 批量加载 # 批量加载
public function cmp_load() { public function cmp_load()
{
global $_M, $_YW; global $_M, $_YW;
self::loadp('cmp_k,cmp_c,cmp_t'); self::loadp('cmp_k,cmp_c,cmp_t');
} }
# 获取完整数据库 # 获取完整数据库
public function cmp_k() { public function cmp_k()
{
global $_M, $_YW; global $_M, $_YW;
//全局 //全局
$globaltablename = ['cloud_config']; $globaltablename = ['cloud_config'];
//应用独有表名 //应用独有表名
$tablename = file_get_contents(PATH_ALL_APP.$this->m_name.'/config/table'); $tablename = file_get_contents(PATH_ALL_APP . $this->m_name . '/config/table');
$this->k_name = array_diff(stringto_array($tablename,','),$globaltablename); $this->k_name = array_diff(stringto_array($tablename, ','), $globaltablename);
foreach ($this->k_name as $val) { foreach ($this->k_name as $val) {
$_YW['k'][$val] = $_M['table'][$this->m_name . '_' . $val]; $_YW['k'][ $val ] = $_M['table'][ $this->m_name . '_' . $val ];
} }
foreach ($globaltablename as $val) { foreach ($globaltablename as $val) {
$_YW['k'][$val] = $_M['table'][$val]; $_YW['k'][ $val ] = $_M['table'][ $val ];
} }
} }
# 配置信息 # 配置信息
public function cmp_c($lang = '') { public function cmp_c($lang = '')
{
global $_M, $_YW; global $_M, $_YW;
$_YW['n'] = $this->m_name; $_YW['n'] = $this->m_name;
if (empty($lang)) $lang = $_M['lang']; if (empty($lang)) $lang = $_M['lang'];
$result = DB::query("select name,value from {$_M['table']['cloud_config']} where m_name = '{$this->m_name}' AND (lang = '{$lang}' OR lang = 'cloud') "); $result = DB::query("select name,value from {$_M['table']['cloud_config']} where m_name = '{$this->m_name}' AND (lang = '{$lang}' OR lang = 'cloud') ");
while ($val = DB::fetch_array($result)) { while ($val = DB::fetch_array($result)) {
$_YW['c'][$val['name']] = $val['value']; $_YW['c'][ $val['name'] ] = $val['value'];
} }
if(class_exists('admin') || class_exists('app')) self::check_auth(); if (class_exists('admin') || class_exists('app')) self::check_auth();
} }
# 应用信息 # 应用信息
public function cmp_a() { public function cmp_a()
{
global $_M, $_YW; global $_M, $_YW;
$_YW['app'] = DB::get_one("SELECT * FROM {$_M['table']['applist']} WHERE m_name='{$this->m_name}' "); $_YW['app'] = DB::get_one("SELECT * FROM {$_M['table']['applist']} WHERE m_name='{$this->m_name}' ");
} }
# 栏目信息 # 栏目信息
public function cmp_ac() { public function cmp_ac()
{
global $_M, $_YW; global $_M, $_YW;
$_YW['app']['column'] = DB::get_one("SELECT * FROM {$_M['table']['column']} WHERE module='{$_YW['app']['no']}' AND lang='{$_M['lang']}' "); $_YW['app']['column'] = DB::get_one("SELECT * FROM {$_M['table']['column']} WHERE module='{$_YW['app']['no']}' AND lang='{$_M['lang']}' ");
} }
# 语言文字 # 语言文字
public function cmp_t() { public function cmp_t()
{
global $_M, $_YW; global $_M, $_YW;
$file = PATH_APP_FILE . 'lang/' . $_M['lang'] . '.php'; $file = PATH_APP_FILE . 'lang/' . $_M['lang'] . '.php';
if (!file_exists($file)) { if (!file_exists($file)) {
@ -118,14 +127,16 @@ trait appcmp {
} }
# 单条配置语句入库 # 单条配置语句入库
public function addconsql($name, $val = '',$lang) { public function addconsql($name, $val = '', $lang)
{
global $_M, $_YW; global $_M, $_YW;
if (empty($lang)) $lang = $_M['lang']; if (empty($lang)) $lang = $_M['lang'];
DB::query("INSERT INTO {$_M['table']['cloud_config']} (name,lang,m_name,value) VALUES ('{$name}','{$lang}','{$this->m_name}','{$val}') ON DUPLICATE KEY UPDATE value='{$val}' "); DB::query("INSERT INTO {$_M['table']['cloud_config']} (name,lang,m_name,value) VALUES ('{$name}','{$lang}','{$this->m_name}','{$val}') ON DUPLICATE KEY UPDATE value='{$val}' ");
} }
# 信息JQ弹出并刷新当前页面 # 信息JQ弹出并刷新当前页面
public function scriptgo($info) { public function scriptgo($info)
{
global $_M; global $_M;
$this->destruct = false; $this->destruct = false;
echo "<script>alert('{$info}');history.go(-1);</script>"; echo "<script>alert('{$info}');history.go(-1);</script>";
@ -133,21 +144,24 @@ trait appcmp {
} }
//表简称 //表简称
public function tname() { public function tname()
{
global $_M, $_YW; global $_M, $_YW;
return substr($_M['form']['a'],2); return substr($_M['form']['a'], 2);
} }
//时间格式化 //时间格式化
public function data_time($time) { public function data_time($time)
global $_M,$_YW; {
return $time?date('Y-m-d H:i:s', $time):''; global $_M, $_YW;
return $time ? date('Y-m-d H:i:s', $time) : '';
} }
//字符截取 //字符截取
public function sub_str($str) { public function sub_str($str)
global $_M,$_YW; {
return strlen($str) > 0?substr($str,0, 8).'...':''; global $_M, $_YW;
return strlen($str) > 0 ? substr($str, 0, 8) . '...' : '';
} }
/* /*
@ -155,41 +169,45 @@ trait appcmp {
* @param array $back 输出字符串或数组 * @param array $back 输出字符串或数组
* @param string $callback ajax的回调函数的名称 * @param string $callback ajax的回调函数的名称
*/ */
public function jsoncallback($back, $callback = 'callback') { public function jsoncallback($back, $callback = 'callback')
{
global $_M; global $_M;
header('Content-type: application/x-javascript'); header('Content-type: application/x-javascript');
$callback = $_M['form'][$callback]; $callback = $_M['form'][ $callback ];
$json = json_encode($back,JSON_UNESCAPED_UNICODE); $json = json_encode($back, JSON_UNESCAPED_UNICODE);
echo $callback?$callback . '(' . $json . ')':$json; echo $callback ? $callback . '(' . $json . ')' : $json;
} }
# 分析网址 # 分析网址
public function parse_url($url,$type = 'host') { public function parse_url($url, $type = 'host')
{
global $_M; global $_M;
$url = url_standard($url); $url = url_standard($url);
$array = parse_url($url); $array = parse_url($url);
return $type == 'arr'?$array:$array[$type]; return $type == 'arr' ? $array : $array[ $type ];
} }
//URL参数处理防止URL拼接错误 //URL参数处理防止URL拼接错误
public function http_build_query($url,$arr) { public function http_build_query($url, $arr)
{
global $_M, $_YW; global $_M, $_YW;
if(!in_array(substr($url,-1), ['&','?'])) $url .= '&'; if (!in_array(substr($url, -1), ['&', '?'])) $url .= '&';
return $url.http_build_query($arr); return $url . http_build_query($arr);
} }
//前端CSS合并 //前端CSS合并
public function merge_css($addcss = '') { public function merge_css($addcss = '')
{
global $_M, $_YW; global $_M, $_YW;
$cssfile = PATH_APP_FILE.'public/css/webcss.css'; $cssfile = PATH_APP_FILE . 'public/css/webcss.css';
if(!file_exists($cssfile)) return false; if (!file_exists($cssfile)) return false;
$css = file_get_contents($cssfile); $css = file_get_contents($cssfile);
//自定义新增CSS文件 //自定义新增CSS文件
$diycss = PATH_APP_FILE.'public/css/diycss.css'; $diycss = PATH_APP_FILE . 'public/css/diycss.css';
if(file_exists($diycss)) $css .= PHP_EOL.file_get_contents($diycss); if (file_exists($diycss)) $css .= PHP_EOL . file_get_contents($diycss);
//通过后台新增的CSS //通过后台新增的CSS
if(empty($addcss)) $addcss = $_YW['c']['diycss']; if (empty($addcss)) $addcss = $_YW['c']['diycss'];
return file_put_contents(PATH_APP_FILE.'web/templates/met/css/metinfo.css', $css.PHP_EOL.$addcss); return file_put_contents(PATH_APP_FILE . 'web/templates/met/css/metinfo.css', $css . PHP_EOL . $addcss);
} }

View File

@ -3,8 +3,10 @@ defined('IN_MET') or exit('No permission');
//更新文件的模板 //更新文件的模板
load::sys_class('admin'); load::sys_class('admin');
load::sys_func('file'); load::sys_func('file');
//不继承APP //不继承APP
class update extends admin{ class update extends admin
{
//应用信息 //应用信息
private $app; private $app;
@ -24,7 +26,8 @@ class update extends admin{
private $fixed_name; private $fixed_name;
# 初始化 # 初始化
public function __construct() { public function __construct()
{
global $_M; global $_M;
parent::__construct(); parent::__construct();
//安装锁信息,应用入口信息 //安装锁信息,应用入口信息
@ -33,13 +36,14 @@ class update extends admin{
'c' => 'dzadsod', 'c' => 'dzadsod',
'a' => 'dodzadsod', 'a' => 'dodzadsod',
'lang' => $_M['lang'], 'lang' => $_M['lang'],
'time' => date('Y-m-d H:i:s',time()) 'time' => date('Y-m-d H:i:s', time())
]; ];
$this->sqlk = $_M['table']['cloud_config']; $this->sqlk = $_M['table']['cloud_config'];
} }
//需要传递值 //需要传递值
public function set($app) { public function set($app)
{
global $_M; global $_M;
$this->app = $app; $this->app = $app;
$this->appno = $app['no']; $this->appno = $app['no'];
@ -50,9 +54,10 @@ class update extends admin{
} }
//修改数据库版本 //修改数据库版本
public function start() { public function start()
{
global $_M; global $_M;
if(file_exists(INS_LOCK_FILE)){ if (file_exists(INS_LOCK_FILE)) {
switch ($this->newver) { switch ($this->newver) {
case 1.1: case 1.1:
//更新数据库 //更新数据库
@ -66,7 +71,7 @@ class update extends admin{
} }
//更新版本号 //更新版本号
self::upver(); self::upver();
}else{ } else {
//创建数据表 //创建数据表
self::inssql(); self::inssql();
//默认系统表处理 //默认系统表处理
@ -92,7 +97,8 @@ class update extends admin{
*/ */
// 1.1 版本 // 1.1 版本
public function update_1_1() { public function update_1_1()
{
global $_M; global $_M;
// 对一个表新增字段 // 对一个表新增字段
} }
@ -110,7 +116,8 @@ class update extends admin{
*/ */
//数据库创建 //数据库创建
protected function table_field() { protected function table_field()
{
global $_M; global $_M;
// 场所资料库 // 场所资料库
$zdytable['village'] = " `id` int(11) NOT NULL AUTO_INCREMENT, $zdytable['village'] = " `id` int(11) NOT NULL AUTO_INCREMENT,
@ -281,11 +288,12 @@ class update extends admin{
} }
//mysql 触发器 //mysql 触发器
protected function trigger() { protected function trigger()
{
global $_M; global $_M;
//新增schedule 表的更新触发器 //新增schedule 表的更新触发器
$table_name = self::split_table_name('schedule',true); $table_name = self::split_table_name('schedule', true);
$launch_name = self::split_table_name('launch',true); $launch_name = self::split_table_name('launch', true);
//更新触发器并没有排除两个时间字段为空的排查 //更新触发器并没有排除两个时间字段为空的排查
$array[] = " CREATE TRIGGER `add` BEFORE INSERT ON `{$table_name}` FOR EACH ROW $array[] = " CREATE TRIGGER `add` BEFORE INSERT ON `{$table_name}` FOR EACH ROW
BEGIN BEGIN
@ -336,12 +344,13 @@ class update extends admin{
} }
//mysql 视图 //mysql 视图
protected function tview() { protected function tview()
{
global $_M; global $_M;
//查询到期合同以及根据设置的到期天数提醒 //查询到期合同以及根据设置的到期天数提醒
$sequence = self::split_table_name('sequence',true); $sequence = self::split_table_name('sequence', true);
$contract = self::split_table_name('contract',true); $contract = self::split_table_name('contract', true);
$noticeday = self::split_table_name('noticeday',true); $noticeday = self::split_table_name('noticeday', true);
$array['noticeday'] = " CREATE VIEW {$noticeday} AS $array['noticeday'] = " CREATE VIEW {$noticeday} AS
SELECT SELECT
ct.*, ct.*,
@ -353,15 +362,15 @@ class update extends admin{
ON sq.seq <= ( ( 1 + length( ct.h_noticeday ) ) - length( REPLACE ( ct.h_noticeday, ',', '' ) ) ) "; ON sq.seq <= ( ( 1 + length( ct.h_noticeday ) ) - length( REPLACE ( ct.h_noticeday, ',', '' ) ) ) ";
//查询微信关注用户,排除非关注的用户 //查询微信关注用户,排除非关注的用户
$weuser = self::split_table_name('weuser',true); $weuser = self::split_table_name('weuser', true);
$nwechat_user = self::split_table_name('nwechat_user',true); $nwechat_user = self::split_table_name('nwechat_user', true);
$array['weuser'] = " CREATE VIEW {$weuser} AS $array['weuser'] = " CREATE VIEW {$weuser} AS
SELECT * FROM {$nwechat_user} WHERE subscribe = 1 "; SELECT * FROM {$nwechat_user} WHERE subscribe = 1 ";
// 广告位排期统计,计算广告位的空闲,到期,投放中 // 广告位排期统计,计算广告位的空闲,到期,投放中
$elevator = self::split_table_name('elevator',true); $elevator = self::split_table_name('elevator', true);
$launch = self::split_table_name('launch',true); $launch = self::split_table_name('launch', true);
$countela = self::split_table_name('countela',true); $countela = self::split_table_name('countela', true);
$array['countela'] = " CREATE VIEW {$countela} AS $array['countela'] = " CREATE VIEW {$countela} AS
SELECT SELECT
e.id, e.id,
@ -385,25 +394,27 @@ class update extends admin{
} }
//默认配置 //默认配置
protected function default_config() { protected function default_config()
{
global $_M; global $_M;
//正常升级 //正常升级
$config = [ $config = [
'tem_ida','tem_idb','tem_idc','openid' 'tem_ida', 'tem_idb', 'tem_idc', 'openid'
]; ];
$lang = $_M['lang']; $lang = $_M['lang'];
foreach ($config as $key => $val){ foreach ($config as $key => $val) {
DB::query("INSERT INTO {$this->sqlk} (name,lang,m_name,value) VALUES ('{$key}','{$lang}','{$this->m_name}','{$val}') ON DUPLICATE KEY UPDATE value='{$val}' "); DB::query("INSERT INTO {$this->sqlk} (name,lang,m_name,value) VALUES ('{$key}','{$lang}','{$this->m_name}','{$val}') ON DUPLICATE KEY UPDATE value='{$val}' ");
} }
} }
//系统表 //系统表
protected function systable() { protected function systable()
{
global $_M; global $_M;
//访问入口固定为app/index.php?n=XXX&c=XXX&a=XXX //访问入口固定为app/index.php?n=XXX&c=XXX&a=XXX
//定时处理入口 //定时处理入口
// $field = "no='{$this->appno}',m_name='{$this->m_name}',filename='timing.php',m_module='web',m_class='timing',m_action='@\$_GET[a]'"; // $field = "no='{$this->appno}',m_name='{$this->m_name}',filename='timing.php',m_module='web',m_class='timing',m_action='@\$_GET[a]'";
// self::addsql('ifcolumn_addfile',$field); // self::addsql('ifcolumn_addfile',$field);
} }
/* /*
@ -418,7 +429,8 @@ class update extends admin{
*/ */
//应用数据表创建 //应用数据表创建
protected function inssql() { protected function inssql()
{
global $_M; global $_M;
$tables = self::table_field(); $tables = self::table_field();
$table = $tname = []; $table = $tname = [];
@ -426,18 +438,18 @@ class update extends admin{
$tname[] = $key; $tname[] = $key;
$table_name = self::split_table_name($key); $table_name = self::split_table_name($key);
$table[] = $table_name; $table[] = $table_name;
if($val) DB::query("CREATE TABLE `{$_M['config']['tablepre']}{$table_name}` ( {$val} ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8"); if ($val) DB::query("CREATE TABLE `{$_M['config']['tablepre']}{$table_name}` ( {$val} ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8");
} }
//建立触发器 //建立触发器
$trigger = self::trigger(); $trigger = self::trigger();
foreach ($trigger as $val){ foreach ($trigger as $val) {
DB::query($val); DB::query($val);
} }
//执行SQL其他操作 //执行SQL其他操作
$tview = self::tview(); $tview = self::tview();
foreach ($tview as $key => $val){ foreach ($tview as $key => $val) {
$tname[] = $key; $tname[] = $key;
$table_name = self::split_table_name($key); $table_name = self::split_table_name($key);
$table[] = $table_name; $table[] = $table_name;
@ -445,31 +457,33 @@ class update extends admin{
} }
//记录表名 //记录表名
add_table(arrayto_string($table,'|')); add_table(arrayto_string($table, '|'));
$filetable = PATH_ALL_APP.$this->m_name.'/config/table'; $filetable = PATH_ALL_APP . $this->m_name . '/config/table';
//先获取之前已经存在的简短表名 //先获取之前已经存在的简短表名
if(file_exists($filetable)) { if (file_exists($filetable)) {
$tnamestr = file_get_contents($filetable); $tnamestr = file_get_contents($filetable);
$tname = array_merge($tname,stringto_array($tnamestr,',')); $tname = array_merge($tname, stringto_array($tnamestr, ','));
}else{ } else {
//创建 //创建
makefile($filetable); makefile($filetable);
} }
//写入 //写入
file_put_contents($filetable,arrayto_string(array_unique($tname),',')); file_put_contents($filetable, arrayto_string(array_unique($tname), ','));
} }
//修改版本号 //修改版本号
protected function upver() { protected function upver()
{
global $_M; global $_M;
DB::query("UPDATE {$_M['table']['applist']} SET ver='{$this->newver}' WHERE no='{$this->appno}' AND m_name='{$this->m_name}' "); DB::query("UPDATE {$_M['table']['applist']} SET ver='{$this->newver}' WHERE no='{$this->appno}' AND m_name='{$this->m_name}' ");
} }
//创建安装锁 //创建安装锁
protected function install_lock() { protected function install_lock()
{
global $_M; global $_M;
if(!file_exists(INS_LOCK_FILE)) makefile(INS_LOCK_FILE); if (!file_exists(INS_LOCK_FILE)) makefile(INS_LOCK_FILE);
file_put_contents(INS_LOCK_FILE, json_encode($this->appinfo,JSON_UNESCAPED_UNICODE) ); file_put_contents(INS_LOCK_FILE, json_encode($this->appinfo, JSON_UNESCAPED_UNICODE));
} }
/* /*
@ -486,35 +500,39 @@ class update extends admin{
*/ */
//公共查询方法 //公共查询方法
private function sqlone($tname,$where = '') { private function sqlone($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
if(!$where) $where = "no='{$this->appno}'"; if (!$where) $where = "no='{$this->appno}'";
return DB::get_one("select * from {$table} where {$where}"); return DB::get_one("select * from {$table} where {$where}");
} }
//公共查询方法 //公共查询方法
private function sqlall($tname,$where = '') { private function sqlall($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
if(!$where) $where = "no='{$this->appno}'"; if (!$where) $where = "no='{$this->appno}'";
return DB::get_all("select * from {$table} where {$where}"); return DB::get_all("select * from {$table} where {$where}");
} }
//公共写入方法 //公共写入方法
private function addsql($tname,$field = '') { private function addsql($tname, $field = '')
{
global $_M; global $_M;
$table = $_M['table'][$tname]; $table = $_M['table'][ $tname ];
DB::query("INSERT INTO {$table} SET {$field}"); DB::query("INSERT INTO {$table} SET {$field}");
} }
//拼接完整数据库名 //拼接完整数据库名
private function split_table_name($name,$all = false) { private function split_table_name($name, $all = false)
{
global $_M; global $_M;
//公用表 //公用表
$global_table = ['cloud_config','nwechat_user']; $global_table = ['cloud_config', 'nwechat_user'];
$tablename = in_array($name, $global_table)?$name:$this->m_name.'_'.$name; $tablename = in_array($name, $global_table) ? $name : $this->m_name . '_' . $name;
return $all?$_M['config']['tablepre'].$tablename:$tablename; return $all ? $_M['config']['tablepre'] . $tablename : $tablename;
} }
@ -526,32 +544,34 @@ class update extends admin{
*/ */
//创建前台入口API形式 //创建前台入口API形式
protected function column_api() { protected function column_api()
{
global $_M; global $_M;
$file = self::sqlall('ifcolumn_addfile'); $file = self::sqlall('ifcolumn_addfile');
$dir = PATH_WEB.$this->fixed_name; $dir = PATH_WEB . $this->fixed_name;
if(makedir($dir)){ if (makedir($dir)) {
if(getdirpower($dir) == false) modifydirpower($dir,0777); if (getdirpower($dir) == false) modifydirpower($dir, 0777);
} }
foreach ($file as $val) { foreach ($file as $val) {
$dirfile = $dir.'/'.$val['filename']; $dirfile = $dir . '/' . $val['filename'];
$action = strstr($val['m_action'],'@$_')?$val['m_action']:"'{$val['m_action']}'"; $action = strstr($val['m_action'], '@$_') ? $val['m_action'] : "'{$val['m_action']}'";
$phpstr = "<?php".PHP_EOL $phpstr = "<?php" . PHP_EOL
. "define('M_NAME', '{$val['m_name']}');".PHP_EOL . "define('M_NAME', '{$val['m_name']}');" . PHP_EOL
. "define('M_MODULE', '{$val['m_module']}');".PHP_EOL . "define('M_MODULE', '{$val['m_module']}');" . PHP_EOL
. "define('M_CLASS', '{$val['m_class']}');".PHP_EOL . "define('M_CLASS', '{$val['m_class']}');" . PHP_EOL
. "define('M_ACTION', {$action});".PHP_EOL . "define('M_ACTION', {$action});" . PHP_EOL
. "require_once '../app/app/entrance.php';".PHP_EOL . "require_once '../app/app/entrance.php';" . PHP_EOL
. "?>"; . "?>";
file_put_contents($dirfile, $phpstr); file_put_contents($dirfile, $phpstr);
} }
} }
//创建栏目信息 //创建栏目信息
protected function column() { protected function column()
{
global $_M; global $_M;
$name = array('cn'=>'加盟店','en'=>'Join store query','tc'=>'加盟店'); $name = array('cn' => '加盟店', 'en' => 'Join store query', 'tc' => '加盟店');
foreach (array('cn','en','tc') as $k => $v) { foreach (array('cn', 'en', 'tc') as $k => $v) {
DB::query("INSERT INTO {$_M['table']['column']} SET name='{$name[$v]}',foldername='{$this->fixed_name}',module='{$this->appno}',no_order='100',if_in='1',classtype='1',out_url='{$_M['url']['site']}{$this->fixed_name}',isshow='1',lang='{$v}',nav='1'"); DB::query("INSERT INTO {$_M['table']['column']} SET name='{$name[$v]}',foldername='{$this->fixed_name}',module='{$this->appno}',no_order='100',if_in='1',classtype='1',out_url='{$_M['url']['site']}{$this->fixed_name}',isshow='1',lang='{$v}',nav='1'");
} }
} }

View File

@ -10,7 +10,7 @@ class index extends appweb
{ {
# 过滤方法名 # 过滤方法名
private $ado = ['doindex','dotable','dotableto','doajaxcl']; private $ado = ['doindex', 'dotable', 'dotableto', 'doajaxcl'];
private $urls; private $urls;
@ -20,11 +20,11 @@ class index extends appweb
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
// 过滤 // 过滤
if (!in_array(M_ACTION, $this->ado,true)) { if (!in_array(M_ACTION, $this->ado, true)) {
//报错 //报错
exit(0); exit(0);
} }
$this->urls = $_M['url']['site'].'app/index.php?n=dzadsod'; $this->urls = $_M['url']['site'] . 'app/index.php?n=dzadsod';
$this->input['page_title'] = '广告位巡查'; $this->input['page_title'] = '广告位巡查';
} }
@ -33,7 +33,7 @@ class index extends appweb
{ {
global $_M, $_YW; global $_M, $_YW;
//进入密码输入页面 //进入密码输入页面
$this->input['url'] = $this->urls.'&a=dotable'; $this->input['url'] = $this->urls . '&a=dotable';
$this->show('app/index', $this->input); $this->show('app/index', $this->input);
} }
@ -43,23 +43,24 @@ class index extends appweb
global $_M, $_YW; global $_M, $_YW;
//校验验证码 //校验验证码
$mdck = $this->tsql->table('keylist') $mdck = $this->tsql->table('keylist')
->where(['k_passkey' => md5($_M['form']['check']), 'k_state' => 1 ]) ->where(['k_passkey' => md5($_M['form']['check']), 'k_state' => 1])
->one(); ->one();
if($mdck == false) parent::scriptgo('密钥错误!'); if ($mdck == false) parent::scriptgo('密钥错误!');
okinfo($this->urls.'&a=dotableto'); okinfo($this->urls . '&a=dotableto');
} }
//数据列表 //数据列表
public function dotableto() public function dotableto()
{ {
global $_M, $_YW; global $_M, $_YW;
$this->input['url'] = $this->urls.'&c=table_ajax&a=doindex&tname=patrol'; $this->input['url'] = $this->urls . '&c=table_ajax&a=doindex&tname=patrol';
$this->input['table'] = load::own_class('table_theme','new')->start('patrol')->send_all(1); $this->input['table'] = load::own_class('table_theme', 'new')->start('patrol')->send_all(1);
$this->show('app/table', $this->input); $this->show('app/table', $this->input);
} }
//获取doajaxcl //获取doajaxcl
public function doajaxcl() { public function doajaxcl()
{
global $_M, $_YW; global $_M, $_YW;
parent::jsoncallback([]); parent::jsoncallback([]);
} }

View File

@ -9,7 +9,9 @@ load::own_func('appcmp');
* 配置 * 配置
* 包含其他功能初始化 * 包含其他功能初始化
*/ */
class select extends appweb {
class select extends appweb
{
/* /*
* @$querys string 搜索内容 * @$querys string 搜索内容
@ -46,11 +48,12 @@ class select extends appweb {
//返回的数组 //返回的数组
private $data = []; private $data = [];
public function __construct() { public function __construct()
global $_M,$_YW; {
global $_M, $_YW;
parent::__construct(); parent::__construct();
// 过滤 // 过滤
if (!in_array(M_ACTION, $this->ado,true)) { if (!in_array(M_ACTION, $this->ado, true)) {
//报错 //报错
exit(0); exit(0);
} }
@ -59,7 +62,7 @@ class select extends appweb {
//搜索内容 //搜索内容
$this->querys = $_M['form']['querys']; $this->querys = $_M['form']['querys'];
//以指定字段为值 //以指定字段为值
$this->fiend = $_M['form']['fiend']?:'id'; $this->fiend = $_M['form']['fiend'] ?: 'id';
//来源 //来源
$this->source = $_M['form']['source']; $this->source = $_M['form']['source'];
//是否显示全部 //是否显示全部
@ -73,59 +76,63 @@ class select extends appweb {
} }
# select2 选项字段处理 # select2 选项字段处理
private function select_fiend($val) { private function select_fiend($val)
global $_M,$_YW; {
$strarr = stringto_array($this->fiend,'|'); global $_M, $_YW;
$strarr = stringto_array($this->fiend, '|');
foreach ($strarr as $value) { foreach ($strarr as $value) {
$arrstr[] = $val[$value]; $arrstr[] = $val[ $value ];
} }
return arrayto_string($arrstr,'|'); return arrayto_string($arrstr, '|');
} }
# allnone 默认选项全部处理 # allnone 默认选项全部处理
private function allnone() { private function allnone()
global $_M,$_YW; {
global $_M, $_YW;
// 若不需要显示‘全部’值,则直接返回空 // 若不需要显示‘全部’值,则直接返回空
// 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值 // 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值
// 1 为显示 显示‘全部’,同时也在未搜索结果的情况下 设置可选值 // 1 为显示 显示‘全部’,同时也在未搜索结果的情况下 设置可选值
// 2 只显示‘全部’ // 2 只显示‘全部’
// 3 只将未搜索到结果的情况下设置为可选值 // 3 只将未搜索到结果的情况下设置为可选值
if(empty($this->allnone) || $this->allnone == '3') return false; if (empty($this->allnone) || $this->allnone == '3') return false;
//然后可根据来源标记进行处理 //然后可根据来源标记进行处理
switch ($this->source) { switch ($this->source) {
// case 'githooks': // case 'githooks':
// $initial[] = ['id' => 'newver','text'=>'自动部署至最新版本']; // $initial[] = ['id' => 'newver','text'=>'自动部署至最新版本'];
// break; // break;
default: default:
$initial[] = [ 'id' => '','text' => '全部' ]; $initial[] = ['id' => '', 'text' => '全部'];
break; break;
} }
$this->data[] = ["text" => '',"children" => $initial ]; $this->data[] = ["text" => '', "children" => $initial];
} }
# 当未搜索到值是否将搜索结果设置为可选值 # 当未搜索到值是否将搜索结果设置为可选值
private function children() { private function children()
global $_M,$_YW; {
global $_M, $_YW;
// 判断是否要将搜索内容设置为可选值 // 判断是否要将搜索内容设置为可选值
if(empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false; if (empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false;
// 要注意id的是否为可写入数据库 误区,若有些字段为数字 则会导致无法录入成功 // 要注意id的是否为可写入数据库 误区,若有些字段为数字 则会导致无法录入成功
// 后期可增加一个判断方式来处理这个误区 // 后期可增加一个判断方式来处理这个误区
$this->data[] = [ $this->data[] = [
"text" => '', "text" => '',
"children" => [ "children" => [
['id'=> $this->querys,'text' => $this->querys] ['id' => $this->querys, 'text' => $this->querys]
] ]
]; ];
} }
# querys 处理 # querys 处理
private function querys() { private function querys()
global $_M,$_YW; {
$curdate = date('Y-m-d',time()); global $_M, $_YW;
$curdate = date('Y-m-d', time());
switch ($this->source) { switch ($this->source) {
case 'weblaunchsearch': case 'weblaunchsearch':
$this->where = " l_starttime <= '{$curdate}' "; $this->where = " l_starttime <= '{$curdate}' ";
// $this->where = " NOT ( l_endtime < '{$curdate}' OR l_starttime > '{$curdate}' ) "; // $this->where = " NOT ( l_endtime < '{$curdate}' OR l_starttime > '{$curdate}' ) ";
break; break;
case 'webcontractsearch': case 'webcontractsearch':
$this->where = " h.h_starttime <= '{$curdate}' "; $this->where = " h.h_starttime <= '{$curdate}' ";
@ -136,7 +143,7 @@ class select extends appweb {
break; break;
} }
if(strlen($this->querys) == 0) return false; if (strlen($this->querys) == 0) return false;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
@ -164,56 +171,59 @@ class select extends appweb {
} }
# condition 处理 # condition 处理
private function condition() { private function condition()
global $_M,$_YW; {
if(empty($this->condition)) return false; global $_M, $_YW;
if (empty($this->condition)) return false;
// 进行处理 // 进行处理
$condition = stringto_array($this->condition,'|||','$$$'); $condition = stringto_array($this->condition, '|||', '$$$');
foreach ($condition as $value) { foreach ($condition as $value) {
list($key,$val) = $value; list($key, $val) = $value;
$valstr[] = " {$key} = '{$val}' "; $valstr[] = " {$key} = '{$val}' ";
} }
$valstr = arrayto_string($valstr,' AND '); $valstr = arrayto_string($valstr, ' AND ');
if(strlen($valstr) > 0){ if (strlen($valstr) > 0) {
if(!empty($this->where)) $this->where = " ({$this->where}) AND "; if (!empty($this->where)) $this->where = " ({$this->where}) AND ";
$this->where .= $valstr; $this->where .= $valstr;
} }
} }
# 选项值的组成样式 # 选项值的组成样式
private function valuet($val) { private function valuet($val)
global $_M,$_YW; {
global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$fiend = [$val['v_name'],$val['v_province'].$val['v_city'].$val['v_district'].$val['v_address']]; $fiend = [$val['v_name'], $val['v_province'] . $val['v_city'] . $val['v_district'] . $val['v_address']];
break; break;
case 'customer': case 'customer':
$fiend = [$val['c_name'],$val['c_allname'],$val['c_province'].$val['c_city'].$val['c_district'].$val['c_address']]; $fiend = [$val['c_name'], $val['c_allname'], $val['c_province'] . $val['c_city'] . $val['c_district'] . $val['c_address']];
break; break;
case 'workers': case 'workers':
$fiend = [$val['w_name'],$val['w_tel']]; $fiend = [$val['w_name'], $val['w_tel']];
break; break;
case 'contract': case 'contract':
$fiend = [$val['h_number'],$val['c_allname']]; $fiend = [$val['h_number'], $val['c_allname']];
break; break;
case 'launch': case 'launch':
$fiend = [$val['l_title'],$val['l_hnumber']]; $fiend = [$val['l_title'], $val['l_hnumber']];
break; break;
case 'weuser': case 'weuser':
$sex = ['未知','男','女']; $sex = ['未知', '男', '女'];
$fiend = [$val['nickname'],$sex[$val['sex']] ]; $fiend = [$val['nickname'], $sex[ $val['sex'] ]];
break; break;
default: default:
break; break;
} }
$text = arrayto_string($fiend,' / '); $text = arrayto_string($fiend, ' / ');
return $text; return $text;
} }
//编号字段,根据此字段进行编号处理 //编号字段,根据此字段进行编号处理
private function charter() { private function charter()
global $_M,$_YW; {
global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
$fiend = 'v_name'; $fiend = 'v_name';
@ -242,8 +252,9 @@ class select extends appweb {
// 查看场所名称列表 // 查看场所名称列表
public function doselect() { public function doselect()
global $_M,$_YW; {
global $_M, $_YW;
//判断条件 //判断条件
self::querys(); self::querys();
//带入的判断条件 //带入的判断条件
@ -252,23 +263,23 @@ class select extends appweb {
$fiend = self::charter(); $fiend = self::charter();
//查询 //查询
if($this->tname != 'contract'){ if ($this->tname != 'contract') {
$array = $this->tsql->table($this->tname)->where($this->where)->order('id DESC')->all('id'); $array = $this->tsql->table($this->tname)->where($this->where)->order('id DESC')->all('id');
}else{ } else {
$array = $this->tsql->table_unset() $array = $this->tsql->table_unset()
->tables([$this->tname,'h'], 'LEFT JOIN') ->tables([$this->tname, 'h'], 'LEFT JOIN')
->tables(['customer','c'], 'ON h.h_cid = c.id') ->tables(['customer', 'c'], 'ON h.h_cid = c.id')
->where($this->where) ->where($this->where)
->qfield(" h.*,c.c_allname ") ->qfield(" h.*,c.c_allname ")
->order('h.id DESC')->all('id'); ->order('h.id DESC')->all('id');
} }
// dump($this->tsql->query()); // dump($this->tsql->query());
foreach ($array as $val) { foreach ($array as $val) {
if($this->tname == 'weuser'){ if ($this->tname == 'weuser') {
$val['nickname'] = urldecode($val['nickname']); $val['nickname'] = urldecode($val['nickname']);
} }
$letter = getstrcharter($val[$fiend]); $letter = getstrcharter($val[ $fiend ]);
$selectlist[$letter][] = $val; $selectlist[ $letter ][] = $val;
} }
//是否显示全部 //是否显示全部
@ -277,29 +288,29 @@ class select extends appweb {
self::children(); self::children();
//处理结果 //处理结果
foreach ($selectlist as $key => $val){ foreach ($selectlist as $key => $val) {
$arr = []; $arr = [];
foreach ($val as $v) { foreach ($val as $v) {
$valid = self::select_fiend($v); $valid = self::select_fiend($v);
//判断是否只输出默认值 //判断是否只输出默认值
if(strlen($this->default) > 0){ if (strlen($this->default) > 0) {
$default = stringto_array($this->default, $this->division); $default = stringto_array($this->default, $this->division);
if(!in_array($valid, $default,true)) continue; if (!in_array($valid, $default, true)) continue;
} }
//组成选项 //组成选项
$arr[] = ['id' => $valid, 'text' => self::valuet($v)]; $arr[] = ['id' => $valid, 'text' => self::valuet($v)];
} }
$this->data[] = ["text" => $key,"children" => $arr]; $this->data[] = ["text" => $key, "children" => $arr];
} }
//当值不存在时 //当值不存在时
if(!count($this->data)){ if (!count($this->data)) {
//输出没有搜索到结果 //输出没有搜索到结果
$this->data = [["text" => $this->querys == ''?'检索不到相关信息':"检索不到 {$this->querys} 相关信息","children" => [] ]]; $this->data = [["text" => $this->querys == '' ? '检索不到相关信息' : "检索不到 {$this->querys} 相关信息", "children" => []]];
}else{ } else {
//对数组排序A-ZZ //对数组排序A-ZZ
$text = array_column($this->data, 'text'); $text = array_column($this->data, 'text');
array_multisort($text,SORT_ASC,$this->data); array_multisort($text, SORT_ASC, $this->data);
} }
echo jsoncallback(['results' => $this->data]); echo jsoncallback(['results' => $this->data]);

View File

@ -7,7 +7,8 @@ load::own_class('../traits/tlist');
load::own_class('../traits/tfield'); load::own_class('../traits/tfield');
//表格 //表格
class table_ajax extends appweb { class table_ajax extends appweb
{
# 过滤方法名 # 过滤方法名
private $ado = ['doindex']; private $ado = ['doindex'];
@ -26,26 +27,28 @@ class table_ajax extends appweb {
private $own_name_info; private $own_name_info;
private $own_name_table; private $own_name_table;
public function __construct() { public function __construct()
global $_M,$_YW; {
global $_M, $_YW;
parent::__construct(); parent::__construct();
// 过滤 // 过滤
if (!in_array(M_ACTION, $this->ado,true)) { if (!in_array(M_ACTION, $this->ado, true)) {
//报错 //报错
exit(0); exit(0);
} }
$this->form = $_M['form']; $this->form = $_M['form'];
if($this->form['tname']){ if ($this->form['tname']) {
$this->tname = $this->form['tname']; $this->tname = $this->form['tname'];
$this->sqlk = $_YW['k'][$this->tname]; $this->sqlk = $_YW['k'][ $this->tname ];
} }
//地址要换算成前台的,目前是后台的 //地址要换算成前台的,目前是后台的
// $this->own_name_info = $_M['url']['own_name'].'c=info_on&a=do'; // $this->own_name_info = $_M['url']['own_name'].'c=info_on&a=do';
// $this->own_name_table = $_M['url']['own_name'].'c=table_on&a=do'; // $this->own_name_table = $_M['url']['own_name'].'c=table_on&a=do';
} }
//表格数据 //表格数据
public function doindex() { public function doindex()
{
global $_M; global $_M;
//加载表格数据获取类 //加载表格数据获取类
$table = load::own_class('tabledata', 'new'); $table = load::own_class('tabledata', 'new');
@ -55,17 +58,17 @@ class table_ajax extends appweb {
$where = self::td_where(); $where = self::td_where();
$order = self::td_order(); $order = self::td_order();
/*查询表*/ /*查询表*/
if($where){ if ($where) {
$conds .= " WHERE {$where} "; $conds .= " WHERE {$where} ";
} }
if($order){ if ($order) {
$conds .= " ORDER BY {$order} "; $conds .= " ORDER BY {$order} ";
} }
//整理查询条件 //整理查询条件
$query = "SELECT {$field} FROM {$sqlk} {$conds} "; $query = "SELECT {$field} FROM {$sqlk} {$conds} ";
//获取数据 //获取数据
$data = $table->getdata($sqlk, $field, $where, $order,$query,$this->multi_table); $data = $table->getdata($sqlk, $field, $where, $order, $query, $this->multi_table);
//数据整理 //数据整理
$array = self::sqlarr($data); $array = self::sqlarr($data);
//返回数据 //返回数据
@ -78,28 +81,30 @@ class table_ajax extends appweb {
* 【列出】 * 【列出】
* 返回数据数组 * 返回数据数组
*/ */
private function sqlarr($data = []) { private function sqlarr($data = [])
{
global $_M; global $_M;
// if(in_array($this->tname,$this->k_name)){ // if(in_array($this->tname,$this->k_name)){
foreach ($data as $val) { foreach ($data as $val) {
self::output($val); self::output($val);
$array[] = $this->list; $array[] = $this->list;
} }
return $array; return $array;
// }else{ // }else{
// return false; // return false;
// } // }
} }
/* /*
* 【新行】 * 【新行】
* 新增行分发 * 新增行分发
*/ */
public function do_table_add_list(){ public function do_table_add_list()
{
global $_M; global $_M;
$val = ['id' => 'new-'.$this->form['new_id'], 'p_type' => $this->form['p_type']]; $val = ['id' => 'new-' . $this->form['new_id'], 'p_type' => $this->form['p_type']];
if(in_array($this->tname,$this->k_name)){ if (in_array($this->tname, $this->k_name)) {
self::output($val,'checked=""'); self::output($val, 'checked=""');
} }
self::addlist($val); self::addlist($val);
} }
@ -108,11 +113,12 @@ class table_ajax extends appweb {
* 【新行】 * 【新行】
* 生成文件新增行 * 生成文件新增行
*/ */
private function addlist($val) { private function addlist($val)
{
global $_M; global $_M;
$metinfo = ''; $metinfo = '';
foreach ($this->list as $v){ foreach ($this->list as $v) {
$metinfo .= '<td class=" text-xs-center">'.$v.'</td>'; $metinfo .= '<td class=" text-xs-center">' . $v . '</td>';
} }
echo "<tr>{$metinfo}</tr>"; echo "<tr>{$metinfo}</tr>";
} }
@ -121,9 +127,10 @@ class table_ajax extends appweb {
use tlist; use tlist;
//公用的输出 //公用的输出
protected function output($val,$checked = '') { protected function output($val, $checked = '')
global $_M,$_YW; {
$array = self::{$this->tname}($val,$checked); global $_M, $_YW;
$array = self::{$this->tname}($val, $checked);
$this->list = array(); $this->list = array();
foreach ($array as $value) { foreach ($array as $value) {
$this->list[] = $value; $this->list[] = $value;

View File

@ -3,7 +3,8 @@
.form-inline .form-group { .form-inline .form-group {
margin-right: 20px; margin-right: 20px;
} }
@media (min-width: 480px){
@media (min-width: 480px) {
.form-inline .form-group, .form-inline .form-control { .form-inline .form-group, .form-inline .form-control {
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
@ -11,27 +12,45 @@
vertical-align: middle; vertical-align: middle;
} }
} }
/*在帮脑残修复一下*/ /*在帮脑残修复一下*/
table .form-inline .form-group { table .form-inline .form-group {
margin-right: 0px; margin-right: 0px;
} }
@media (min-width: 480px){
@media (min-width: 480px) {
table .form-inline .form-group, table .form-inline .form-control { table .form-inline .form-group, table .form-inline .form-control {
display: block; display: block;
width: 100%; width: 100%;
} }
} }
.cloudweb input[name="gotopage"]{
display: inline-block!important; .cloudweb input[name="gotopage"] {
display: inline-block !important;
} }
.cloudweb .gotopage{
.cloudweb .gotopage {
display: none; display: none;
} }
@media (max-width: 767px){ @media (max-width: 767px) {
.cloudweb div.m-y-80{margin-top: 0px!important;} .cloudweb div.m-y-80 {
div.dataTables_paginate .paginate_button>a{padding: .429rem .780rem;} margin-top: 0px !important;
.form-inline .form-group{margin-right: 0px;} }
.cloudweb select[name="e_vid"]{max-width: auto;}
.cloudweb .input-group .select2-container--default{width: 100%!important;} div.dataTables_paginate .paginate_button > a {
padding: .429rem .780rem;
}
.form-inline .form-group {
margin-right: 0px;
}
.cloudweb select[name="e_vid"] {
max-width: auto;
}
.cloudweb .input-group .select2-container--default {
width: 100% !important;
}
} }

View File

@ -3,41 +3,41 @@
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved. # Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
?> ?>
<script> <script>
var MET=[]; var MET = [];
MET['url']=[]; MET['url'] = [];
MET['langtxt'] = { MET['langtxt'] = {
"jsx15":"{$_M['word']['jsx15']}", "jsx15" : "{$_M['word']['jsx15']}",
"js35":"{$_M['word']['js35']}", "js35" : "{$_M['word']['js35']}",
"jsx17":"{$_M['word']['jsx17']}", "jsx17" : "{$_M['word']['jsx17']}",
"formerror1":"{$_M['word']['formerror1']}", "formerror1" : "{$_M['word']['formerror1']}",
"formerror2":"{$_M['word']['formerror2']}", "formerror2" : "{$_M['word']['formerror2']}",
"formerror3":"{$_M['word']['formerror3']}", "formerror3" : "{$_M['word']['formerror3']}",
"formerror4":"{$_M['word']['formerror4']}", "formerror4" : "{$_M['word']['formerror4']}",
"formerror5":"{$_M['word']['formerror5']}", "formerror5" : "{$_M['word']['formerror5']}",
"formerror6":"{$_M['word']['formerror6']}", "formerror6" : "{$_M['word']['formerror6']}",
"formerror7":"{$_M['word']['formerror7']}", "formerror7" : "{$_M['word']['formerror7']}",
"formerror8":"{$_M['word']['formerror8']}", "formerror8" : "{$_M['word']['formerror8']}",
"js46":"{$_M['word']['js46']}", "js46" : "{$_M['word']['js46']}",
"js23":"{$_M['word']['js23']}", "js23" : "{$_M['word']['js23']}",
"checkupdatetips":"{$_M['word']['checkupdatetips']}", "checkupdatetips": "{$_M['word']['checkupdatetips']}",
"detection":"{$_M['word']['detection']}", "detection" : "{$_M['word']['detection']}",
"try_again":"{$_M['word']['try_again']}", "try_again" : "{$_M['word']['try_again']}",
"fileOK":"{$_M['word']['fileOK']}", "fileOK" : "{$_M['word']['fileOK']}",
}; };
MET['met_editor']="{$_M['config']['met_editor']}"; MET['met_editor'] = "{$_M['config']['met_editor']}";
MET['met_keywords']="{$_M['config']['met_keywords']}"; MET['met_keywords'] = "{$_M['config']['met_keywords']}";
MET['url']['ui']="{$_M['url']['ui']}"; MET['url']['ui'] = "{$_M['url']['ui']}";
MET['url']['own']="{$_M['url']['own']}"; MET['url']['own'] = "{$_M['url']['own']}";
MET['url']['own_tem']="{$_M['url']['own_tem']}"; MET['url']['own_tem'] = "{$_M['url']['own_tem']}";
MET['url']['api']="{$_M['url']['api']}"; MET['url']['api'] = "{$_M['url']['api']}";
</script> </script>
<met_foot /> <met_foot/>
<if value="!$c['shopv2_open']"> <if value="!$c['shopv2_open']">
<?php $app_js_time = filemtime(PATH_WEB.'public/ui/v2/static/js/app.js'); ?> <?php $app_js_time = filemtime(PATH_WEB . 'public/ui/v2/static/js/app.js'); ?>
<script src="{$_M['url']['site']}public/ui/v2/static/js/app.js?{$app_js_time}"></script> <script src="{$_M['url']['site']}public/ui/v2/static/js/app.js?{$app_js_time}"></script>
</if> </if>
<?php if(file_exists(PATH_OWN_FILE."templates/met/js/own.js") && !((M_NAME=='product' || M_NAME=='shop') && $_M['config']['shopv2_open'])){ <?php if (file_exists(PATH_OWN_FILE . "templates/met/js/own.js") && !((M_NAME == 'product' || M_NAME == 'shop') && $_M['config']['shopv2_open'])) {
$own_js_time = filemtime(PATH_OWN_FILE.'templates/met/js/own.js'); $own_js_time = filemtime(PATH_OWN_FILE . 'templates/met/js/own.js');
?> ?>
<script src="{$_M['url']['own_tem']}js/own.js?{$own_js_time}"></script><?php } ?> <script src="{$_M['url']['own_tem']}js/own.js?{$own_js_time}"></script><?php } ?>

View File

@ -3,12 +3,12 @@
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved. # Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
?> ?>
<include file="metinfo.inc.php"/> <include file="metinfo.inc.php"/>
<?php $met_page=$template_type=='ui'?'index':''; ?> <?php $met_page = $template_type == 'ui' ? 'index' : ''; ?>
<met_meta page="$met_page" /> <met_meta page="$met_page"/>
<?php <?php
if(file_exists(PATH_OWN_FILE."templates/met/css/metinfo.css")){ if (file_exists(PATH_OWN_FILE . "templates/met/css/metinfo.css")) {
$own_metinfo_css_filemtime = filemtime(PATH_OWN_FILE.'templates/met/css/metinfo.css'); $own_metinfo_css_filemtime = filemtime(PATH_OWN_FILE . 'templates/met/css/metinfo.css');
?> ?>
<link href="{$_M['url']['own_tem']}css/metinfo.css?{$own_metinfo_css_filemtime}" rel='stylesheet' type='text/css'> <link href="{$_M['url']['own_tem']}css/metinfo.css?{$own_metinfo_css_filemtime}" rel='stylesheet' type='text/css'>
<?php } ?> <?php } ?>

View File

@ -14,7 +14,8 @@ $data['page_title'] = $data['app']['column']['name'] . $data['page_title'];
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">密钥</span> <span class="input-group-addon">密钥</span>
<input type="password" class="form-control" placeholder="输入身份密钥" name="check" autocomplete="off"> <input type="password" class="form-control" placeholder="输入身份密钥" name="check"
autocomplete="off">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="submit" class="btn btn-primary">提交</button> <button type="submit" class="btn btn-primary">提交</button>
</span> </span>

View File

@ -35,82 +35,83 @@
* M['url']['editor'] 当前编辑器应用文件夹路径 * M['url']['editor'] 当前编辑器应用文件夹路径
*/ */
$(function () { $(function () {
var myDate=new Date().getTime(); var myDate = new Date().getTime();
var appfun = function () { var appfun = function () {
var $self = this; var $self = this;
if($self.isEmpty(M['n'])) M['n'] = $('div[data-m_name]').data('m_name'); if ($self.isEmpty(M['n'])) M['n'] = $('div[data-m_name]').data('m_name');
$self.own_name = M['weburl'] + 'app/index.php?n=' + M['n']; $self.own_name = M['weburl'] + 'app/index.php?n=' + M['n'];
$self.config(); $self.config();
//select2 //select2
if($('[data-plugin="select2"]').length) $self.select2(true); if ($('[data-plugin="select2"]').length) $self.select2(true);
}; };
appfun.prototype = { appfun.prototype = {
config:function(){ config : function () {
var $self = this; var $self = this;
$.ajax({ $.ajax({
type: "GET", type : "GET",
url: $self.own_name + '&c=index&a=doajaxcl&lang=' + M['lang'], url : $self.own_name + '&c=index&a=doajaxcl&lang=' + M['lang'],
dataType: "jsonp", dataType: "jsonp",
async: false async : false
}).done(function (data) { }).done(function (data) {
CL = data; CL = data;
}); });
}, },
select2:function(drawdt){ select2: function (drawdt) {
// drawdt true 执行默认操作 false 不执行 // drawdt true 执行默认操作 false 不执行
var $self = this,select = []; var $self = this,
select = [];
//选择器 //选择器
M['plugin']['select2'] = [ M['plugin']['select2'] = [
M['url']['static2_vendor'] + 'select2/select2.min.css', M['url']['static2_vendor'] + 'select2/select2.min.css',
M['url']['static2_vendor'] + 'select2/select2.full.min.js', M['url']['static2_vendor'] + 'select2/select2.full.min.js',
M['url']['static2_vendor'] + 'select2/i18n/zh-CN.js', M['url']['static2_vendor'] + 'select2/i18n/zh-CN.js',
]; ];
$.include(M['plugin']['select2'],function(){ $.include(M['plugin']['select2'], function () {
$('[data-plugin="select2"]').each(function(indexs,item){ $('[data-plugin="select2"]').each(function (indexs, item) {
var _self = $(this), var _self = $(this),
defaults = _self.data('default'), defaults = _self.data('default'),
select2url = _self.data('select2-url') + '&'+ myDate; select2url = _self.data('select2-url') + '&' + myDate;
select[indexs] = _self.select2({ select[indexs] = _self.select2({
placeholder: '输入搜索内容', //提示语 placeholder: '输入搜索内容', //提示语
ajax: { ajax : {
url: select2url, url : select2url,
dataType: 'jsonp', dataType: 'jsonp',
delay: 500, delay : 500,
data: function (params) { data : function (params) {
return { return {
querys: params.term, //search term querys : params.term, //search term
tname: _self.data('tname'), //指定简短表 tname : _self.data('tname'), //指定简短表
fiend: _self.data('fiend'), //指定字段值 fiend : _self.data('fiend'), //指定字段值
allnone: _self.data('allnone'), //是否只显示应用的值 allnone : _self.data('allnone'), //是否只显示应用的值
source: _self.data('source'), //查看来源标记 source : _self.data('source'), //查看来源标记
condition: _self.data('condition') //查询限制条件 condition: _self.data('condition') //查询限制条件
}; };
}, },
results: function (data, page) { results : function (data, page) {
return {results: data.results}; return {results: data.results};
} }
} }
}); });
//默认值处理 //默认值处理
if(!$self.isEmpty(defaults) && drawdt == true){ if (!$self.isEmpty(defaults) && drawdt == true) {
$.getJSON( $.getJSON(
select2url, select2url,
{ {
tname: _self.data('tname'), //指定简短表 tname : _self.data('tname'), //指定简短表
fiend: _self.data('fiend'), //指定字段值 fiend : _self.data('fiend'), //指定字段值
allnone: _self.data('allnone'), //是否只显示应用的值 allnone : _self.data('allnone'), //是否只显示应用的值
source: _self.data('source'), //查看来源标记 source : _self.data('source'), //查看来源标记
condition: _self.data('condition'), //查询限制条件 condition: _self.data('condition'), //查询限制条件
default: defaults, //默认值 default : defaults, //默认值
division: _self.data('division') //默认值分隔符 division : _self.data('division') //默认值分隔符
}, },
function(obj){ function (obj) {
$.each(obj.results, function(index, ele) { $.each(obj.results, function (index, ele) {
$.each(ele.children, function(indexop, eleop) { $.each(ele.children, function (indexop, eleop) {
var option = new Option(eleop.text, eleop.id, true, true); var option = new Option(eleop.text, eleop.id, true, true);
select[indexs].append(option).trigger('change'); select[indexs].append(option).trigger('change');
}) })

View File

@ -14,12 +14,15 @@ $data['page_title'] = $data['app']['column']['name'] . $data['page_title'];
<!--头部搜索--> <!--头部搜索-->
{$data.table.search} {$data.table.search}
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-5" id='test-table' data-table-ajaxurl="{$data.url}" data-table-pagelength='15'> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-5" id='test-table'
data-table-ajaxurl="{$data.url}" data-table-pagelength='15'>
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody> <tbody>
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -27,10 +27,10 @@ class timing extends appweb
header('Access-Control-Allow-Methods:post'); header('Access-Control-Allow-Methods:post');
ob_start(); ob_start();
//Windows服务器需要加上这行。 //Windows服务器需要加上这行。
echo 'API响应时间'.date('Y-m-d H:i:s', $this->time).str_repeat(" ",4096); echo 'API响应时间' . date('Y-m-d H:i:s', $this->time) . str_repeat(" ", 4096);
//----------------------------------加快信息响应------中段--------------------------- //----------------------------------加快信息响应------中段---------------------------
// 过滤 // 过滤
if (!in_array(M_ACTION, $this->ado,true)) { if (!in_array(M_ACTION, $this->ado, true)) {
//报错 //报错
exit(0); exit(0);
} }
@ -54,9 +54,9 @@ class timing extends appweb
global $_M, $_YW; global $_M, $_YW;
$this->webase = load::own_class('../met_wechat/include/class/LW_BASE', 'new'); $this->webase = load::own_class('../met_wechat/include/class/LW_BASE', 'new');
//当天日期时间 //当天日期时间
$curdate = date('Y-m-d',$this->time); $curdate = date('Y-m-d', $this->time);
$strdate = strtotime($curdate); $strdate = strtotime($curdate);
$num = ['daya' => 0,'dayb' => 0,'dayc' => 0]; $num = ['daya' => 0, 'dayb' => 0, 'dayc' => 0];
//查询到期订单 //查询到期订单
//查询的是设置的提醒天数以及订单结束日期的前后3天数 //查询的是设置的提醒天数以及订单结束日期的前后3天数
$where = " endtime = CURDATE() OR (h_endtime BETWEEN CURDATE() AND DATE_ADD( CURDATE(), INTERVAL 3 DAY ) ) "; $where = " endtime = CURDATE() OR (h_endtime BETWEEN CURDATE() AND DATE_ADD( CURDATE(), INTERVAL 3 DAY ) ) ";
@ -68,22 +68,22 @@ class timing extends appweb
//首先判断当前这条信息是属于到期前台3天的 还是属于设置的提醒 //首先判断当前这条信息是属于到期前台3天的 还是属于设置的提醒
//那就是判断订单结束时间和今天的相差天数 //那就是判断订单结束时间和今天的相差天数
$day = abs(($h_endtime - $strdate) / 86400); $day = abs(($h_endtime - $strdate) / 86400);
if($day > 3){ if ($day > 3) {
//按照设置的提醒来计算 //按照设置的提醒来计算
$htypes = "合同 {$val['noticeday']} 天后到期提醒"; $htypes = "合同 {$val['noticeday']} 天后到期提醒";
//蓝色 //蓝色
$color = "#57c7d4"; $color = "#57c7d4";
$type = 1; $type = 1;
$num['daya']++; $num['daya']++;
}else{ } else {
//说明还没到期 //说明还没到期
if($h_endtime > $strdate){ if ($h_endtime > $strdate) {
$htypes = "合同 {$day} 天后到期"; $htypes = "合同 {$day} 天后到期";
//黄色 //黄色
$color = "#f2a654"; $color = "#f2a654";
$type = 1; $type = 1;
$num['dayb']++; $num['dayb']++;
}else{ } else {
$htypes = "合同今天到期"; $htypes = "合同今天到期";
//红色 //红色
$color = "#F96868"; $color = "#F96868";
@ -96,7 +96,7 @@ class timing extends appweb
$customer = $this->tsql->table('customer')->where(['id' => $val['h_cid']])->one(); $customer = $this->tsql->table('customer')->where(['id' => $val['h_cid']])->one();
//签定人员 //签定人员
$w_name = []; $w_name = [];
$workerswid = stringto_array($val['h_wid'],','); $workerswid = stringto_array($val['h_wid'], ',');
foreach ($workerswid as $hwid) { foreach ($workerswid as $hwid) {
$workers = $this->tsql->table('workers')->where(['id' => $hwid])->one(); $workers = $this->tsql->table('workers')->where(['id' => $hwid])->one();
$w_name[] = $workers['w_name']; $w_name[] = $workers['w_name'];
@ -105,16 +105,16 @@ class timing extends appweb
//整理内容 //整理内容
$val['first'] = ['value' => $htypes, 'color' => $color]; $val['first'] = ['value' => $htypes, 'color' => $color];
$val['c_allname'] = $customer['c_allname']; $val['c_allname'] = $customer['c_allname'];
$val['wnamestr'] = arrayto_string($w_name,''); $val['wnamestr'] = arrayto_string($w_name, '');
//发送通知 //发送通知
parent::postdata($type,$val)->openid(); parent::postdata($type, $val)->openid();
} }
//以上为定时通知或者到期通知 //以上为定时通知或者到期通知
//增加一个今天要上架的投放 //增加一个今天要上架的投放
$num['dayd'] = $this->tsql->table('launch')->where(" l_starttime = CURDATE() ")->count(); $num['dayd'] = $this->tsql->table('launch')->where(" l_starttime = CURDATE() ")->count();
parent::postdata(3,$num)->openid(); parent::postdata(3, $num)->openid();
die(); die();
} }