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

数据权限配置添加
master
廖金灵 5 years ago committed by Gogs
commit 4695b9263d

@ -2253,9 +2253,9 @@ class ExportController extends Controller
if(!empty(I('get.extend'))) { if(!empty(I('get.extend'))) {
$map['tab_spend.extend'] = I('get.extend'); $map['tab_spend.extend'] = I('get.extend');
$data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->page($p, $row)->order('tab_repair_pay.id DESC')->select(); $data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->order('tab_repair_pay.id DESC')->select();
} else { } else {
$data = M('repair_pay', 'tab_')->where($map)->page($p, $row)->order('id DESC')->select(); $data = M('repair_pay', 'tab_')->where($map)->order('id DESC')->select();
} }
$xlsData = []; $xlsData = [];

@ -2,6 +2,7 @@
namespace Admin\Controller; namespace Admin\Controller;
use mysql_xdevapi\Exception;
use User\Api\UserApi as UserApi; use User\Api\UserApi as UserApi;
use OSS\OssClient; use OSS\OssClient;
use OSS\Core\OSsException; use OSS\Core\OSsException;
@ -472,4 +473,80 @@ class PromoteCompanyController extends ThinkController
} }
# code... # code...
} }
public function promoteDataConfigIndex() {
if (IS_POST) {
$changeData = I('post.','');
$promoteData = M("promote","tab_")
->field("id")
->where(['company_belong'=>2])
->select();
$promoteData = implode(',',array_column($promoteData,'id'));
if ($changeData['admin_type'] == 1) {
$num_pend = 0;
$num_deposit = 0;
if ($promoteData) {
$sql_spend = "UPDATE `tab_spend` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in({$promoteData})";
$sql_deposit = "UPDATE `tab_deposit` SET `old_change_promote_id`=`promote_id`,`old_change_promote_account`=`promote_account`,`promote_id`=0,`promote_account`='无' WHERE promote_id in({$promoteData})";
$model = new \Think\Model();
$num_pend = $model->execute($sql_spend,true);
$num_deposit = $model->execute($sql_deposit,true);
$this->ajaxReturn(['info'=>"处理订单数据".($num_pend+$num_deposit).'条']);
}
} else if ($changeData['admin_type'] == 2){
$num_pend = 0;
$num_deposit = 0;
if ($promoteData) {
$sql_spend = "UPDATE `tab_spend` SET `promote_id`=`old_change_promote_id`,`promote_account`=`old_change_promote_account`,`old_change_promote_id`=0,`old_change_promote_account`=''
WHERE old_change_promote_id in ({$promoteData})";
$sql_deposit = "UPDATE `tab_deposit` SET `promote_id`=`old_change_promote_id`,`promote_account`=`old_change_promote_account`,`old_change_promote_id`=0,`old_change_promote_account`=''
WHERE old_change_promote_id in ({$promoteData})";
$model = new \Think\Model();
$num_pend = $model->execute($sql_spend,true);
$num_deposit = $model->execute($sql_deposit,true);
$this->ajaxReturn(['info'=>"将数据还原,处理订单数据".($num_pend+$num_deposit).'条']);
}
}
} else {
$promoteData = M("promote","tab_")
->field("id")
->where(['company_belong'=>2])
->select();
$promoteData = implode(',',array_column($promoteData,'id'));
$spendData = M('spend','tab_')->field("old_change_promote_account")->where(['old_change_promote_id'=>['in',$promoteData]])->find();
// var_dump($spendData);die();
if ($spendData['old_change_promote_account']) {
$this->assign('old_change_promote_account',1);
}
$this->display('promotedataconfigindex');
}
}
} }

@ -0,0 +1,157 @@
<extend name="Public/base" />
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
</style>
</block>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/md5.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<style>
.coin-detail{
display: block;
float: left;
text-align: center;
line-height: 35px;
width: 100px;
height: 35px;
font-size: 14px;
border-radius: 4px;
cursor: pointer;
}
</style>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">业务配置</h3>
</div>
<div class="tab-content tabcon1711">
<!-- 表单 -->
<!-- <form id="form" action="{:U('add')}" 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" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="admin_type" name="admin_type" class="select_gallery" style="width: 215px;">
<option value="1" <if condition="$old_change_promote_account eq 1"> selected </if>>无</option>
<option value="2" <if condition="$old_change_promote_account neq 1"> selected </if>>市场专员</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l">聚合平台订单归属:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="together_type" name="together_type" class="select_gallery" style="width: 215px;">
<option value="1"></option>
<option value="2">市场专员</option>
</select>
</div>
</td>
</tr>
</tbody>
</table>
<table border="1" style="width: 600px;text-align: center;" cellspacing="0" cellpadding="0" id="docShow">
</table>
</div>
<div class="form-item cf" style="margin-bottom: 40px;">
<button class="submit_btn " id="submit" style="margin-left:210px;">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:history.back(-1);" >
返回
</a>
</div>
<!-- </form> -->
</div>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('PromoteCompany/promoteDataConfigIndex')}");
$('#submit').click(function(){
$('#form').submit();
});
</script>
<script>
var doc = [];
function addFile(info) {
doc.push(info);
layer.closeAll();
PROMOTE.juicerFun();
// window.parent.addFile(info);
}
$('#contact_begin').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
$(".coin-detail").click(function () {
var url = $(this).data('url');
var title = '文档添加';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
});
$("#submit").on("click",function(){
var cres = {admin_type:$("#admin_type").val(),together_type:$("#together_type").val()};
layer.confirm('是否确认更改业务配置',{title:''} , function () {
$.ajax({
url: "{:U('PromoteCompany/promoteDataConfigIndex')}",
type: "post",
data: cres,
dataType: "json",
success: function (data) {
layer.msg(data.info);
window.location.reload();
},
error: function (e) {
}
});
});
})
</script>
</block>

@ -211,7 +211,8 @@
<else /> <else />
{:encryptStr(get_promote_account($data['promote_id']))} {:encryptStr(get_promote_account($data['promote_id']))}
</if>--> </if>-->
{:get_promote_account($data['promote_id'])} {$data['promote_account']}
<!-- {:get_promote_account($data['promote_id'])}-->
</eq> </eq>
</td> </td>
<td>{$data.spend_ip}</td> <td>{$data.spend_ip}</td>

@ -1605,6 +1605,10 @@ CREATE TABLE `tab_finance_compare_info` (
KEY `pay_way` (`pay_way`) USING BTREE KEY `pay_way` (`pay_way`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='财务导入对账详情表'; ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='财务导入对账详情表';
-- zyx 20200417
ALTER TABLE `tab_spend`
ADD COLUMN `old_change_promote_id` int(11) NULL DEFAULT 0 COMMENT '修改配置前渠道' AFTER `old_promote_account`,
ADD COLUMN `old_change_promote_account` varchar(30) NULL COMMENT '修改配置前渠道账号' AFTER `old_change_promote_id`;
--kv chenzhi 20200422 --kv chenzhi 20200422
CREATE TABLE `sys_kv` ( CREATE TABLE `sys_kv` (
@ -1645,3 +1649,6 @@ CREATE TABLE `tab_aggregate_statement` (
KEY `channel_id` (`channel_id`) USING BTREE, KEY `channel_id` (`channel_id`) USING BTREE,
KEY `link_phone` (`link_phone`) USING BTREE KEY `link_phone` (`link_phone`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='聚合渠道结算单'; ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='聚合渠道结算单';
ALTER TABLE `tab_deposit`
ADD COLUMN `old_change_promote_id` int(11) NULL DEFAULT 0 COMMENT '修改配置前渠道' ,
ADD COLUMN `old_change_promote_account` varchar(30) NULL COMMENT '修改配置前渠道账号' ;
Loading…
Cancel
Save