Merge branch 'feature/president_apply' of wmtx/platform into release

修改会长押金需求
master
廖金灵 5 years ago committed by Gogs
commit 86a90467ff

@ -181,7 +181,7 @@ class PresidentDepositController extends ThinkController
public function edit()
{
$this->meta_title = '编辑/查看会长押金';
$this->meta_title = '编辑会长押金';
$id = I('id', 0);
$promote = M('promote', 'tab_')->field(['account', 'id'])->where(['id' => $id])->find();
$record = M('president_deposit', 'tab_')->where(['promote_id' => $id])->find();
@ -192,6 +192,19 @@ class PresidentDepositController extends ThinkController
$this->display('form');
}
public function show()
{
$this->meta_title = '查看会长押金';
$id = I('id', 0);
$promote = M('promote', 'tab_')->field(['account', 'id'])->where(['id' => $id])->find();
$record = M('president_deposit', 'tab_')->where(['promote_id' => $id])->find();
$this->assign('payWays', PresidentDepositService::$payWays);
$this->assign('payTypes', PresidentDepositService::$payTypes);
$this->assign('promote', $promote);
$this->assign('record', $record);
$this->display('show');
}
public function save()
{
$payWay = I('pay_way', 0);
@ -205,14 +218,18 @@ class PresidentDepositController extends ThinkController
$promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find();
if (!$record) {
if ($payType == 0) {
return $this->error('请选择押金付款方式');
}
if ($payType == 3) {
$this->handleNoDeposit($promoteId);
return $this->success('保存成功', U('records'));
}
if ($payType != 2 && $payWay == 0) {
return $this->error('请选择付款方式');
}
if ($payType == 0) {
return $this->error('请选择押金付款方式');
}
if ($payType != 2 && $payWay == 0) {
return $this->error('请选择付款方式');
}
if (!$record) {
if ($amount !== '') {
if (!is_numeric($amount)) {
return $this->error('请输入正确金额');
@ -237,13 +254,12 @@ class PresidentDepositController extends ThinkController
M('president_deposit', 'tab_')->add($data);
addOperationLog(['op_type'=>0,'key'=>$promoteData['account'].'/'.$amount,'op_name'=>'新增会长押金','url'=>U('PresidentDeposit/edit',['id'=>$promoteId]),'menu'=>'推广员-结算单管理-奖罚记录管理-新增会长押金']);
return $this->success('保存成功', U('PresidentDeposit/records'));
return $this->success('保存成功', U('records'));
}
if ($record['status'] != 0) {
/* if ($record['status'] != 0) {
return $this->error('该状态下不可编辑/修改');
}
} */
if ($amount === '') {
return $this->error('请输入金额');
@ -265,6 +281,8 @@ class PresidentDepositController extends ThinkController
}
$data = [];
$data['pay_way'] = $payType == 2 ? 4 : $payWay;
$data['pay_type'] = $payType;
$data['pay_account'] = $payAccount;
$data['amount'] = floatval($amount);
$data['payer'] = $payer;
@ -273,7 +291,7 @@ class PresidentDepositController extends ThinkController
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'].'/'.$amount,'op_name'=>'编辑会长押金','url'=>U('PresidentDeposit/edit',['id'=>$promoteId]),'menu'=>'推广员-结算单管理-会长押金管理-编辑会长押金']);
return $this->success('保存成功');
return $this->success('保存成功', U('records'));
}
public function delete()
@ -289,28 +307,34 @@ class PresidentDepositController extends ThinkController
]);
}
public function noDeposit()
public function handleNoDeposit($promoteId)
{
$promoteId = I('id', 0);
$record = M('president_deposit', 'tab_')->where(['promote_id' => $promoteId])->find();
$data = [];
$data['pay_way'] = 0;
$data['pay_type'] = PresidentDepositService::PAY_TYPE_NONE;
$data['pay_account'] = '';
$data['amount'] = 0;
$data['payer'] = '';
$data['create_time'] = time();
$data['update_time'] = time();
if (!$record) {
$data = [];
$data['pay_way'] = 0;
$data['pay_type'] = PresidentDepositService::PAY_TYPE_NONE;
$data['promote_id'] = $promoteId;
$data['pay_account'] = '';
$data['amount'] = 0;
$data['payer'] = '';
$data['create_time'] = time();
$data['update_time'] = time();
M('president_deposit', 'tab_')->add($data);
$promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find();
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'编辑无需押金','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-无需押金']);
} else {
M('president_deposit', 'tab_')->where(['promote_id' => $promoteId])->save($data);
}
$promoteData = M('promote', 'tab_')->field('account')->where(['id' => $promoteId])->find();
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'编辑无需押金','url'=>U('PresidentDeposit/records'),'menu'=>'推广员-结算单管理-会长押金管理-无需押金']);
}
public function noDeposit()
{
$promoteId = I('id', 0);
$this->handleNoDeposit($promoteId);
$this->ajaxReturn([
'status' => 1,
'message' => '操作成功'

@ -90,7 +90,7 @@
<tr>
<td class="l"><i class="mustmark">*</i>押金付款方式:</td>
<td class="r">
<select name="pay_type" id="pay_type" class="select_gallery" <?php if($record):?>disabled<?php endif;?>>
<select name="pay_type" id="pay_type" class="select_gallery">
<option value="">押金付款方式</option>
<?php foreach($payTypes as $key => $name):?>
<option value="<?=$key?>" <?php if($record && $record['pay_type'] == $key):?>selected<?php endif;?>><?=$name?></option>
@ -99,10 +99,10 @@
<span class="notice-text"></span>
</td>
</tr>
<tr>
<tr class="need-amount" <?php if($record && $record['pay_type']==3):?>style="display:none;"<?php endif;?>>
<td class="l"><i class="mustmark">*</i>付款方式:</td>
<td class="r">
<select name="pay_way" id="pay_way" class="select_gallery" <?php if($record):?>disabled<?php endif;?>>
<select name="pay_way" id="pay_way" class="select_gallery">
<option value="">付款方式</option>
<?php foreach($payWays as $key => $name):?>
<option value="<?=$key?>" <?php if($record && $record['pay_way'] == $key):?>selected<?php endif;?>><?=$name?></option>
@ -111,24 +111,24 @@
<span class="notice-text"></span>
</td>
</tr>
<tr>
<tr class="need-amount" <?php if($record && $record['pay_type']==3):?>style="display:none;"<?php endif;?>>
<td class="l"><?php if($record):?><i class="mustmark">*</i><?php endif?>金额:</td>
<td class="r table_radio">
<input type="text" class="txt ratio" name="amount" id="amount" value="<?=$record?$record['amount']:''?>" <?php if($record && $record['status']!=0):?>disabled<?php endif;?> placeholder="请输入金额">
<input type="text" class="txt ratio" name="amount" id="amount" value="<?=$record?$record['amount']:''?>" placeholder="请输入金额">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<tr class="need-amount" <?php if($record && $record['pay_type']==3):?>style="display:none;"<?php endif;?>>
<td class="l"><?php if($record):?><i class="mustmark">*</i><?php endif?>付款人:</td>
<td class="r table_radio">
<input type="text" class="txt ratio" name="payer" id="payer" value="<?=$record?$record['payer']:''?>" <?php if($record && $record['status']!=0):?>disabled<?php endif;?> placeholder="请输入付款人">
<input type="text" class="txt ratio" name="payer" id="payer" value="<?=$record?$record['payer']:''?>" placeholder="请输入付款人">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<tr class="need-amount" <?php if($record && $record['pay_type']==3):?>style="display:none;"<?php endif;?>>
<td class="l"><?php if($record):?><i class="mustmark">*</i><?php endif?>付款账号:</td>
<td class="r table_radio">
<input type="text" class="txt ratio" name="pay_account" id="pay_account" value="<?=$record?$record['pay_account']:''?>" <?php if($record && $record['status']!=0):?>disabled<?php endif;?> placeholder="请输入付款账号">
<input type="text" class="txt ratio" name="pay_account" id="pay_account" value="<?=$record?$record['pay_account']:''?>" placeholder="请输入付款账号">
<span class="notice-text"></span>
</td>
</tr>
@ -137,11 +137,9 @@
</div>
<input type="hidden" name="id" id="id" value="{$promote.id}" />
<div class="form-item cf">
<?php if(!$record || $record['status']==0):?>
<button class="submit_btn mlspacing" id="submit" type="submit" target-form="form-horizontal">
确认
</button>
<?php endif;?>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
@ -189,10 +187,14 @@ $(function(){
$('#pay_type').change(function() {
var val = $(this).val()
if (val == 2) {
$('.need-amount').show();
$("#pay_way option[value='4']").removeProp('disabled');
$('#pay_way').val('4').select2()
$('#pay_way').attr('disabled', 'disabled')
} else if(val == 3) {
$('.need-amount').hide();
} else {
$('.need-amount').show();
$('#pay_way').removeAttr('disabled');
$("#pay_way option[value='4']").prop('disabled', true);
$('#pay_way').val('').select2()

@ -161,11 +161,10 @@
<?php if($data['has_record']):?>
<td>
<div class="partakebtn">
<?php if($data['status'] == 0):?>
<a href="<?=U('show', ['id' => $data['id']])?>">查看</a>
<a href="<?=U('edit', ['id' => $data['id']])?>">编辑</a>
<?php if($data['status'] == 0):?>
<a class="delete-btn">删除</a>
<?php else:?>
<a href="<?=U('edit', ['id' => $data['id']])?>">查看</a>
<?php endif;?>
</div>
</td>

@ -0,0 +1,174 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.tabcon1711 input.time {
width: 150px;
}
#form .txt_area {
width: 300px;
height: 150px;
}
.tabcon1711 .form_unit {
margin-left: 2px;
}
.tabcon1711 .mustmark {
margin-left:-7px;
}
.list-ratio {
display: table;
}
.list-ratio .li-ratio {
display: flex;
margin-bottom: 20px;
align-items: center;
}
.list-ratio .li-ratio .turnover, .list-ratio .li-ratio .turnover-ratio {
position: relative;
}
.list-ratio .li-ratio .turnover span, .list-ratio .li-ratio .turnover-ratio .error-message {
color: red;
position: absolute;
left: 0;
top: 30px;
white-space: nowrap;
display: none;
}
.iconfont-btn {
cursor: pointer;
}
.iconfont-style {
font-size: 18px;
color: #fff;
border-radius: 4px;
border: 0;
padding: 5px;
margin-left: 10px;
}
.iconfont-selected {
background-color: #0A9AF2;
}
.iconfont-selected:hover {
background-color: #03a9f4;
}
.iconfont-unselected {
background-color: #999;
}
.iconfont-unselected:hover {
background-color: #ababab;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<!-- <p class="description_text">说明:此功是创建推广员时所需填写信息</p>-->
</div>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" method="post" class="form-horizontal">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">会长账号:</td>
<td class="r table_radio">
<span class="form_radio table_btn">{$promote.account}</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">押金付款方式:</td>
<td class="r">
<span class="form_radio table_btn">{$payTypes[$record['pay_type']]}</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">付款方式:</td>
<td class="r">
<span class="form_radio table_btn"><?=$record['pay_way']==0?'无':$payWays[$record['pay_way']]?></span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">金额:</td>
<td class="r table_radio">
<span class="form_radio table_btn">{$record['amount']}</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">付款人:</td>
<td class="r table_radio">
<span class="form_radio table_btn"><?=$record['payer']==''?'无':$record['payer']?></span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l">付款账号:</td>
<td class="r table_radio">
<span class="form_radio table_btn"><?=$record['pay_account']==''?'无':$record['pay_account']?></span>
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="form-item cf">
<a class="submit_btn " alt="返回" title="返回" href="javascript:window.history.back();" >
返回
</a>
</div>
</form>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Promote/lists/type/1">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('PresidentDeposit/records')}');
$(".select_gallery").select2();
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm',
language: "zh-CN",
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
startView: 'year',
minView:'year',
maxView:'year',
});
showTab();
});
</script>
</block>

@ -73,7 +73,7 @@
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
<?php endif;?>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
<a href="{:U('Query/promoteQuota')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq promoteQuota or ACTION_NAME eq quotaDtl) '>active</if> ">推广员指标</a>
<!-- <a href="{:U('Query/promoteQuota')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq promoteQuota or ACTION_NAME eq quotaDtl) '>active</if> ">推广员指标</a> -->
<a href="{:U('Query/iosDownLoadData')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq iosDownLoadData or ACTION_NAME eq iosDownLoadData) '>active</if> ">IOS下载数统计</a>
</div>

Loading…
Cancel
Save