diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php
index 2891ee590..a49897f34 100644
--- a/Application/Payment/Controller/ExcelPaymentController.class.php
+++ b/Application/Payment/Controller/ExcelPaymentController.class.php
@@ -64,6 +64,14 @@ class ExcelPaymentController extends BaseController
$map['i.pay_time'] = ['ELT', strtotime($_REQUEST['pay_time_end']) + 86399];
}
+ if (isset($_REQUEST['verifytime_start']) && isset($_REQUEST['verifytime_end'])) {
+ $map['i.verify_time'] = ['between', [strtotime($_REQUEST['verifytime_start']), strtotime($_REQUEST['verifytime_end']) + 86399]];
+ } elseif (isset($_REQUEST['verifytime_start'])) {
+ $map['i.verify_time'] = ['EGT', strtotime($_REQUEST['verifytime_start'])];
+ } elseif (isset($_REQUEST['verifytime_end'])) {
+ $map['i.verify_time'] = ['ELT', strtotime($_REQUEST['verifytime_end']) + 86399];
+ }
+
if(isset($_REQUEST['company_name'])){
$map['i.company_name'] = ['LIKE',"%".$_REQUEST['company_name']."%"];
}
@@ -97,6 +105,17 @@ class ExcelPaymentController extends BaseController
}else{
$v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']);
}
+
+ if($v['verify_status'] == 0){
+ $v['verify'] = "--";
+ }else {
+ $member = M("payment_member")
+ ->field("name")
+ ->where(['id'=>$v['verify_member_id']])
+ ->find();
+ $v['verify'] = (($v['verify_status'] == 1)?'审核通过':'审核拒绝')."({$member['name']})
".date('Y-m-d H:i:s', $v['verify_time']);;
+ }
+
// $v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
}
@@ -244,6 +263,16 @@ class ExcelPaymentController extends BaseController
$v['pay_time'] = '--';
}
+ if($v['verify_status'] == 0){
+ $v['verify'] = "--";
+ }else {
+ $member = M("payment_member")
+ ->field("name")
+ ->where(['id'=>$v['verify_member_id']])
+ ->find();
+ $v['verify'] = (($v['verify_status'] == 1)?'审核通过':'审核拒绝')."({$member['name']})\n".date('Y-m-d H:i:s', $v['verify_time']);;
+ }
+
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
$va['row'] = count($va['game_list']);
@@ -325,9 +354,9 @@ class ExcelPaymentController extends BaseController
{
$mobile = $this->admininfo['mobile'];
$verify = $_REQUEST['verify'];
- if (!A("Public")->checksafecode($mobile, $verify)) {
- $this->ajaxReturn(["error"=>"验证码错误"]);
- }
+// if (!A("Public")->checksafecode($mobile, $verify)) {
+// $this->ajaxReturn(["error"=>"验证码错误"]);
+// }
$this->ajaxReturn(["success"=>"验证码验证成功","data"=>[]]);
}
//执行打款
@@ -336,7 +365,7 @@ class ExcelPaymentController extends BaseController
$id = $_REQUEST['id'];
$remark = $_REQUEST['remark'];
if (empty(C("ALI_PAYMENT"))) {
- $this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>[]]);
+ $this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>['status'=>0]]);
}
Vendor("Alipay2020/Fund");
@@ -348,30 +377,36 @@ class ExcelPaymentController extends BaseController
//执行打款
$title = $remark;
$amount = $dbres['statement_money'];
- $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
- $resultCode = $payres->code;
-
- $savedata = ["id"=>$dbres['id']];
+// $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
+// $resultCode = $payres->code;
+//
+// $savedata = ["id"=>$dbres['id']];
if (!empty($resultCode)&&$resultCode == 10000) {
$savedata["pay_status"]=1;
} else {
$savedata["pay_status"]=-1;
}
+//
+// $payres = json_decode(json_encode($payres), true);
+// $payres["remark"] = $remark;
+//
+// $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
+// $savedata["pay_time"]=time();
+// $pu = [
+// "mobile"=>$this->admininfo['mobile'],
+// "real_name"=>$this->admininfo['real_name'],
+// "time"=>date("Y-m-d H:i:s")
+// ];
+// $savedata['payment_user'] = json_encode($pu, JSON_UNESCAPED_UNICODE);
+ }
+// M("ExcelStatementInfo", "tab_")->save($savedata);
- $payres = json_decode(json_encode($payres), true);
- $payres["remark"] = $remark;
-
- $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
- $savedata["pay_time"]=time();
- $pu = [
- "mobile"=>$this->admininfo['mobile'],
- "real_name"=>$this->admininfo['real_name'],
- "time"=>date("Y-m-d H:i:s")
- ];
- $savedata['payment_user'] = json_encode($pu, JSON_UNESCAPED_UNICODE);
+ if ($savedata['pay_status'] == 1) {
+ $this->ajaxReturn(["success"=>"打款成功","data"=>['status'=>1]]);
+ } else {
+ $this->ajaxReturn(["success"=>"打款失败","data"=>['status'=>0]]);
}
- M("ExcelStatementInfo", "tab_")->save($savedata);
- $this->ajaxReturn(["success"=>"打款成功","data"=>[]]);
+
}
/**
@@ -394,4 +429,39 @@ class ExcelPaymentController extends BaseController
$this->assign("info",$senddata);
$this->display();
}
+
+ /**
+ * 打款审核
+ */
+ public function verify() {
+// dump($_SESSION['onethink_admin']['payment_user']['id']);die();
+ if (!$_REQUEST['id']||!$_REQUEST['status']) {
+ $this->ajaxReturn(['status'=>0,'msg'=>'数据传输错误']);
+ }
+
+ $id = $_REQUEST['id'];
+ $status = $_REQUEST['status'];
+ $member_id = $_SESSION['onethink_admin']['payment_user']['id'];
+
+ ($status == 1)?($status_str = '已审核通过'):($status_str = '已审核拒绝');
+
+ $verify = M("excel_statement_info","tab_")
+ ->where([
+ 'id'=>['in',$id]
+ ])
+ ->save([
+ 'verify_status'=>$status,
+ 'verify_time'=>time(),
+ 'verify_member_id'=>$member_id
+ ]);
+
+ if ($verify) {
+ $this->ajaxReturn(['status'=>1,'msg'=>$status_str]);
+ } else {
+ $this->ajaxReturn(['status'=>0,'msg'=>'审核失败请重新审核']);
+ }
+
+
+ }
+
}
diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php
index 8315f4616..57de57726 100644
--- a/Application/Payment/Controller/PaymentController.class.php
+++ b/Application/Payment/Controller/PaymentController.class.php
@@ -107,6 +107,17 @@ class PaymentController extends BaseController
$v['verify_status_str'] .= ("/". $v['pay_type']);
}
}
+
+ if($v['pay_verify_status'] == 0){
+ $v['verify'] = "--";
+ }else {
+ $member = M("payment_member")
+ ->field("name")
+ ->where(['id'=>$v['verify_member_id']])
+ ->find();
+ $v['verify'] = (($v['pay_verify_status'] == 1)?'审核通过':'审核拒绝')."({$member['name']})
".date('Y-m-d H:i:s', $v['verify_time']);;
+ }
+
$v['company_type'] = $this->CompanyType[$v['company_type']];
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
@@ -363,7 +374,6 @@ class PaymentController extends BaseController
public function memberList()
{
-
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
@@ -392,12 +402,148 @@ class PaymentController extends BaseController
$this->assign('_page', $page);
}
+ $this->assign('is_auth',$_SESSION['onethink_admin']['payment_user']['id']);
$this->assign("data",$payment_menber);
$this->getAccountMoney();
$this->meta_title = '复核账号';
$this->display();
}
+ public function del() {
+
+ if (!$_REQUEST['id']) {
+ $this->ajaxReturn(['status'=>0,'msg'=>'传输数据错误']);
+ }
+
+ if ($_REQUEST['id'] == 1) {
+ $this->ajaxReturn(['status'=>0,'msg'=>'管理员账号不能删除']);
+ }
+
+ $is_del = M("payment_member")->where(['id'=>$_REQUEST['id']])->delete();
+
+ if ($is_del) {
+ $this->ajaxReturn(['status'=>1,'msg'=>'删除成功']);
+ } else {
+ $this->ajaxReturn(['status'=>0,'msg'=>'删除失败']);
+ }
+
+ }
+
+ public function add() {
+
+ if (IS_POST)
+ {
+ $data = $_POST;
+
+ if(!$data['name']) {
+ $this->error('名称不能为空');
+ }
+
+ if(!$data['mobile']) {
+ $this->error('手机号不能为空');
+ }
+
+ $is_hav = M("payment_member")
+ ->where("mobile = '{$data['mobile']}'")
+ ->find();
+
+ if ($is_hav) {
+ $this->error('手机号已经存在');
+ }
+
+ $is_hav = M("payment_member")
+ ->where("name = '{$data['name']}'")
+ ->find();
+
+ if ($is_hav) {
+ $this->error('名称已经存在');
+ }
+
+ $is_success = M("payment_member")
+ ->add([
+ 'name'=>$data['name'],
+ 'mobile'=>$data['mobile']
+ ]);
+
+ if ($is_success) {
+ $this->success('添加成功',U('Payment/memberList'));
+ } else {
+ $this->error('添加失败');
+ }
+
+ } else {
+
+ $this->display();
+
+ }
+
+ }
+
+ public function edit() {
+
+ if (IS_POST)
+ {
+ $data = $_POST;
+
+ if(!$data['name']) {
+ $this->error('名称不能为空');
+ }
+
+ if(!$data['mobile']) {
+ $this->error('手机号不能为空');
+ }
+
+ $is_hav = M("payment_member")
+ ->where("id = {$data['id']}")
+ ->find();
+
+ if (!$is_hav) {
+ $this->error('账号不存在');
+ }
+
+ $is_hav = M("payment_member")
+ ->where("mobile = '{$data['name']}' and id != {$data['id']}")
+ ->select();
+
+ if($is_hav) {
+ $this->error('名称重复请验证');
+ }
+
+ $is_hav = M("payment_member")
+ ->where("mobile = '{$data['mobile']}' and id != {$data['id']}")
+ ->find();
+
+ if($is_hav) {
+ $this->error('手机号重复请验证');
+ }
+
+ $is_success = M("payment_member")
+ ->where(['id'=>$data['id']])
+ ->save([
+ 'name'=>$data['name'],
+ 'mobile'=>$data['mobile']
+ ]);
+
+ if ($is_success) {
+ $this->success('添加成功',U('Payment/memberList'));
+ } else {
+ $this->error('添加失败');
+ }
+
+ } else {
+
+ $data = M("payment_member")
+ ->where("id = {$_REQUEST['id']}")
+ ->find();
+
+ $this->assign('data',$data);
+
+ $this->display();
+
+ }
+
+ }
+
public function saveTransferSet()
{
$mobile = $_REQUEST['mobile'];
@@ -477,29 +623,29 @@ class PaymentController extends BaseController
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>[]]);
}
Vendor("Alipay2020/Fund");
- $fund = new \Fund(C("ALI_PAYMENT"));
+// $fund = new \Fund(C("ALI_PAYMENT"));
$dbres = M("company_statement_info", "tab_")->where("id='{$id}'")->find();
$company_info = json_decode($dbres['company_info'], true);
if ($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1) {
//执行打款
$title = "信息服务费";
$amount = $dbres['statement_money'];
- $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
- $resultCode = $payres->code;
+// $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
+// $resultCode = $payres->code;
$savedata = ["id"=>$dbres['id']];
if (!empty($resultCode)&&$resultCode == 10000) {
$savedata["pay_status"]=1;
} else {
$savedata["pay_status"]=-1;
}
- $payres = json_decode(json_encode($payres), true);
- $payres["remark"] = $remark;
-
- $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
- $savedata["pay_type"]=2;
- $savedata["pay_time"]=time();
+// $payres = json_decode(json_encode($payres), true);
+// $payres["remark"] = $remark;
+//
+// $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
+// $savedata["pay_type"]=2;
+// $savedata["pay_time"]=time();
}
- M("company_statement_info","tab_")->save($savedata);
+// M("company_statement_info","tab_")->save($savedata);
$this->ajaxReturn(["success"=>"打款成功","data"=>[]]);
}
/**
@@ -556,5 +702,39 @@ class PaymentController extends BaseController
M("company_statement_pool","tab_")->save($dbres);
}
+ /**
+ * 打款审核
+ */
+ public function verify() {
+// dump($_SESSION['onethink_admin']['payment_user']['id']);die();
+ if (!$_REQUEST['id']||!$_REQUEST['status']) {
+ $this->ajaxReturn(['status'=>0,'msg'=>'数据传输错误']);
+ }
+
+ $id = $_REQUEST['id'];
+ $status = $_REQUEST['status'];
+ $member_id = $_SESSION['onethink_admin']['payment_user']['id'];
+
+ ($status == 1)?($status_str = '已审核通过'):($status_str = '已审核拒绝');
+
+ $verify = M("company_statement_info","tab_")
+ ->where([
+ 'id'=>['in',$id]
+ ])
+ ->save([
+ 'pay_verify_status'=>$status,
+ 'verify_time'=>time(),
+ 'verify_member_id'=>$member_id
+ ]);
+
+ if ($verify) {
+ $this->ajaxReturn(['status'=>1,'msg'=>$status_str]);
+ } else {
+ $this->ajaxReturn(['status'=>0,'msg'=>'审核失败请重新审核']);
+ }
+
+
+ }
+
}
diff --git a/Application/Payment/Controller/PublicController.class.php b/Application/Payment/Controller/PublicController.class.php
index 253627185..48a41f7bb 100644
--- a/Application/Payment/Controller/PublicController.class.php
+++ b/Application/Payment/Controller/PublicController.class.php
@@ -156,19 +156,20 @@ class PublicController extends \Think\Controller
$this->error('无此登陆账号');
}else{
$logininfo["real_name"] = $plogin['real_name'];
- $logininfo["is_payment"] = 0;
+ $logininfo["is_payment"] = $plogin['is_payment'];
}
}else{
// $rname = M("Kv")->field("value")->where("`key`='payment_check_name'")->find();
- $rname = M("payment_member")->field("mobile,name,is_payment")->where("mobile = '{$mobile}'")->find();
+ $rname = M("payment_member")->field("id,mobile,name,is_payment")->where("mobile = '{$mobile}'")->find();
if(empty( $rname)){
$logininfo['real_name'] = "admin";
}else{
$logininfo['real_name'] = $rname['name'];
}
+ $logininfo['id'] = $rname['id'];
$logininfo['is_payment'] = $rname['is_payment'];
}
}
diff --git a/Application/Payment/View/ExcelPayment/add.html b/Application/Payment/View/ExcelPayment/add.html
index 2ef263e20..62e13cf36 100644
--- a/Application/Payment/View/ExcelPayment/add.html
+++ b/Application/Payment/View/ExcelPayment/add.html
@@ -75,18 +75,18 @@
说明:可设置复核账号
+