Merge pull request 'feature/add_item' (#183) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/183
master
郑永星 4 years ago
commit 727873e25c

@ -130,5 +130,6 @@ return array(
"sys_action_log", "sys_action_log",
"tab_reward_detail", "tab_reward_detail",
"tab_reward_record", "tab_reward_record",
"tab_new_company_statement_info",
] ]
); );

@ -430,12 +430,12 @@ class CompanyStatementController extends ThinkController
$ids = $_POST['id']; $ids = $_POST['id'];
if (!$ids) { if (!$ids) {
$this->ajaxReturn(["status"=>1]); $this->ajaxReturn(["status"=>0]);
} }
$count = SM("company_statement","tab_") $count = SM("company_statement","tab_")
->where("id in({$ids})") ->where("id in({$ids})")
->group("company_type,withdraw_type") ->group("company_type,withdraw_type,company_belong")
->select(); ->select();
foreach ($count as $key => $value) { foreach ($count as $key => $value) {
@ -600,6 +600,8 @@ class CompanyStatementController extends ThinkController
} }
A("FinancialSummary")->getYearList(); A("FinancialSummary")->getYearList();
$this->assign("year",date("Y"));
$this->assign("data",$data); $this->assign("data",$data);
$this->display(); $this->display();
@ -894,36 +896,24 @@ class CompanyStatementController extends ThinkController
$save['sum_money'] = $amount_data['sum_money']-($amount_data['sum_money']*$_POST['fax_ratio']/100); $save['sum_money'] = $amount_data['sum_money']-($amount_data['sum_money']*$_POST['fax_ratio']/100);
$save['user_newcount'] = $amount_data['user_newcount']; $save['user_newcount'] = $amount_data['user_newcount'];
$save['fax_ratio'] = $_POST['fax_ratio']; $save['fax_ratio'] = $_POST['fax_ratio'];
$save['statement_ids'] = $_POST['id'].','.$_POST['other_id'];
$save['create_time'] = time();
$save['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
$is_success = SM("new_company_statement_info","tab_")->add($save); $is_success = SM("new_company_statement_info","tab_")->add($save);
$pool['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
$pool['statement_ids'] = $_POST['id'].','.$_POST['other_id'];
$pool['withdraw_type'] = 1;
$pool['wm_statement_ids'] = $is_success;
$pool['statement_begin_time'] = strtotime(str_replace(".", "-", $amount_data['statement_begin_time']));
$pool['statement_end_time'] = strtotime(str_replace(".", "-", $amount_data['statement_end_time'])) + 86399;
$pool['statement_money'] = $save['sum_money'];
$pool['pay_amount'] = $save['pay_amount'];
$pool['platform_amount'] = $save['pay_amount'];
$pool['company_type'] = 2;
$pool['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y.m.d H:i:s")]);
SM("company_statement_pool","tab_")->add($pool);
if ($_POST['other_id']) { if ($_POST['other_id']) {
$statement_id = $_POST['id'].','.$_POST['other_id']; $statement_id = $_POST['id'].','.$_POST['other_id'];
} else { } else {
$statement_id = $_POST['id']; $statement_id = $_POST['id'];
} }
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$statement_id})")->select(); $dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$statement_id})")->select();
foreach ($dbres as $k => $v) { foreach ($dbres as $k => $v) {
$v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log']['pool_user']=$this->admininfo["username"]; $v['verify_log']['pool_user']=$this->admininfo["username"];
$v['verify_log']['pool_time']=date("Y.m.d H:i:s"); $v['verify_log']['pool_time']=date("Y.m.d H:i:s");
$v['verify_log']['pool_num']=$pool['statement_num']; $v['verify_log']['pool_num']=$save['statement_num'];
$v['verify_log'] = json_encode($v['verify_log']); $v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=2; $v['verify_status']=2;
$v['op_time']=time(); $v['op_time']=time();

@ -52,7 +52,7 @@ class SubCompanyStatementPoolController extends ThinkController
public function _initialize() public function _initialize()
{ {
$this->admininfo = $_SESSION['onethink_admin']['user_auth']; $this->admininfo = $_SESSION['onethink_admin']['user_auth'];
$this->DBModel = SM("CompanyStatementPool","tab_"); $this->DBModel = SM("new_company_statement_info","tab_");
parent::_initialize(); parent::_initialize();
} }
@ -115,79 +115,17 @@ class SubCompanyStatementPoolController extends ThinkController
->where($map) ->where($map)
->order("id desc") ->order("id desc")
->page($page,$row)->select(); ->page($page,$row)->select();
foreach($data as $k => &$v) { foreach($data as $k => &$v) {
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']); $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']); $v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
$v["create_time"] = date("Y.m.d H:i:s",$v["create_time"]);
$v['company_type_str'] = $this->CompanyType[$v['company_type']];
$v['is_payment_str'] = $this->IsPayment[$v['is_payment']];
// $v['can_export'] = $v['platform_amount'] == 0 ? "0" : '1';
// if($v['company_type'] == 2){
$v['can_export'] = 1;
// }
$v['op_time'] = date('Y.m.d H:i:s',$v['op_time']);
$v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}";
$v['ext_file_type'] = empty($v['ext_file']) ? "无" : "有";
$v['withdraw_type'] = $this->WithdrawType[$v['withdraw_type']];;
$v['verify_log'] = json_decode($v['verify_log'], true);
if (isset($params['export'])) {
$symbol = "\n";
} else {
$symbol = "<br>";
}
$v["create"]= "{$v['verify_log']['create_user']} {$symbol} {$v['verify_log']['create_time']}";
if(isset($v['verify_log']['firstverify_user'])){
if($v['verify_status'] == -3){
$ts = "初审拒绝";
}else{
$ts = "初审通过";
}
$v["firstverify"]= "{$ts}({$v['verify_log']['firstverify_user']}) {$symbol} {$v['verify_log']['firstverify_time']}";
$ts = '';
}else{
$v["firstverify"] = '--';
}
if(isset($v['verify_log']['verify_user'])){
if($v['verify_status'] == -1){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
}
$v["verify"]= "{$ts}({$v['verify_log']['verify_user']}) {$symbol} {$v['verify_log']['verify_time']}";
}else{
$v["verify"] = '--';
}
if(isset($v['verify_log']['payment_user'])){
if($v['verify_status'] == -2){
$ts = "拒绝打款";
}elseif($v['verify_status'] == 1){
$ts = "打款信息确认";
}elseif($v['verify_status'] == 2){
$ts = "待打款";
}elseif($v['verify_status'] == 3){
$ts = "打款中";
}elseif($v['verify_status'] == 4){
$ts="打款成功";
}elseif($v['verify_status'] == 5){
$ts="无需打款";
}
$v["payment"]= "{$ts}({$v['verify_log']['payment_user']}){$symbol} {$v['verify_log']['payment_time']}";
}else{
$v["payment"] = '--';
}
$v['oplist'] = $this->OpWmAuth($v); $v['oplist'] = $this->OpWmAuth($v);
} }
// dump($data);die();
$count = $this->DBModel->field("count(id) count,SUM(statement_money) as statement_money,SUM(lack_statement_money) lack_statement_money")->where($map)->find(); $count = $this->DBModel->field("count(id) count")->where($map)->find();
// dd($count); // dd($count);
$params['p'] = $page; $params['p'] = $page;
$params['row'] = $row; $params['row'] = $row;
@ -198,10 +136,6 @@ class SubCompanyStatementPoolController extends ThinkController
$this->assign('data',$data); $this->assign('data',$data);
$this->assign('count',$count); $this->assign('count',$count);
$this->assign('CompanyType',$this->CompanyType);
$this->assign('IsPayment',$this->IsPayment);
$this->assign('VerifyStatus',$this->VerifyStatus);
$this->assign('WithdrawType',$this->WithdrawType);
$this->display(); $this->display();
} }
@ -209,6 +143,7 @@ class SubCompanyStatementPoolController extends ThinkController
//查看 //查看
public function viewPool() public function viewPool()
{ {
if(!isset($_REQUEST['id'])){ if(!isset($_REQUEST['id'])){
$this->error('参数错误'); $this->error('参数错误');
} }
@ -218,53 +153,8 @@ class SubCompanyStatementPoolController extends ThinkController
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
$is_export = true; $is_export = true;
} }
//获取基本信息
$infolist = SM("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
//获取母单
$pool_info = SM("company_statement_pool","tab_")
->field('wm_statement_ids,statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time,verify_log')->where("id={$id}")->find();
if(!empty($pool_info['create_lack_ids'])){
$l_ids = $pool_info['create_lack_ids'];
$lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
$infolist =array_merge($infolist,$lack_info);
}
if ($is_export) { $this->viewWmStatement($id,$is_export);
$symbol = "\n";
} else {
$symbol = "<br>";
}
$pool_info['verify_log'] = json_decode($pool_info['verify_log'], true);
if(isset($pool_info['verify_log']['firstverify_user'])){
if($pool_info['verify_status'] == -3){
$ts = "初审拒绝";
}else{
$ts = "初审通过";
}
$pool_info["firstverify"]= "{$ts}({$pool_info['verify_log']['firstverify_user']}) {$symbol} {$pool_info['verify_log']['firstverify_time']}";
$ts = '';
}else{
$pool_info["firstverify"] = '--';
}
if(isset($pool_info['verify_log']['verify_user'])){
if($pool_info['verify_status'] == -1){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
}
$pool_info["verify"]= "{$ts}({$pool_info['verify_log']['verify_user']}) {$symbol} {$pool_info['verify_log']['verify_time']}";
}else{
$pool_info["verify"] = '--';
}
if(true) {
$this->viewWmStatement($pool_info['wm_statement_ids'],$is_export);
}
} }
@ -400,37 +290,27 @@ class SubCompanyStatementPoolController extends ThinkController
if(!isset($_REQUEST['id'])) $this->error("参数错误"); if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id']; $id = $_REQUEST['id'];
//获取基础信息
$db_res = $this->DBModel->where("id='{$id}'")->find();
if (IS_SUBSITE) { if (IS_SUBSITE) {
$this->cancelWmCompanyPool($db_res); $this->cancelWmCompanyPool($id);
} }
} }
public function cancelWmCompanyPool($info) public function cancelWmCompanyPool($id)
{ {
if(in_array($info['verify_status'],[3,4])) return;//有打款就不允许回退 $wm_statement_ids = $id;
$sids = $info['statement_ids'];
$wm_statement_ids = $info['wm_statement_ids'];
SM()->startTrans();//事务 SM()->startTrans();//事务
$data = SM("new_company_statement_info","tab_")->where(['id'=>$wm_statement_ids])->find();
//删除info //删除info
$infores = SM("new_company_statement_info","tab_")->where(['id'=>$wm_statement_ids])->delete(); $infores = SM("new_company_statement_info","tab_")->where(['id'=>$wm_statement_ids])->delete();
if($infores === false){ if($infores === false){
SM()->rollback(); SM()->rollback();
$this->ajaxReturn(array('status' => 0,"info"=>"撤销汇总失败")); $this->ajaxReturn(array('status' => 0,"info"=>"撤销汇总失败"));
} }
//删除自己
$poolres = $this->DBModel->where("id = {$info['id']}")->delete();
if($poolres === false){
SM()->rollback();
$this->ajaxReturn(array('status' => 0,"info"=>"撤销汇总失败"));
}
//修改结算单信息 //修改结算单信息
$sids = array_filter(explode(",",$sids)); $sids = array_filter(explode(",",$data["statement_ids"]));
$st_res = SM("company_statement","tab_")->field("id,verify_status,verify_log")->where(["id"=>['in',$sids]])->select(); $st_res = SM("company_statement","tab_")->field("id,verify_status,verify_log")->where(["id"=>['in',$sids]])->select();

@ -106,7 +106,7 @@
<div class="input-list input-list-resway search_label_rehab"> <div class="input-list input-list-resway search_label_rehab">
<select id="year" name="year" class="select_gallery" style="width:150px;"> <select id="year" name="year" class="select_gallery" style="width:150px;">
<volist name="YearList" id="vo"> <volist name="YearList" id="vo">
<option value="{$vo.value}" <if condition="I('year') && $vo.value eq I('year')">selected <option value="{$vo.value}" <if condition="$year && $vo.value eq $year">selected
</if> >{$vo.name}</option> </if> >{$vo.name}</option>
</volist> </volist>
</select> </select>

@ -67,10 +67,6 @@
<div class="cf top_nav_list" style="height: 38px;"> <div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 --> <!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom: 15px;"> <div class="jssearch fl cf search_list" style="margin-bottom: 15px;">
<div class="input-list">
<input type="text" name="statement_num" class="" placeholder="请输入订单号" value="{:I('statement_num')}" />&nbsp;
</div>
<div class="input-list"> <div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" /> <input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
@ -104,16 +100,10 @@
<thead> <thead>
<tr> <tr>
<th><input class="check-all" type="checkbox"></th> <th><input class="check-all" type="checkbox"></th>
<th>结算汇总单订单号</th> <th>公司名称</th>
<th>结算时间</th> <th>结算时间</th>
<th>结算类型</th>
<th>结算周期</th>
<!-- <th>是否打款</th> -->
<th>结算金额</th> <th>结算金额</th>
<!-- <th>结算流水</th> --> <th>创建时间</th>
<th>不结算金额</th>
<th>创建记录</th>
<th>凭证</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
@ -129,21 +119,13 @@
<volist name="data" id="data"> <volist name="data" id="data">
<tr> <tr>
<td ><input class="ids" type="checkbox" data-status="{$data.verify_status}" data-export="{$data.can_export}" value="{$data['id']}" name="ids[]"></td> <td ><input class="ids" type="checkbox" data-status="{$data.verify_status}" data-export="{$data.can_export}" value="{$data['id']}" name="ids[]"></td>
<td>{$data.statement_num}</td> <td>{$data.company_name}</td>
<td>{$data.valid}</td> <td>{$data.statement_begin_time}-{$data.statement_end_time}</td>
<td>{$data.company_type_str}</td> <td>{$data.sum_money}</td>
<td>{$data.withdraw_type}</td> <td>{$data.create_time}</td>
<!-- <td>{$data.is_payment_str}</td> -->
<td>{$data.statement_money}</td>
<!-- <td>{$data.platform_amount}</td> -->
<td>{$data.lack_statement_money}</td>
<td>{$data.create}</td>
<td>{$data.ext_file_type}</td>
<td> <td>
<foreach name="data.oplist" item="vo" > <a class='confirm viewPool' data-id="{$data['id']}">查看</a>
{$vo} <a class='confirm cancelPool' data-id="{$data['id']}">撤销汇总</a>
</foreach>
</td> </td>
</tr> </tr>
</volist> </volist>
@ -419,11 +401,7 @@
$("#export").click(function () { $("#export").click(function () {
var flag = false; var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("export") == 1){ return $(elem).val();
return $(elem).val();
}else{
flag = true;
}
}).get(); }).get();
if(text.length > 20){ if(text.length > 20){

Loading…
Cancel
Save