|
|
|
@ -157,7 +157,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
if (!(M('statement','tab_')->where(['ext_field'=>$_REQUEST['ext_field']])->find())) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$second_party_info['partner'].getNowDate(),'op_name'=>'新增下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增下游对账单']);
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$second_party_info['partner'].'/'.getNowDate(),'op_name'=>'新增下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增下游对账单']);
|
|
|
|
|
|
|
|
|
|
M('statement','tab_')->add($insert);
|
|
|
|
|
$this->ajaxReturn(['code'=>1, 'msg'=>'生成结算单成功']);
|
|
|
|
@ -216,7 +216,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
if ((M('statement','tab_')->where(['ext_field'=>$_REQUEST['ext_field']])->save($insert))) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$second_party_info['partner'].getNowDate(),'op_name'=>'编辑下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增下游对账单']);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$second_party_info['partner'].'/'.getNowDate(),'op_name'=>'编辑下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-新增下游对账单']);
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(['code'=>1, 'msg'=>'结算单编辑成功']);
|
|
|
|
|
} else {
|
|
|
|
@ -230,14 +230,13 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
if (!$id) {
|
|
|
|
|
$this->ajaxReturn(['code'=>2000,'error'=>'no']);
|
|
|
|
|
}
|
|
|
|
|
$statementData = M('statement','tab_')->where(['id'=>$id])->find();
|
|
|
|
|
|
|
|
|
|
$is_del = M('statement','tab_')->where(['id'=>$id])->delete();
|
|
|
|
|
|
|
|
|
|
if ($is_del) {
|
|
|
|
|
|
|
|
|
|
$statementData = M('statement','tab_')->where(['id'=>$id])->find();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>2,'key'=>$statementData['company_name'].date('YmdHis',$statementData['statement_begin_time']).date('YmdHis',$statementData['statement_end_time']),'op_name'=>'删除下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-删除下游对账单']);
|
|
|
|
|
addOperationLog(['op_type'=>2,'key'=>$statementData['company_name'].'/'.date('YmdHis',$statementData['statement_begin_time']).'/'.date('YmdHis',$statementData['statement_end_time']),'op_name'=>'删除下游对账单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-删除下游对账单']);
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(['code'=>0,'success'=>'ok']);
|
|
|
|
|
} else {
|
|
|
|
@ -305,6 +304,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
'remark' => I('remark'),
|
|
|
|
|
'reward_time' => strtotime(I('reward_time'))
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$accounts = I('account');
|
|
|
|
|
$user_types = I('user_type');
|
|
|
|
|
if ($accounts) {
|
|
|
|
@ -335,8 +335,8 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
if ($upt === false) {
|
|
|
|
|
$this->error('保存失败');
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$data['reward_type'].$data['company_type'].$data['money'],'op_name'=>'修改奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
|
|
|
|
|
$companyName = M('partner','tab_')->field('partner')->where(['id'=>$data['company_id']])->find();
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$companyName['partner'].'/'.(($data['reward_type']==1)?'奖励':'惩罚').'/'.$data['money'],'op_name'=>'修改奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理-修改奖惩记录']);
|
|
|
|
|
|
|
|
|
|
$this->success('保存成功', U('StatementMangement/rewardManageList'));
|
|
|
|
|
}
|
|
|
|
@ -345,7 +345,8 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
$data['creater_id'] = is_login();
|
|
|
|
|
$ins = M('reward_record', 'tab_')->add($data);
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$data['reward_type'].$data['company_type'].$data['money'],'op_name'=>'新增奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
|
|
|
|
|
$companyName = M('partner','tab_')->field('partner')->where(['id'=>$data['company_id']])->find();
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$companyName['partner'].'/'.(($data['reward_type']==1)?'奖励':'惩罚').'/'.$data['money'],'op_name'=>'新增奖惩记录','url'=>U('Query/settlement'),'menu'=>'推广员-结算单管理-奖罚记录管理-新增奖惩记录']);
|
|
|
|
|
|
|
|
|
|
return $ins ? $this->success('新增成功', U('StatementMangement/rewardManageList')) : $this->error('新增失败');
|
|
|
|
|
}
|
|
|
|
@ -359,7 +360,9 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
$upt = M('reward_record', 'tab_')->where(['id'=>$id])->delete();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>2,'key'=>$rewardRecordData['reward_type'].$rewardRecordData['company_type'].$rewardRecordData['money'],'op_name'=>'删除奖惩记录','url'=>U('StatementMangement/rewardManageList'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
|
|
|
|
|
$companyName = M('partner','tab_')->field('partner')->where(['id'=>$rewardRecordData['company_id']])->find();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>2,'key'=>$companyName['partner'].'/'.(($rewardRecordData['reward_type']==1)?'奖励':'惩罚').'/'.$rewardRecordData['money'],'op_name'=>'删除奖惩记录','url'=>U('StatementMangement/rewardManageList'),'menu'=>'推广员-结算单管理-奖罚记录管理']);
|
|
|
|
|
|
|
|
|
|
return $upt ? $this->success('删除成功') : $this->error('删除失败');
|
|
|
|
|
} else {
|
|
|
|
@ -607,7 +610,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
if ($is_save) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>'个人结算单'.getNowDate(),'op_name'=>'生成下游个人结算单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-生成下游个人结算单']);
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>'个人结算单'.'/'.getNowDate(),'op_name'=>'生成下游个人结算单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-生成下游个人结算单']);
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(['status'=>1,'msg'=>'生成成功']);
|
|
|
|
|
} else {
|
|
|
|
@ -837,7 +840,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
if ($is_save) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>'个人结算单'.getNowDate(),'op_name'=>'编辑下游个人结算单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-编辑下游个人结算单']);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>'个人结算单'.'/'.getNowDate(),'op_name'=>'编辑下游个人结算单','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-编辑下游个人结算单']);
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(['status'=>1,'msg'=>'修改成功']);
|
|
|
|
|
} else {
|
|
|
|
@ -884,7 +887,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['company_name'].date('YmdHis',$value['statement_begin_time']).date('YmdHis',$value['statement_end_time']),'op_name'=>'编辑结算单审核通过','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-结算单审核通过']);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['company_name'].'/'.date('YmdHis',$value['statement_begin_time']).'/'.date('YmdHis',$value['statement_end_time']),'op_name'=>'编辑结算单审核通过','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-结算单审核通过']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -912,7 +915,7 @@ class StatementMangementController extends ThinkController
|
|
|
|
|
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['company_name'].date('YmdHis',$value['statement_begin_time']).date('YmdHis',$value['statement_end_time']),'op_name'=>'编辑结算单审核通过','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-结算单审核通过']);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['company_name'].'/'.date('YmdHis',$value['statement_begin_time']).'/'.date('YmdHis',$value['statement_end_time']),'op_name'=>'编辑结算单审核通过','url'=>U('StatementMangement/lists'),'menu'=>'推广员-结算管理-结算单管理-结算单审核通过']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|