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

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

...@@ -21,3 +21,5 @@ ...@@ -21,3 +21,5 @@
/public/static/uploads /public/static/uploads
/public/static/xadmin /public/static/xadmin
/application/admin/view/staff/role.html /application/admin/view/staff/role.html
/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
...@@ -12,7 +12,7 @@ use app\admin\model\ElectricMeterType; ...@@ -12,7 +12,7 @@ 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;
...@@ -22,6 +22,16 @@ class Region extends Base ...@@ -22,6 +22,16 @@ class Region extends Base
public function region_list(){ public function region_list(){
$db = Db::connect([
'type' => config('jz.jztype'),
'hostname' => config('jz.jzhostname'),
'database' => config('jz.jzdatabase'),
'username' => config('jz.jzusername'),
'password' => config('jz.jzpassword'),
'hostport' =>config('jz.jzhostport'),
'charset' => config('jz.jzcharset'),
]);
if (!Request::instance()->isAjax()){ if (!Request::instance()->isAjax()){
$this->assign('search_type',''); $this->assign('search_type','');
$this->assign('search_text',''); $this->assign('search_text','');
...@@ -44,17 +54,17 @@ class Region extends Base ...@@ -44,17 +54,17 @@ class Region extends Base
switch ($search_type) { switch ($search_type) {
case '1': case '1':
$this->assign('search_text',$search_text); $this->assign('search_text',$search_text);
$map[]=['station_info.station_name','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': case '2':
$this->assign('search_text',$search_text); $this->assign('search_text',$search_text);
$map[]=['station_info.station_sp_code','like',"%$search_text%"]; $map[]=['jz_code','like',"%$search_text%"];
$this->assign('search_type',$search_type); $this->assign('search_type',$search_type);
break; break;
case '3': case '3':
$this->assign('search_text',$search_text); $this->assign('search_text',$search_text);
$map[]=['station_info.proj_number','like',"%$search_text%"]; $map[]=['project_code','like',"%$search_text%"];
$this->assign('search_type',$search_type); $this->assign('search_type',$search_type);
break; break;
...@@ -65,20 +75,20 @@ class Region extends Base ...@@ -65,20 +75,20 @@ class Region extends Base
} }
$operator = $data['operator']; // $operator = $data['operator'];
if($operator){ // if($operator){
$map[] = ['station_info.original_sp_id','=',$operator]; // $map[] = ['jz_yys','=',$operator];
$this->assign('operator',$operator); // $this->assign('operator',$operator);
}else{ // }else{
$this->assign('operator',''); // $this->assign('operator','');
} // }
$area_id =$data['area_id']; // $area_id =$data['area_id'];
if($area_id){ // if($area_id){
$map[] = ['station_info.area_id','=',$area_id]; // $map[] = ['jz_qy','=',$area_id];
$this->assign('area_id',$area_id); // $this->assign('area_id',$area_id);
}else{ // }else{
$this->assign('area_id',''); // $this->assign('area_id','');
} // }
if(!$map){ if(!$map){
echo 0;die; echo 0;die;
} }
...@@ -91,42 +101,21 @@ class Region extends Base ...@@ -91,42 +101,21 @@ class Region extends Base
$map[]=$permissionData; $map[]=$permissionData;
} }
} }
$map[] = ['d.longitude','neq',""]; $map[] = ['jz_latitude','neq',""];
$map[] = ['d.latitude','neq',""]; $map[] = ['jz_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{
$map1=[];
//权限检测
$user = Session::get('user');
if(!$user['is_admin']){
$permissionData=check_data();
if($permissionData){
$map1[]=$permissionData;
}
}
$position= Request::param('data');
$ff= $position['lng'];
$ee= $position['lat'];
$fff=$ff+"0.200000";
$eee=$ee+"0.200000";
$map1[] = ['d.longitude','between',"$ff,$fff"];
$map1[] = ['d.latitude','between',"$ee,$eee"];
$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();
} $datalist= $db->table('jz_message')->field('business_id,jz_name,project_code,jz_longitude,jz_latitude')->where($map)->select();
if(!$datalist){ if(!$datalist){
echo 0;die; echo 0;die;
} }
$lats = $lons = array(); $lats = $lons = array();
foreach ($datalist as $key => $value) { foreach ($datalist as $key => $value) {
array_push($lats, $value['latitude']); array_push($lats, $value['jz_latitude']);
array_push($lons, $value['longitude']); array_push($lons, $value['jz_longitude']);
} }
$minlat = min($lats); $minlat = min($lats);
$maxlat = max($lats); $maxlat = max($lats);
$minlon = min($lons); $minlon = min($lons);
...@@ -141,10 +130,41 @@ class Region extends Base ...@@ -141,10 +130,41 @@ class Region extends Base
$lat = $maxlat - (($maxlat - $minlat) / 2); $lat = $maxlat - (($maxlat - $minlat) / 2);
$lng = $maxlon - (($maxlon - $minlon) / 2); $lng = $maxlon - (($maxlon - $minlon) / 2);
$oPoint=array("latitude" => $lat, "longitude" => $lng); $oPoint=array("latitude" => $lat, "longitude" => $lng);
$datalist['datacount'] = 5000;
$datalist['counts'] = 200;
$datalist['oPoint'] = $oPoint; $datalist['oPoint'] = $oPoint;
$datalist['zPoint'] = $zpoint; $datalist['zPoint'] = $zpoint;
}else{
$map1=[];
// //权限检测
$user = Session::get('user');
if(!$user['is_admin']){
$permissionData=check_data();
if($permissionData){
$map1[]=$permissionData;
}
}
$position= Request::param('point');
$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){ if($datalist){
echo json_encode($datalist); echo json_encode($datalist);
} }
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -32,26 +32,6 @@ ...@@ -32,26 +32,6 @@
<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">
<select name="operator" id="operator">
<option value="0">运营商</option>
{volist name="operators" id="item"}
<option value="{$item.operator_id}" {if $operator eq $item.operator_id } selected {/if}>{$item.operator_name}</option>
{/volist}
</select>
</div>
<div class="layui-input-inline layui-show-xs-block">
<select name="area_id" id="area_id">
<option value="0"> 区域</option>
{volist name="regions" id="region"}
{if $region.level == 0}
<option disabled='disabled' class='layui-disabled' >{$region.region_name}</option>
{else /}
<option value="{$region.id}" {if $area_id eq $region.id } selected {/if} >&nbsp;&nbsp;&nbsp;&nbsp;{$region.region_name}</option>
{/if}
{/volist}
</select>
</div>
<div class="layui-input-inline layui-show-xs-block"> <div class="layui-input-inline layui-show-xs-block">
<button class="layui-btn" lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button> <button class="layui-btn" lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
</div> </div>
...@@ -63,7 +43,6 @@ ...@@ -63,7 +43,6 @@
{/block} {/block}
{block name='js'} {block name='js'}
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rhvOB6ZbAVXOb0yjajc6WOLFSCAsGGVC"></script> <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>
<script> <script>
//初始化Layui控件 //初始化Layui控件
layui.use(['form', 'layer'], layui.use(['form', 'layer'],
...@@ -72,34 +51,58 @@ ...@@ -72,34 +51,58 @@
var form = layui.form; var form = layui.form;
//初始化地图控件 //初始化地图控件
var map = new BMap.Map("allmap", {enableMapClick: false}); var map = new BMap.Map("allmap", {enableMapClick: false,minZoom:11,maxZoom:14});
var geolocation = new BMap.Geolocation(); //定位信息初始化 var point = new BMap.Point(116.40387397,39.91488908);
//初始化地图配置 //初始化地图配置
function initMapConf(point){ function initMapConf(points = ''){
var zZoom = getZoom(point); if(points == '') points = point;
map.centerAndZoom(point, zZoom) map.centerAndZoom(points, 13);
map.enableScrollWheelZoom(true); map.enableScrollWheelZoom(true);
map.addControl(new BMap.ScaleControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}));
map.addControl(new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}));
map.addControl(new BMap.OverviewMapControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}));
//添加地图类型控件 //添加地图类型控件
map.addControl(new BMap.MapTypeControl({ map.addControl(new BMap.MapTypeControl({
mapTypes: [ mapTypes: [
BMAP_NORMAL_MAP, BMAP_NORMAL_MAP,
BMAP_HYBRID_MAP BMAP_HYBRID_MAP,
] ]
})); }));
}; };
//通过定位计算初始化坐标
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
initMapConf(r.point) //初始化 initMapConf(); //初始化
var mk = new BMap.Marker(r.point); var bPoint = map.getBounds(); //坐标范围
drawMap(r.point,0,r.point); //根据定位坐标获取所有范围内的坐标点 需要排除初始化坐标 var bPoint=JSON.stringify(bPoint);
} drawMap('',0,bPoint);
else {
console.log('error: '+this.getStatus()); //缩放
} map.addEventListener("zoomend", function(evt){  
},{enableHighAccuracy: true})
var bPoint = map.getBounds(); //坐标范围
var bPoint=JSON.stringify(bPoint);
drawMap('',0,bPoint);
});
//拖拽
map.addEventListener("dragend", function(evt){ 
var bPoint = map.getBounds(); //坐标范围
var bPoint=JSON.stringify(bPoint);
drawMap('',0,bPoint);
});
function drawMap(d="",type=0,point=""){ function drawMap(d="",type=0,point=""){
map.clearOverlays(); map.clearOverlays();
...@@ -108,6 +111,7 @@ ...@@ -108,6 +111,7 @@
point:point, //如果是初始化就带过去一个初始坐标 point:point, //如果是初始化就带过去一个初始坐标
data:d data:d
}; };
//如果是监听表单提交,就带过去提交参数 //如果是监听表单提交,就带过去提交参数
$.ajax({ $.ajax({
url: '/region_data', url: '/region_data',
...@@ -121,11 +125,13 @@ ...@@ -121,11 +125,13 @@
btn: ['确定'], btn: ['确定'],
yes: function () { yes: function () {
layer.closeAll(); layer.closeAll();
window.location.reload(); // window.location.reload();
} }
}); });
} }
//初始化坐标 if(res.zPoint){
// 初始化坐标
var zPoint = res.zPoint; var zPoint = res.zPoint;
var oPoint = res.oPoint; var oPoint = res.oPoint;
delete res.zPoint; delete res.zPoint;
...@@ -144,32 +150,22 @@ ...@@ -144,32 +150,22 @@
BMAP_HYBRID_MAP BMAP_HYBRID_MAP
] ]
})); }));
}
var time = 0; var time = 0;
for (var i in res) { for (var i in res) {
time++; time++;
} }
console.log(time);
if (time <= 3) { if (time <= 3) {
var point = new BMap.Point(res[0].longitude, res[0].latitude) var point = new BMap.Point(res[0].jz_longitude, res[0].jz_latitude)
var content = var content =
"<p>基站名称:" + res[0].station_name + "<br/>项目编号:" + res[0].proj_number + "<br/></p>"; "<p>基站名称:" + res[0].jz_name + "<br/>项目编号:" + res[0].project_code + "<br/></p>";
addMarker(point, content); addMarker(point, content);
} }
for (var i in res) { for (var i in res) {
var point = new BMap.Point(res[i].longitude, res[i].latitude) var point = new BMap.Point(res[i].jz_longitude, res[i].jz_latitude)
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>";
var content =
// "<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>";
// "<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "<br/><a onclick="" >查看详情</a></p>";
"<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "</p>";
addMarker(point, content); addMarker(point, content);
} }
} }
...@@ -179,7 +175,6 @@ ...@@ -179,7 +175,6 @@
//监听提交事件 //监听提交事件
form.on('submit(search)',function (d) { form.on('submit(search)',function (d) {
drawMap(d.field,1,''); drawMap(d.field,1,'');
return false; return false;
...@@ -241,6 +236,8 @@ ...@@ -241,6 +236,8 @@
return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。 return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。
} }
} }
} }
......
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论