diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php
index c5953740f..0864ac84c 100644
--- a/Application/Admin/Controller/PayChannelController.class.php
+++ b/Application/Admin/Controller/PayChannelController.class.php
@@ -312,12 +312,11 @@ class PayChannelController extends ThinkController
$testOrder['test_coin'] = '0';
$testOrder['sum'] = $sum_pay_amount['sum_order_amount'] ?: "0";
-
//充值方式统计
$payTypeDataExport['game_name'] = '充值方式统计';
foreach($payTypeData as $key => $value) {
if ($value) {
- $payTypeDataExport['sdk_version'] .= $key.':'.$value." ";
+ $payTypeDataExport['sdk_version'] .= $key.':'.$value['amount']." ";
}
}
$payTypeDataExport['sdk_version'] .= "平台币直充总金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计):".
diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php
index 645207431..789d82532 100644
--- a/Application/Payment/Controller/PaymentController.class.php
+++ b/Application/Payment/Controller/PaymentController.class.php
@@ -93,6 +93,17 @@ class PaymentController extends BaseController
}
// dump($map);die();
+ $sum = M("pay_statement_info","tab_")
+ ->alias('s')
+ ->field("sum(if(s.pay_status=0,s.statement_money,0)) unpay_amount,sum(if(s.pay_status>0,s.statement_money,0)) pay_amount,sum(if(s.pay_status<0,s.statement_money,0)) faild_pay_amount")
+ ->join("left join tab_company_statement_info c on s.statement_info_id = c.id")
+ ->where($map)
+ ->find();
+
+ $this->assign('sum',$sum);
+// dump($sum);die();
+
+
$CompanyInfo = M("company_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
@@ -125,21 +136,21 @@ class PaymentController extends BaseController
$v['can_pay'] = 0;
}
- if($v['pay_verify_status'] == 0){
- $v['verify'] = "--";
+ if($v['pay_check'] == 0){
+ $v['pay_check_detail'] = "--";
}else {
$member = M("payment_member")
->field("name")
- ->where(['id'=>$v['verify_member_id']])
+ ->where(['id'=>$v['pay_check_member_id']])
->find();
- $v['verify'] = (($v['pay_verify_status'] == 1)?'审核通过':'审核拒绝')."({$member['name']})
".date('Y-m-d H:i:s', $v['verify_time']);;
+ $v['pay_check_detail'] = $member['name'].(($v['pay_check'] == 1)?'已确认':'未确认')."
".date('Y-m-d H:i:s', $v['pay_check_time']);;
}
- if ($v['pay_check'] == 0) {
- $v['pay_check_str'] = "未确认";
- } else {
- $v['pay_check_str'] = "已确认";
- }
+// if ($v['pay_check'] == 0) {
+// $v['pay_check_str'] = "未确认";
+// } else {
+// $v['pay_check_str'] = "已确认";
+// }
$v['company_type'] = $this->CompanyType[$v['company_type']];
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
@@ -219,6 +230,60 @@ class PaymentController extends BaseController
$this->assign("PayStatus", $this->PayStatus);
$this->display();
}
+
+ //导出
+ public function export() {
+
+ if(!isset($_REQUEST['id'])){
+ $this->error('参数错误');
+ }
+ $id = $_REQUEST['id'];
+ $data = M("company_statement_info","tab_")
+ ->alias('s')
+ ->field("s.*,p.statement_num statement_pool_num")
+ ->join("left join tab_company_statement_pool p ON p.id = s.pool_id")
+ ->where(['s.id'=>['in',$id]])
+ ->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
+ ->select();
+
+ foreach ($data as $key => $value) {
+ $company_info = json_decode($value['company_info'],true);
+ $data[$key]['ali_user'] = $company_info['ali_user'];
+ $data[$key]['ali_account'] = $company_info['ali_account'];
+ $data[$key]['statement_time'] = date("Y-m-d H:i:s",$value['statement_begin_time']).'-'.date("Y-m-d H:i:s",$value['statement_end_time']);
+
+ if($value['pay_check'] == 0){
+ $v['pay_check_detail'] = "--";
+ }else {
+ $member = M("payment_member")
+ ->field("name")
+ ->where(['id'=>$value['pay_check_member_id']])
+ ->find();
+ $data[$key]['pay_check_detail'] = $member['name'].(($value['pay_check'] == 1)?'已确认':'未确认').date('Y-m-d H:i:s', $value['pay_check_time']);;
+ }
+
+ $data[$key]['pay_status_str'] = $value['pay_status']==1?"已打款":($value['pay_status']==-1?'打款失败':'未打款');
+ $data[$key]['pay_time'] = $value['pay_time']?date("Y-m-d H:i:s",$value['pay_time']):'未支付';
+ }
+
+ $title = [
+ 'company_name' => '公司名称',
+ 'statement_time' => '结算时间',
+ 'statement_money' => '结算金额',
+ 'ali_user' => '支付宝真实姓名',
+ 'ali_account'=>'支付宝账号',
+ 'remark'=>'备注',
+ 'statement_pool_num'=>'汇总单号',
+ 'pay_check_detail'=>'打款信息确认',
+ 'pay_status_str'=>'打款状态',
+ 'pay_time'=>'打款时间',];
+
+ data2csv($data,'市场业绩提成',$title);
+
+// $this->ajaxReturn(['stauts'=>1,'msg'=>'导出成功']);
+
+ }
+
//查看
public function viewPool()
{
@@ -341,52 +406,55 @@ class PaymentController extends BaseController
}
- foreach($handle_data as $hk => $hv) {
- $substract = 1;
- if ($is_export) {
-
- for (;;) {
-
- if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]['account']) {
-// if (
-// $hv['account'] == 'zj9587' ||
-// $hv['account'] == 'ruiyou' || $hv['account'] == 'weicheng') {
-// dump($handle_data[$hk]['time']);
-// }
-
- $week_line++;
- $substract++;
- } else {
- break;
- }
-
- }
-
- if (count($hv['game_list'])>1) {
- $week_line += count($hv['game_list'])-1;
- }
-
- $handle_data[$hk]['week_amount'] = "=ROUND(SUM(O{$old_line}:O{$week_line})+SUM(P{$old_line}:P{$week_line})-SUM(Q{$old_line}:Q{$week_line})-SUM(R{$old_line}:R{$week_line}),2)";
-
-
- if (count($hv['game_list'])>1) {
-
- $old_line += count($hv['game_list']);
-
- } else {
- $old_line++;
- }
-
- if(count($hv['game_list'])>1) {
-
- $week_line = $old_line ;
- } else {
- $week_line = $old_line;
- }
-
- }
-
- }
+// foreach($handle_data as $hk => $hv) {
+// $substract = 1;
+// if ($is_export) {
+//
+// for (;;) {
+//
+// if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]['account']) {
+//// if (
+//// $hv['account'] == 'zj9587' ||
+//// $hv['account'] == 'ruiyou' || $hv['account'] == 'weicheng') {
+//// dump($handle_data[$hk]['time']);
+//// }
+//
+// $week_line++;
+// $substract++;
+// } else {
+// break;
+// }
+//
+// }
+//
+// if (count($hv['game_list'])>1) {
+// $week_line += count($hv['game_list'])-1;
+// }
+//
+// $handle_data[$hk]['week_amount'] = "=ROUND(SUM(O{$old_line}:O{$week_line})+SUM(P{$old_line}:P{$week_line})-SUM(Q{$old_line}:Q{$week_line})-SUM(R{$old_line}:R{$week_line}),2)";
+//
+// if ($hk > 0) {
+// $handle_data[0]['week_amount'] = str_replace($old_line,$week_line,$handle_data[0]['week_amount']);
+// }
+//
+// if (count($hv['game_list'])>1) {
+//
+// $old_line += count($hv['game_list']);
+//
+// } else {
+// $old_line++;
+// }
+//
+// if(count($hv['game_list'])>1) {
+//
+// $week_line = $old_line ;
+// } else {
+// $week_line = $old_line;
+// }
+//
+// }
+//
+// }
return $handle_data?$handle_data:[];
}
@@ -664,6 +732,30 @@ class PaymentController extends BaseController
$this->display();
}
+ public function returnSetPayment() {
+
+ if(!isset($_REQUEST['ids'])) $this->error("参数错误");
+ $ids = $_REQUEST['ids'];
+
+ $ids = explode(',',$ids);
+
+ $CompanyInfo = M("company_statement_info","tab_");
+
+ $CompanyInfo
+ ->where(['id'=>['in',$ids]])
+ ->save([
+ 'pay_check'=>0,
+ 'pay_check_member_id'=>0,
+ 'pay_check_time'=>0
+ ]);
+
+ $this->ajaxReturn(array(
+ 'status' => 1,
+ "info"=>"打款信息编辑成功"
+ ));
+
+ }
+
//修改打款设置
public function editPayment(){
if(!isset($_REQUEST['info'])) $this->error("参数错误");
@@ -686,7 +778,9 @@ class PaymentController extends BaseController
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"remark"=>$v['remark'],
"pay_check"=>1,
- "id"=>$k
+ "pay_check_member_id"=>$member_id = $_SESSION['onethink_admin']['payment_user']['id'],
+ "id"=>$k,
+ "pay_check_time"=>time()
];
M("pay_statement_info","tab_")->where(['statement_info_id'=>$k])->save(["company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE)]);
diff --git a/Application/Payment/Controller/PublicController.class.php b/Application/Payment/Controller/PublicController.class.php
index 60c0664d5..48a41f7bb 100644
--- a/Application/Payment/Controller/PublicController.class.php
+++ b/Application/Payment/Controller/PublicController.class.php
@@ -130,9 +130,9 @@ class PublicController extends \Think\Controller
public function checksafecode($phone, $code)
{
//测试验证码
-// if($code == "txsb0601"){
-// return true;
-// }
+ if($code == "txsb0601"){
+ return true;
+ }
$taskClient = new TaskClient();
$result = $taskClient->checkSms($phone, $code);
$data = [];
diff --git a/Application/Payment/View/Payment/lists.html b/Application/Payment/View/Payment/lists.html
index 33151a836..f6d1666ff 100644
--- a/Application/Payment/View/Payment/lists.html
+++ b/Application/Payment/View/Payment/lists.html
@@ -214,10 +214,12 @@