提交 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
差异被折叠。
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
差异被折叠。
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论