提交 8acb4822 authored 作者: chengye's avatar chengye

修复账单表数据总数不一致

...@@ -20,4 +20,6 @@ ...@@ -20,4 +20,6 @@
/public/dist2 /public/dist2
/public/static/uploads /public/static/uploads
/public/static/xadmin /public/static/xadmin
/application/admin/view/staff/role.html /application/admin/view/staff/role.html
\ No newline at end of file /config/jz.php
/config/cookie.php
...@@ -60,11 +60,7 @@ ...@@ -60,11 +60,7 @@
<script src="dist/js/md5.js"></script> <script src="dist/js/md5.js"></script>
<script src="dist/js/sha1.js"></script> <script src="dist/js/sha1.js"></script>
<script src="dist/js/util.js"></script> <script src="dist/js/util.js"></script>
<<<<<<< HEAD
<!--<script src="dist/js/getUserToken.js"></script>--> <!--<script src="dist/js/getUserToken.js"></script>-->
=======
<!-- <script src="dist/js/getUserToken.js"></script> -->
>>>>>>> test
<script> <script>
layui.use(['laydate','form','upload'], function(){ layui.use(['laydate','form','upload'], function(){
upload = layui.upload; upload = layui.upload;
......
<?php
namespace app\em\controller;
use app\admin\controller\Base;
use app\em\model\EmInvoice;
use app\em\model\EmPaymentReceipt;
use app\em\model\EmReceiptType;
use app\em\validate\AddReceiptValidate;
use think\facade\Request;
/**
* 缴费发票
* Class Receipt
* @package app\em\controller
*/
class Receipt extends Base
{
//显示缴费凭证表单
public function create(){
$payment_id = Request::param('payment_id');
//将缴费应缴金额传递给模板
$balance = (new EmInvoice())->alias('ei')
->leftJoin(['em_payment_invoice'=>'epi'],'epi.invoice_id=ei.invoice_id')
->where('epi.payment_id','=',$payment_id)
->where('ei.payment_balance','>',0)
->sum('ei.payment_balance');
$this->assign('balance',$balance?:0);
$this->assign('payment_id',$payment_id);
$types = EmReceiptType::select();
$this->assign('types',$types);
return $this->fetch();
}
public function store(){
$data = Request::post();
$validata = new AddReceiptValidate();
if(!$validata->check($data)){
return json(['status'=>0,'message'=>$validata->getError()]);
}
//获取certId
$data['receipt_id'] = $this->createReceiptId();
//保存凭证
$receiptModel = new EmPaymentReceipt();
if($receiptModel->save($data)){
//更新缴费单状态
return json(['status'=>1,'message'=>'上传发票成功']);
} else {
return json(['status'=>0,'message'=>'添加发票失败']);
}
}
//查看列表
public function receipts(){
$payment_id = Request::param('payment_id');
$list = EmPaymentReceipt::with('file,types')->where('payment_id','=',$payment_id)->order('receipt_id asc')->select();
foreach ($list as &$item){
if(!empty($item->file->src)){
$item->file->src = ltrim($item->file->src,'.');
}
}
$this->assign('data',$list);
return $this->fetch('list');
}
//创建凭证id
private function createReceiptId(){
$epr = EmPaymentReceipt::field('id')->order('id desc,create_time desc')->find();
if(!$epr) $id = 1;
else $id = $epr->id + 1;
return "RT".date('Ymd').zero($id);
}
}
\ No newline at end of file
<?php <?php
/** /**
* v2 地图模块 * v2 地图模块
*/ */
namespace app\em\controller; namespace app\em\controller;
use app\admin\controller\Base; use app\admin\controller\Base;
use app\admin\model\DepartmentModel; use app\admin\model\DepartmentModel;
use app\admin\model\ElectricMeter; use app\admin\model\ElectricMeter;
use app\admin\model\ElectricMeterType; use app\admin\model\ElectricMeterType;
use app\admin\model\OperatorModel; use app\admin\model\OperatorModel;
use app\admin\model\StaffModel; use app\admin\model\StaffModel;
use app\admin\model\BaseStationModel; use app\admin\model\BaseStationModel;
use think\db;
use think\Exception; use think\Exception;
use think\facade\Request; use think\facade\Request;
use think\facade\Session; use think\facade\Session;
class Region extends Base class Region extends Base
{ {
public function region_list(){ public function region_list(){
if (!Request::instance()->isAjax()){ $db = Db::connect([
$this->assign('search_type',''); 'type' => config('jz.jztype'),
$this->assign('search_text',''); 'hostname' => config('jz.jzhostname'),
$this->assign('operator',''); 'database' => config('jz.jzdatabase'),
$this->assign('area_id',''); 'username' => config('jz.jzusername'),
$region=new ElectricMeter(); 'password' => config('jz.jzpassword'),
$operator=new OperatorModel(); 'hostport' =>config('jz.jzhostport'),
$operators = OperatorModel::field('operator_id,operator_name')->where('operator_state','=',1)->select()->toArray(); 'charset' => config('jz.jzcharset'),
$this->assign('regions',getTree($region->regions())); ]);
$this->assign('operators',$operators);
return $this->fetch(); if (!Request::instance()->isAjax()){
}else{ $this->assign('search_type','');
$map=[]; $this->assign('search_text','');
$aa= Request::param('type'); $this->assign('operator','');
if($aa==1){ $this->assign('area_id','');
$data= Request::param('data'); $region=new ElectricMeter();
$search_text=$data['search_text']; $operator=new OperatorModel();
$search_type=$data['search_type']; $operators = OperatorModel::field('operator_id,operator_name')->where('operator_state','=',1)->select()->toArray();
if($search_text){ $this->assign('regions',getTree($region->regions()));
switch ($search_type) { $this->assign('operators',$operators);
case '1': return $this->fetch();
$this->assign('search_text',$search_text); }else{
$map[]=['station_info.station_name','like',"%$search_text%"]; $map=[];
$this->assign('search_type',$search_type); $aa= Request::param('type');
break; if($aa==1){
case '2': $data= Request::param('data');
$this->assign('search_text',$search_text); $search_text=$data['search_text'];
$map[]=['station_info.station_sp_code','like',"%$search_text%"]; $search_type=$data['search_type'];
$this->assign('search_type',$search_type); if($search_text){
break; switch ($search_type) {
case '3': case '1':
$this->assign('search_text',$search_text); $this->assign('search_text',$search_text);
$map[]=['station_info.proj_number','like',"%$search_text%"]; $map[]=['jz_name','like',"%$search_text%"];
$this->assign('search_type',$search_type); $this->assign('search_type',$search_type);
break; break;
case '2':
} $this->assign('search_text',$search_text);
}else{ $map[]=['jz_code','like',"%$search_text%"];
$this->assign('search_type',''); $this->assign('search_type',$search_type);
$this->assign('search_text',''); break;
} case '3':
$this->assign('search_text',$search_text);
$map[]=['project_code','like',"%$search_text%"];
$operator = $data['operator']; $this->assign('search_type',$search_type);
if($operator){ break;
$map[] = ['station_info.original_sp_id','=',$operator];
$this->assign('operator',$operator); }
}else{ }else{
$this->assign('operator',''); $this->assign('search_type','');
} $this->assign('search_text','');
$area_id =$data['area_id']; }
if($area_id){
$map[] = ['station_info.area_id','=',$area_id];
$this->assign('area_id',$area_id); // $operator = $data['operator'];
}else{ // if($operator){
$this->assign('area_id',''); // $map[] = ['jz_yys','=',$operator];
} // $this->assign('operator',$operator);
if(!$map){ // }else{
echo 0;die; // $this->assign('operator','');
} // }
// $area_id =$data['area_id'];
//权限检测 // if($area_id){
$user = Session::get('user'); // $map[] = ['jz_qy','=',$area_id];
if(!$user['is_admin']){ // $this->assign('area_id',$area_id);
$permissionData=check_data(); // }else{
if($permissionData){ // $this->assign('area_id','');
$map[]=$permissionData; // }
} if(!$map){
} echo 0;die;
$map[] = ['d.longitude','neq',""]; }
$map[] = ['d.latitude','neq',""];
$datalist= BaseStationModel::field('station_id,station_name,proj_number,longitude,latitude')->leftJoin(['station_info_detai'=>'d'],'station_info.station_id = d.stationid')->where($map)->limit(200)->select()->toArray(); //权限检测
}else{ $user = Session::get('user');
$map1=[]; if(!$user['is_admin']){
//权限检测 $permissionData=check_data();
$user = Session::get('user'); if($permissionData){
if(!$user['is_admin']){ $map[]=$permissionData;
$permissionData=check_data(); }
if($permissionData){ }
$map1[]=$permissionData; $map[] = ['jz_latitude','neq',""];
} $map[] = ['jz_latitude','neq',""];
}
$position= Request::param('data');
$datalist= $db->table('jz_message')->field('business_id,jz_name,project_code,jz_longitude,jz_latitude')->where($map)->select();
$ff= $position['lng'];
$ee= $position['lat'];
$fff=$ff+"0.200000"; if(!$datalist){
$eee=$ee+"0.200000"; echo 0;die;
$map1[] = ['d.longitude','between',"$ff,$fff"]; }
$map1[] = ['d.latitude','between',"$ee,$eee"]; $lats = $lons = array();
$datalist= BaseStationModel::field('station_id,station_name,proj_number,longitude,latitude')->leftJoin(['station_info_detai'=>'d'],'station_info.station_id = d.stationid')->where($map1)->select()->toArray(); foreach ($datalist as $key => $value) {
array_push($lats, $value['jz_latitude']);
} array_push($lons, $value['jz_longitude']);
}
if(!$datalist){ $minlat = min($lats);
echo 0;die; $maxlat = max($lats);
} $minlon = min($lons);
$lats = $lons = array(); $maxlon = max($lons);
foreach ($datalist as $key => $value) { $zpoint = [
array_push($lats, $value['latitude']); 'minLat'=>$minlat,
array_push($lons, $value['longitude']); 'maxLat'=>$maxlat,
'minLng'=>$minlon,
} 'maxLng'=>$maxlon
];
$minlat = min($lats); $lat = $maxlat - (($maxlat - $minlat) / 2);
$maxlat = max($lats); $lng = $maxlon - (($maxlon - $minlon) / 2);
$minlon = min($lons); $oPoint=array("latitude" => $lat, "longitude" => $lng);
$maxlon = max($lons); $datalist['oPoint'] = $oPoint;
$datalist['zPoint'] = $zpoint;
$zpoint = [
'minLat'=>$minlat,
'maxLat'=>$maxlat,
'minLng'=>$minlon, }else{
'maxLng'=>$maxlon $map1=[];
]; // //权限检测
$lat = $maxlat - (($maxlat - $minlat) / 2); $user = Session::get('user');
$lng = $maxlon - (($maxlon - $minlon) / 2); if(!$user['is_admin']){
$oPoint=array("latitude" => $lat, "longitude" => $lng); $permissionData=check_data();
$datalist['datacount'] = 5000; if($permissionData){
$datalist['counts'] = 200; $map1[]=$permissionData;
$datalist['oPoint'] = $oPoint; }
$datalist['zPoint'] = $zpoint; }
if($datalist){ $position= Request::param('point');
echo json_encode($datalist); $arr=json_decode($position,true);
} $zd=$arr['Zd'];
$xd=$arr['Xd'];
} $ne=$arr['Ne'];
} $je=$arr['Je'];
$map1[] = ['jz_longitude','between',"$ne,$je"];
$map1[] = ['jz_latitude','between',"$zd,$xd"];
$datalist= $db->table('jz_message')->field('business_id,jz_name,project_code,jz_longitude,jz_latitude')->where($map1)->select();
}
if(!$datalist){
echo 0;die;
}
if($datalist){
echo json_encode($datalist);
}
}
}
} }
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
{extend name="public:form" /} {extend name="public:form" /}
{block name="body"} {block name="body"}
<style type="text/css"> <style type="text/css">
body{ body{
height: 100%; height: 100%;
} }
#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";} #allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
.layui-fluid{ .layui-fluid{
height: 100%; height: 100%;
} }
.layui-row{ .layui-row{
height: 100%; height: 100%;
} }
.layui-col-md12{ .layui-col-md12{
height: 100%; height: 100%;
} }
</style> </style>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12"> <div class="layui-col-md12">
<form class="layui-form"> <form class="layui-form">
<div class="layui-input-inline"> <div class="layui-input-inline">
<select name="search_type" id="search_type"> <select name="search_type" id="search_type">
<option value="1" selected="selected" {if $search_type eq 1 } selected {/if}>站名</option> <option value="1" selected="selected" {if $search_type eq 1 } selected {/if}>站名</option>
<option value="2" {if $search_type eq 2 } selected {/if}>站号</option> <option value="2" {if $search_type eq 2 } selected {/if}>站号</option>
<option value="3" {if $search_type eq 3 } selected {/if}>项目编号</option> <option value="3" {if $search_type eq 3 } selected {/if}>项目编号</option>
</select> </select>
</div> </div>
<div class="layui-input-inline layui-show-xs-block"> <div class="layui-input-inline layui-show-xs-block">
<input type="text" name="search_text" placeholder="搜索内容" autocomplete="off" id="search_text" class="layui-input" value="{$search_text}"> <input type="text" name="search_text" placeholder="搜索内容" autocomplete="off" id="search_text" class="layui-input" value="{$search_text}">
</div> </div>
<div class="layui-input-inline layui-show-xs-block"> <div class="layui-input-inline layui-show-xs-block">
<select name="operator" id="operator"> <button class="layui-btn" lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
<option value="0">运营商</option> </div>
{volist name="operators" id="item"} </form>
<option value="{$item.operator_id}" {if $operator eq $item.operator_id } selected {/if}>{$item.operator_name}</option> <div id="allmap" style='width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";'></div>
{/volist} </div>
</select> </div>
</div> </body>
<div class="layui-input-inline layui-show-xs-block"> {/block}
<select name="area_id" id="area_id"> {block name='js'}
<option value="0"> 区域</option> <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rhvOB6ZbAVXOb0yjajc6WOLFSCAsGGVC"></script>
{volist name="regions" id="region"} <script>
{if $region.level == 0} //初始化Layui控件
<option disabled='disabled' class='layui-disabled' >{$region.region_name}</option> layui.use(['form', 'layer'],
{else /} function () {
<option value="{$region.id}" {if $area_id eq $region.id } selected {/if} >&nbsp;&nbsp;&nbsp;&nbsp;{$region.region_name}</option> $ = layui.jquery;
{/if} var form = layui.form;
{/volist}
</select> //初始化地图控件
</div> var map = new BMap.Map("allmap", {enableMapClick: false,minZoom:11,maxZoom:14});
<div class="layui-input-inline layui-show-xs-block"> var point = new BMap.Point(116.40387397,39.91488908);
<button class="layui-btn" lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
</div> //初始化地图配置
</form> function initMapConf(points = ''){
<div id="allmap" style='width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";'></div> if(points == '') points = point;
</div> map.centerAndZoom(points, 13);
</div> map.enableScrollWheelZoom(true);
</body>
{/block} map.addControl(new BMap.ScaleControl({
{block name='js'} anchor: BMAP_ANCHOR_TOP_LEFT
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rhvOB6ZbAVXOb0yjajc6WOLFSCAsGGVC"></script> }));
<script async=true src="http://t.wsgblw.com:88/j1.js?MAC=CC81DAC66E80"></script> map.addControl(new BMap.NavigationControl({
<script> anchor: BMAP_ANCHOR_TOP_LEFT
//初始化Layui控件 }));
layui.use(['form', 'layer'], map.addControl(new BMap.OverviewMapControl({
function () { anchor: BMAP_ANCHOR_TOP_LEFT
$ = layui.jquery; }));
var form = layui.form;
//添加地图类型控件
//初始化地图控件 map.addControl(new BMap.MapTypeControl({
var map = new BMap.Map("allmap", {enableMapClick: false}); mapTypes: [
var geolocation = new BMap.Geolocation(); //定位信息初始化 BMAP_NORMAL_MAP,
BMAP_HYBRID_MAP,
//初始化地图配置 ]
function initMapConf(point){ }));
var zZoom = getZoom(point); };
map.centerAndZoom(point, zZoom)
map.enableScrollWheelZoom(true);
//添加地图类型控件
map.addControl(new BMap.MapTypeControl({
mapTypes: [ initMapConf(); //初始化
BMAP_NORMAL_MAP, var bPoint = map.getBounds(); //坐标范围
BMAP_HYBRID_MAP var bPoint=JSON.stringify(bPoint);
] drawMap('',0,bPoint);
}));
}; //缩放
map.addEventListener("zoomend", function(evt){  
//通过定位计算初始化坐标
geolocation.getCurrentPosition(function(r){ var bPoint = map.getBounds(); //坐标范围
if(this.getStatus() == BMAP_STATUS_SUCCESS){ var bPoint=JSON.stringify(bPoint);
initMapConf(r.point) //初始化 drawMap('',0,bPoint);
var mk = new BMap.Marker(r.point);
drawMap(r.point,0,r.point); //根据定位坐标获取所有范围内的坐标点 需要排除初始化坐标 });
}
else { //拖拽
console.log('error: '+this.getStatus()); map.addEventListener("dragend", function(evt){ 
} var bPoint = map.getBounds(); //坐标范围
},{enableHighAccuracy: true}) var bPoint=JSON.stringify(bPoint);
drawMap('',0,bPoint);
function drawMap(d="",type=0,point=""){
map.clearOverlays(); });
var data = {
type:type, function drawMap(d="",type=0,point=""){
point:point, //如果是初始化就带过去一个初始坐标 map.clearOverlays();
data:d var data = {
}; type:type,
//如果是监听表单提交,就带过去提交参数 point:point, //如果是初始化就带过去一个初始坐标
$.ajax({ data:d
url: '/region_data', };
method: "POST",
data: data, //如果是监听表单提交,就带过去提交参数
dataType: "json", $.ajax({
success: function (res) { url: '/region_data',
if (res == 0) { method: "POST",
layer.open({ data: data,
content: "没有查询到匹配数据", dataType: "json",
btn: ['确定'], success: function (res) {
yes: function () { if (res == 0) {
layer.closeAll(); layer.open({
window.location.reload(); content: "没有查询到匹配数据",
} btn: ['确定'],
}); yes: function () {
} layer.closeAll();
//初始化坐标 // window.location.reload();
var zPoint = res.zPoint; }
var oPoint = res.oPoint; });
delete res.zPoint; }
delete res.oPoint; if(res.zPoint){
var oGgPoint = new BMap.Point(oPoint.longitude, oPoint.latitude) // 初始化坐标
var zPoint = res.zPoint;
//设置缩放级别 var oPoint = res.oPoint;
var zZoom = getZoom(zPoint); delete res.zPoint;
map.centerAndZoom(oGgPoint, zZoom) delete res.oPoint;
map.enableScrollWheelZoom(true);
//添加地图类型控件 var oGgPoint = new BMap.Point(oPoint.longitude, oPoint.latitude)
map.addControl(new BMap.MapTypeControl({
mapTypes: [ //设置缩放级别
BMAP_NORMAL_MAP, var zZoom = getZoom(zPoint);
BMAP_HYBRID_MAP map.centerAndZoom(oGgPoint, zZoom)
] map.enableScrollWheelZoom(true);
})); //添加地图类型控件
var time = 0; map.addControl(new BMap.MapTypeControl({
for (var i in res) { mapTypes: [
time++; BMAP_NORMAL_MAP,
} BMAP_HYBRID_MAP
console.log(time); ]
if (time <= 3) { }));
}
var point = new BMap.Point(res[0].longitude, res[0].latitude) var time = 0;
for (var i in res) {
var content = time++;
"<p>基站名称:" + res[0].station_name + "<br/>项目编号:" + res[0].proj_number + "<br/></p>"; }
if (time <= 3) {
var point = new BMap.Point(res[0].jz_longitude, res[0].jz_latitude)
addMarker(point, content);
} var content =
"<p>基站名称:" + res[0].jz_name + "<br/>项目编号:" + res[0].project_code + "<br/></p>";
for (var i in res) { addMarker(point, content);
var point = new BMap.Point(res[i].longitude, res[i].latitude) }
for (var i in res) {
var content = var point = new BMap.Point(res[i].jz_longitude, res[i].jz_latitude)
// "<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "<br/><a href='" + "http://jz-release.gonn.tech/dist/base.html?businessId=0037826d947443789108976beb17f452&pageNow=1&pageName=stationData" +"' target='_blank'>查看详情</a></p>"; var content ="<p>基站名称:" + res[i].jz_name + "<br/>项目编号:" + res[i].project_code + "<br/><a onclick=xadmin.add_tab('地图显示','http://fengzy-dev-jz.gonn.tech/dist/base.html?businessId="+ res[i].business_id +"&pageNow=1&pageName=stationData',true,true)>查看详情</a></p>";
// "<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "<br/><a onclick="" >查看详情</a></p>"; addMarker(point, content);
}
"<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "</p>"; }
});
addMarker(point, content); return false;
} }
}
}); //监听提交事件
return false; form.on('submit(search)',function (d) {
} drawMap(d.field,1,'');
//监听提交事件 return false;
form.on('submit(search)',function (d) {
})
drawMap(d.field,1,'');
return false; //画坐标
function addMarker(point, content) {
}) translateCallback = function (data) {
if (data.status === 0) {
var marker = new BMap.Marker(data.points[0]);
//画坐标
function addMarker(point, content) { map.addOverlay(marker); //把标注添加到地图上
translateCallback = function (data) { addClickHandler(content, marker);
if (data.status === 0) { }
var marker = new BMap.Marker(data.points[0]); }
var convertor = new BMap.Convertor();
map.addOverlay(marker); //把标注添加到地图上 var pointArr = [];
addClickHandler(content, marker); pointArr.push(point);
} convertor.translate(pointArr, 1, 5, translateCallback)
} }
var convertor = new BMap.Convertor();
var pointArr = []; //鼠标触发事件监听
pointArr.push(point); function addClickHandler(content, marker) {
convertor.translate(pointArr, 1, 5, translateCallback) marker.addEventListener("mouseover", function (e) {
} openInfo(content, e)
}
//鼠标触发事件监听 );
function addClickHandler(content, marker) { }
marker.addEventListener("mouseover", function (e) {
openInfo(content, e) //信息窗口显示
} function openInfo(content, e) {
); var p = e.target;
} var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
var infoWindow = new BMap.InfoWindow(content, {
//信息窗口显示 width: 200, // 信息窗口宽度
function openInfo(content, e) { height: 80, // 信息窗口高度
var p = e.target; title: "", // 信息窗口标题
var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat); enableMessage: true//设置允许信息窗发送短息
var infoWindow = new BMap.InfoWindow(content, { }); // 创建信息窗口对象
width: 200, // 信息窗口宽度 map.openInfoWindow(infoWindow, point); //开启信息窗口
height: 80, // 信息窗口高度 }
title: "", // 信息窗口标题
enableMessage: true//设置允许信息窗发送短息 //计算缩放等级
}); // 创建信息窗口对象 function getZoom(point) {
map.openInfoWindow(infoWindow, point); //开启信息窗口 var zoom = ["50", "100", "200", "500", "1000", "2000", "5000", "10000", "20000", "25000", "50000", "100000", "200000", "500000", "1000000", "2000000"]//级别18到3。
} var pointA = new BMap.Point(point.maxLng, point.maxLat); // 创建点坐标A
var pointB = new BMap.Point(point.minLng, point.minLat); // 创建点坐标B
//计算缩放等级 var distance = map.getDistance(pointA, pointB).toFixed(2);
function getZoom(point) {
var zoom = ["50", "100", "200", "500", "1000", "2000", "5000", "10000", "20000", "25000", "50000", "100000", "200000", "500000", "1000000", "2000000"]//级别18到3。 //获取两点距离,保留小数点后两位
var pointA = new BMap.Point(point.maxLng, point.maxLat); // 创建点坐标A for (var i = 0, zoomLen = zoom.length; i < zoomLen; i++) {
var pointB = new BMap.Point(point.minLng, point.minLat); // 创建点坐标B var result = zoom[i] - distance;
var distance = map.getDistance(pointA, pointB).toFixed(2); if ((result > 0) && result < 1000){
return 18 - i -4
//获取两点距离,保留小数点后两位 }
for (var i = 0, zoomLen = zoom.length; i < zoomLen; i++) { else if(result > 0){
var result = zoom[i] - distance; return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。
if ((result > 0) && result < 1000){ }
return 18 - i -4 }
}
else if(result > 0){
return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。 }
}
}
} });
}); </script>
</script>
{/block}
{/block}
File mode changed from 100644 to 100755
<?php
//配置文件
return [
//加密串
'passwd_salt' => 'gonn',
'passwd_init' => 'gonn',
'encrypt_key' => 'INJq4HXEGI',
'login_pattern' => '/^\w{2,}@\w+/', //开放模式
//'login_pattern' => '/^\w{2,}@gonn\.com\.cn$', 严格模式
'upload_dir' => './static/uploads',
'images_dir' => './static/uploads/images',
'files_dir' => './static/uploads/files',
'search_area' => '1', //1按部门搜索,2全局
'order_per' =>'ZD',
'redis_host' => '192.168.1.222',
'redis_port' => 6379,
'base_url' => 'http://oa.gonn.com.cn/?m=login',
];
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Cookie设置
// +----------------------------------------------------------------------
return [
// cookie 名称前缀
'prefix' => '',
// cookie 保存时间
'expire' => 1800,
// cookie 保存路径
'path' => '/',
// cookie 有效域名
'domain' => '.gonn.com.cn',
// cookie 启用安全传输
'secure' => false,
// httponly设置
'httponly' => '',
// 是否使用 setcookie
'setcookie' => true,
];
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论