diff --git a/Application/Admin/Controller/PresidentDepositController.class.php b/Application/Admin/Controller/PresidentDepositController.class.php index f2979972f..20aaa4397 100644 --- a/Application/Admin/Controller/PresidentDepositController.class.php +++ b/Application/Admin/Controller/PresidentDepositController.class.php @@ -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' => '操作成功' diff --git a/Application/Admin/View/PresidentDeposit/form.html b/Application/Admin/View/PresidentDeposit/form.html index b97f932d3..5912f2511 100644 --- a/Application/Admin/View/PresidentDeposit/form.html +++ b/Application/Admin/View/PresidentDeposit/form.html @@ -90,7 +90,7 @@ *押金付款方式: - $name):?> @@ -99,10 +99,10 @@ - + style="display:none;"> *付款方式: - $name):?> @@ -111,24 +111,24 @@ - + style="display:none;"> *金额: - disabled placeholder="请输入金额"> + - + style="display:none;"> *付款人: - disabled placeholder="请输入付款人"> + - + style="display:none;"> *付款账号: - disabled placeholder="请输入付款账号"> + @@ -137,11 +137,9 @@
- - 返回 @@ -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() diff --git a/Application/Admin/View/PresidentDeposit/records.html b/Application/Admin/View/PresidentDeposit/records.html index b3078b3ba..8fc6236d0 100644 --- a/Application/Admin/View/PresidentDeposit/records.html +++ b/Application/Admin/View/PresidentDeposit/records.html @@ -161,11 +161,10 @@
- + 查看 编辑 + 删除 - - 查看
diff --git a/Application/Admin/View/PresidentDeposit/show.html b/Application/Admin/View/PresidentDeposit/show.html new file mode 100644 index 000000000..5fb026988 --- /dev/null +++ b/Application/Admin/View/PresidentDeposit/show.html @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
会长账号: + {$promote.account} + +
押金付款方式: + {$payTypes[$record['pay_type']]} + +
付款方式: + + +
金额: + {$record['amount']} + +
付款人: + + +
付款账号: + + +
+
+ +
+
+
+ + + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index b767d27e8..2b6a46fae 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -73,7 +73,7 @@ 充值玩家 团队/推广员业绩 - 推广员指标 + IOS下载数统计