Merge branch 'test'

# Conflicts:
#	hyhproject/admin/controller/LogSysData.php
#	hyhproject/admin/model/CashDraws.php
#	hyhproject/admin/view/log_sys_data/log_sys_data.js
#	hyhproject/admin/view/log_sys_data/log_sys_data2.js
#	hyhproject/common/model/SysSummary.php
This commit is contained in:
2020-07-04 21:37:51 +08:00
479 changed files with 110 additions and 24 deletions

View File

@ -3,6 +3,7 @@
namespace wstmart\admin\controller;
use think\Db;
use wstmart\admin\model\LogSysData as M;
class LogSysData extends Base
@ -17,6 +18,10 @@ class LogSysData extends Base
return $this->fetch("list2");
}
public function index3()
{
return $this->fetch('list3');
}
/**
* 获取分页
*/
@ -26,4 +31,14 @@ class LogSysData extends Base
return WSTGrid($rs);
}
public function uvData(){
$data = Db::name('user_vouchers_notice')->alias('a')
->join('users b','b.userId=a.userId','left')
->field('a.*,b.loginName')
->paginate(input('post.limit/d'))->toArray();
foreach ($data['Rows'] as &$item) {
$item['createTime'] = date("Y-m-d H:i:s", $item['createTime']);
}
return WSTGrid($data);
}
}

View File

@ -186,8 +186,11 @@ class CashDraws extends Base{
// $orders['collectionGatheringSum'] += abs($v['payable']);
// }
}
$data = Db::name('cash_draws')->whereTime('createTime',[$date,date('Y-m-d',strtotime('+1 day',strtotime($date)))])
->where("cashSatus", '=', 1)->select();
$data = Db::name('cash_draws')->whereIn('cashId',
Db::name('log_moneys')
->whereTime('createTime',[$date,date('Y-m-d',strtotime('+1 day',strtotime($date)))])
->where('dataSrc', '=', 3)->column('dataId')
)->select();
foreach ($data as $item){
$m->setTable('shops');
$shopUserId = $m->getField(['shopId'=>$item['targetId']],'userId');

View File

@ -10,7 +10,7 @@
<style>body,.wrapper{overflow:hidden;}</style>
<div class="wrapper">
<header class="main-header">
<a href="#" class="logo">
<a href="?" class="logo">
<span class="logo-mini">商城后台</span>
<span class="logo-lg">商城后台</span>
</a>

View File

@ -0,0 +1,23 @@
{extend name="base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
{/block}
{block name="js"}
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
<script src="__ADMIN__/log_sys_data/log_sys_data3.js?v={$v}" type="text/javascript"></script>
<script>
$(function(){initGrid();})
</script>
{/block}
{block name="main"}
<div class="wst-toolbar">
<div id="ztreeMenuContent" class="ztreeMenuContent">
<ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul>
</div>
<div style='clear:both'></div>
</div>
<div class='wst-grid'>
<div id="mmg" class="mmg"></div>
<div id="pg" style="text-align: right;"></div>
</div>
{/block}

View File

@ -12,6 +12,7 @@ function initGrid(){
}
return "¥"+val;
}},
{title:'备注', name:'remark' },
{title:'时间', name:'createTime' ,width:120,sortable:true},
];

View File

@ -12,6 +12,7 @@ function initGrid(){
}
return "¥"+val;
}},
{title:'备注', name:'remark' },
{title:'时间', name:'createTime' ,width:120,sortable:true},
];

View File

@ -0,0 +1,43 @@
var mmg;
function initGrid(){
var h = WST.pageHeight();
var cols = [
{title:'用户', name:'loginName' ,width:120},
{title:'预获产品券', name:'expectedProductNum' ,width:200,renderer: function(val,item,rowIndex){
if(item.moneyType!=1){
val = '-'+val;
}
return "¥"+val;
}},
{title:'预获优惠券', name:'expectedCouponsNum' ,width:200,renderer: function(val,item,rowIndex){
if(item.moneyType!=1){
val = '-'+val;
}
return "¥"+val;
}},
{title:'描述', name:'remark' ,width:240,sortable:true},
{title:'时间', name:'createTime' ,width:120,sortable:true},
];
mmg = $('.mmg').mmGrid({height: h-85,indexCol: true, cols: cols,method:'POST',checkCol:false,multiSelect:true,
url: WST.U('admin/log_sys_data/uvData'), fullWidthRows: true, autoLoad: true,remoteSort: true,
plugins: [
$('#pg').mmPaginator({})
]
});
mmg.on('loadSuccess',function(){
layui.form.render('','gridForm');
layui.form.on('switch(isShow)', function(data){
var id = $(this).attr("data");
if(this.checked){
toggleIsShow(1,id);
}else{
toggleIsShow(0,id);
}
});
})
}
function loadGrid(){
mmg.load({page:1});
}

View File

@ -54,11 +54,13 @@ function enterLicense(){
</div>
<div class="layui-col-md4" style="height: auto;overflow: hidden;">
<div class="wst-summary-content">
<div class="img"><img src="__ADMIN__/img/15.png"/></div>
<a href="/admin/log_sys_data/index3.html">
<div class="img"><img src="__ADMIN__/img/15.png"/></div>
<div class="data">
<p class="data-top" style="color: #f1635f;">{$object['qlg']['vouchersSummarySum']}</p>
<div class="data-bottom">预代付值</div>
</div>
</a>
</div>
</div>
<div class="layui-col-md4" style="height: auto;overflow: hidden;">

0
hyhproject/app/controller/UserLevel.php Normal file → Executable file
View File

View File

@ -1510,7 +1510,8 @@ class Orders extends Base{
// step 2 商户支付优惠款给平台10000×0.4=4000
// 10.15添加 优惠款 全额进入 代快付值
$sm->addSysSummary($calBaseNum,0,1);
// 20.06.29 优惠款 90%进入 代快付值
$sm->addSysSummary($calBaseNum*0.9,0,1,'助购吧购物,订单号ID['.$orderId.'],优惠款90%进入代快付值');
$vm = new UserVouchers();
@ -1527,7 +1528,7 @@ class Orders extends Base{
if((int)$order["helpUserLevel"]!==0){
$vm->insertHelpSaleNotice($order["helpUserId"], $orderId, $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100),
'预获助购转换所扣', 0);
$sm->addSysSummary($calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100),0,2);
$sm->addSysSummary($calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100),0,2,'订单ID['.$orderId.']:平台送给购户的上N层用户ID['.$order["helpUserId"].']');
$vm->insertVouchersNotice($order['helpUserId'], $orderId, $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), 0,
'预获产品券转换所扣',0);
$vm->insertAlreadyVouchersNotice($order['helpUserId'], $orderId, $calBaseNum*((float)dataConf('helpSaleCouponsCalBase')/100), 0,

View File

@ -28,7 +28,7 @@ class Settlements extends Base
//加入快代付值
$fastScale = dataConf('fastPayInSaleScale');
$fastNum = round($discountMoney * ($fastScale*0.01),5);
Model('SysSummary')->addToPayFast($orderId,$fastNum,$fastScale);
Model('SysSummary')->addToPayFast($orderId,$fastNum,$fastScale,'订单ID['.$orderId.']优惠款加入代快(即时)');
//获取产品额
$totalMoney = $order->realTotalMoney;//产品额
if(2 != $order->goodsType){//助微吧商品不给购户券值

View File

@ -6,7 +6,7 @@ use think\Db;
* 系统数据
*/
class SysSummary extends Base{
public function addToPayFast($orderId,$payFastNum,$fastScale){
public function addToPayFast($orderId,$payFastNum,$fastScale,$sm=''){
$noticeData['orderId'] = $orderId;
$noticeData['toPayFast'] = $payFastNum;
$noticeData['fastScale'] = $fastScale;
@ -14,7 +14,7 @@ class SysSummary extends Base{
Db::name('sys_notice')->insert($noticeData);
// 原当购户“预获优惠券”、“预获产品券”的值同时≤15元时所获“已获优惠券”、“已获产品券”转入代快付值
// 改为当购户“预获优惠券”、“预获产品券”的值同时≤15元时所获“已获优惠券”、“已获产品券”转入代慢付值
$this->addSysSummary(0, $payFastNum);
$this->addSysSummary($payFastNum, 0,$sm);
}
/**
* 添加系统数据
@ -22,9 +22,9 @@ class SysSummary extends Base{
* @param integer $payFastSlow [代慢付值]
* @param integer $isAdd [1加2减]
*/
public function addSysSummary($payFastNum=0,$payFastSlow=0,$isAdd=1){
public function addSysSummary($payFastNum=0,$payFastSlow=0,$isAdd=1,$sm=''){
if($payFastNum){
$this->addSysLog($payFastNum,1,$isAdd);
$this->addSysLog($payFastNum,1,$isAdd,$sm);
if(1 == $isAdd){
$this->where(['id'=>1])->setInc('toPayFast',$payFastNum);
}else{
@ -32,7 +32,7 @@ class SysSummary extends Base{
}
}
if($payFastSlow){
$this->addSysLog($payFastSlow,2,$isAdd);
$this->addSysLog($payFastSlow,2,$isAdd,$sm);
if(1 == $isAdd){
$this->where(['id'=>1])->setInc('toPaySlow',$payFastSlow);
}else{
@ -47,11 +47,12 @@ class SysSummary extends Base{
* @param [type] $changeType [1加 2减]
* @param integer $adminId [操作人员ID0为系统]
*/
public function addSysLog($num,$type,$changeType=1,$adminId=0){
public function addSysLog($num,$type,$changeType=1,$sm='',$adminId=0){
$data['num'] = $num;
$data['type'] = $type;
$data['changeType'] = $changeType;
$data['adminId'] = $adminId;
$data['remark'] = $sm;
$data['createTime'] = time();
Db::name('log_sys_data')->insert($data);
}

0
hyhproject/common/model/UserLevel.php Normal file → Executable file
View File

View File

@ -50,10 +50,10 @@ class UserVouchers extends Base{
if($toPaySum > $maxPayNum){
//加入代慢付值
$addPaySlow = round($toPaySum - $maxPayNum,5);
$sm->addSysSummary(0,$addPaySlow);
$sm->addSysSummary(0,$addPaySlow,1,'应释放总额大于最大释放总额');
}
//扣减系统释放值
$sm->addSysSummary($payFast,$paySlow,2);
$sm->addSysSummary($payFast,$paySlow,2,'扣减系统释放值');
//取最小值作为总释放额
$payNum = min($maxPayNum,$toPaySum);
if($payNum==0) return;
@ -79,7 +79,7 @@ class UserVouchers extends Base{
//都小于15不统计直接加入代慢付
if($v['expectedProductNum'] <= $minNumer && $v['expectedCouponsNum'] <= $minNumer){
$toSlowNum = round($personNum * ($v['expectedProductNum'] + $v['expectedCouponsNum']),2);
$sm->addSysSummary(0,$toSlowNum);
$sm->addSysSummary(0,$toSlowNum,1,'用户ID['.$v['userId'].']双预获券都小于15直接加入代慢付');
continue;
}
if($v['expectedProductNum'] < $minNumer){//预获产品券小于15;