|
@@ -1,57 +1,61 @@
|
|
<?php
|
|
<?php
|
|
|
|
|
|
namespace app\admin\controller;
|
|
namespace app\admin\controller;
|
|
|
|
+
|
|
use think\facade\View;
|
|
use think\facade\View;
|
|
use think\facade\Lang;
|
|
use think\facade\Lang;
|
|
use think\facade\Db;
|
|
use think\facade\Db;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * ============================================================================
|
|
|
|
|
|
+
|
|
*
|
|
*
|
|
- * ============================================================================
|
|
|
|
|
|
+
|
|
*
|
|
*
|
|
* ----------------------------------------------------------------------------
|
|
* ----------------------------------------------------------------------------
|
|
*
|
|
*
|
|
- * ============================================================================
|
|
|
|
|
|
+
|
|
* 控制器
|
|
* 控制器
|
|
*/
|
|
*/
|
|
-class Predeposit extends AdminControl {
|
|
|
|
|
|
+class Predeposit extends AdminControl
|
|
|
|
+{
|
|
const EXPORT_SIZE = 1000;
|
|
const EXPORT_SIZE = 1000;
|
|
- public function initialize() {
|
|
|
|
|
|
+ public function initialize()
|
|
|
|
+ {
|
|
parent::initialize();
|
|
parent::initialize();
|
|
- Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/predeposit.lang.php');
|
|
|
|
|
|
+ Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/predeposit.lang.php');
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
* 充值明细
|
|
* 充值明细
|
|
*/
|
|
*/
|
|
|
|
|
|
- public function pdrecharge_list() {
|
|
|
|
|
|
+ public function pdrecharge_list()
|
|
|
|
+ {
|
|
$condition = array();
|
|
$condition = array();
|
|
$if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_start_date'));
|
|
$if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_start_date'));
|
|
$if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_end_date'));
|
|
$if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_end_date'));
|
|
$start_unixtime = $if_start_date ? strtotime(input('param.query_start_date')) : null;
|
|
$start_unixtime = $if_start_date ? strtotime(input('param.query_start_date')) : null;
|
|
$end_unixtime = $if_end_date ? strtotime(input('param.query_end_date')) : null;
|
|
$end_unixtime = $if_end_date ? strtotime(input('param.query_end_date')) : null;
|
|
if ($start_unixtime) {
|
|
if ($start_unixtime) {
|
|
- $condition[]=array('pdr_addtime','>=', $start_unixtime);
|
|
|
|
|
|
+ $condition[] = array('pdr_addtime', '>=', $start_unixtime);
|
|
}
|
|
}
|
|
if ($end_unixtime) {
|
|
if ($end_unixtime) {
|
|
- $end_unixtime=$end_unixtime+86399;
|
|
|
|
- $condition[]=array('pdr_addtime','<=', $end_unixtime);
|
|
|
|
|
|
+ $end_unixtime = $end_unixtime + 86399;
|
|
|
|
+ $condition[] = array('pdr_addtime', '<=', $end_unixtime);
|
|
}
|
|
}
|
|
if (input('param.mname') != '') {
|
|
if (input('param.mname') != '') {
|
|
- $condition[]=array('pdr_member_name','like', "%" . input('param.mname') . "%");
|
|
|
|
|
|
+ $condition[] = array('pdr_member_name', 'like', "%" . input('param.mname') . "%");
|
|
}
|
|
}
|
|
if (input('param.paystate_search') != '') {
|
|
if (input('param.paystate_search') != '') {
|
|
- $condition[]=array('pdr_payment_state','=',input('param.paystate_search'));
|
|
|
|
|
|
+ $condition[] = array('pdr_payment_state', '=', input('param.paystate_search'));
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$recharge_list = $predeposit_model->getPdRechargeList($condition, 20, '*', 'pdr_id desc');
|
|
$recharge_list = $predeposit_model->getPdRechargeList($condition, 20, '*', 'pdr_id desc');
|
|
View::assign('recharge_list', $recharge_list);
|
|
View::assign('recharge_list', $recharge_list);
|
|
View::assign('show_page', $predeposit_model->page_info->render());
|
|
View::assign('show_page', $predeposit_model->page_info->render());
|
|
-
|
|
|
|
|
|
+
|
|
View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
|
|
View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
|
|
-
|
|
|
|
|
|
+
|
|
$this->setAdminCurItem('pdrecharge_list');
|
|
$this->setAdminCurItem('pdrecharge_list');
|
|
return View::fetch();
|
|
return View::fetch();
|
|
}
|
|
}
|
|
@@ -59,7 +63,8 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 充值编辑(更改成收到款)
|
|
* 充值编辑(更改成收到款)
|
|
*/
|
|
*/
|
|
- public function recharge_edit() {
|
|
|
|
|
|
+ public function recharge_edit()
|
|
|
|
+ {
|
|
$id = intval(input('param.id'));
|
|
$id = intval(input('param.id'));
|
|
if ($id <= 0) {
|
|
if ($id <= 0) {
|
|
$this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdrecharge_list');
|
|
$this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdrecharge_list');
|
|
@@ -67,8 +72,8 @@ class Predeposit extends AdminControl {
|
|
//查询充值信息
|
|
//查询充值信息
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdr_id','=',$id);
|
|
|
|
- $condition[] = array('pdr_payment_state','=',0);
|
|
|
|
|
|
+ $condition[] = array('pdr_id', '=', $id);
|
|
|
|
+ $condition[] = array('pdr_payment_state', '=', 0);
|
|
$info = $predeposit_model->getPdRechargeInfo($condition);
|
|
$info = $predeposit_model->getPdRechargeInfo($condition);
|
|
if (empty($info)) {
|
|
if (empty($info)) {
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdrecharge_list');
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdrecharge_list');
|
|
@@ -90,15 +95,15 @@ class Predeposit extends AdminControl {
|
|
//取支付方式信息
|
|
//取支付方式信息
|
|
$payment_model = model('payment');
|
|
$payment_model = model('payment');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[]=array('payment_code','=',input('post.payment_code'));
|
|
|
|
|
|
+ $condition[] = array('payment_code', '=', input('post.payment_code'));
|
|
$payment_info = $payment_model->getPaymentOpenInfo($condition);
|
|
$payment_info = $payment_model->getPaymentOpenInfo($condition);
|
|
if (!$payment_info || $payment_info['payment_code'] == 'offline' || $payment_info['payment_code'] == 'offline') {
|
|
if (!$payment_info || $payment_info['payment_code'] == 'offline' || $payment_info['payment_code'] == 'offline') {
|
|
$this->error(lang('payment_index_sys_not_support'));
|
|
$this->error(lang('payment_index_sys_not_support'));
|
|
}
|
|
}
|
|
|
|
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdr_sn','=',$info['pdr_sn']);
|
|
|
|
- $condition[] = array('pdr_payment_state','=',0);
|
|
|
|
|
|
+ $condition[] = array('pdr_sn', '=', $info['pdr_sn']);
|
|
|
|
+ $condition[] = array('pdr_payment_state', '=', 0);
|
|
$update = array();
|
|
$update = array();
|
|
$update['pdr_payment_state'] = 1;
|
|
$update['pdr_payment_state'] = 1;
|
|
$update['pdr_paymenttime'] = strtotime(input('post.payment_time'));
|
|
$update['pdr_paymenttime'] = strtotime(input('post.payment_time'));
|
|
@@ -135,7 +140,8 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 充值查看
|
|
* 充值查看
|
|
*/
|
|
*/
|
|
- public function recharge_info() {
|
|
|
|
|
|
+ public function recharge_info()
|
|
|
|
+ {
|
|
$id = intval(input('param.id'));
|
|
$id = intval(input('param.id'));
|
|
if ($id <= 0) {
|
|
if ($id <= 0) {
|
|
$this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdrecharge_list');
|
|
$this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdrecharge_list');
|
|
@@ -143,7 +149,7 @@ class Predeposit extends AdminControl {
|
|
//查询充值信息
|
|
//查询充值信息
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdr_id','=',$id);
|
|
|
|
|
|
+ $condition[] = array('pdr_id', '=', $id);
|
|
$info = $predeposit_model->getPdRechargeInfo($condition);
|
|
$info = $predeposit_model->getPdRechargeInfo($condition);
|
|
if (empty($info)) {
|
|
if (empty($info)) {
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdrecharge_list');
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdrecharge_list');
|
|
@@ -155,16 +161,17 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 充值删除
|
|
* 充值删除
|
|
*/
|
|
*/
|
|
- public function recharge_del() {
|
|
|
|
|
|
+ public function recharge_del()
|
|
|
|
+ {
|
|
$pdr_id = input('param.pdr_id');
|
|
$pdr_id = input('param.pdr_id');
|
|
$pdr_id_array = ds_delete_param($pdr_id);
|
|
$pdr_id_array = ds_delete_param($pdr_id);
|
|
- if($pdr_id_array === FALSE){
|
|
|
|
|
|
+ if ($pdr_id_array === FALSE) {
|
|
ds_json_encode('10001', lang('param_error'));
|
|
ds_json_encode('10001', lang('param_error'));
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdr_id','in', $pdr_id_array);
|
|
|
|
- $condition[] = array('pdr_payment_state','=',0);
|
|
|
|
|
|
+ $condition[] = array('pdr_id', 'in', $pdr_id_array);
|
|
|
|
+ $condition[] = array('pdr_payment_state', '=', 0);
|
|
$result = $predeposit_model->delPdRecharge($condition);
|
|
$result = $predeposit_model->delPdRecharge($condition);
|
|
if ($result) {
|
|
if ($result) {
|
|
ds_json_encode('10000', lang('ds_common_del_succ'));
|
|
ds_json_encode('10000', lang('ds_common_del_succ'));
|
|
@@ -179,7 +186,8 @@ class Predeposit extends AdminControl {
|
|
* 预存款明细
|
|
* 预存款明细
|
|
*/
|
|
*/
|
|
|
|
|
|
- public function pdlog_list() {
|
|
|
|
|
|
+ public function pdlog_list()
|
|
|
|
+ {
|
|
$condition = array();
|
|
$condition = array();
|
|
$stime = input('get.stime');
|
|
$stime = input('get.stime');
|
|
$etime = input('get.etime');
|
|
$etime = input('get.etime');
|
|
@@ -188,27 +196,27 @@ class Predeposit extends AdminControl {
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
if ($start_unixtime) {
|
|
if ($start_unixtime) {
|
|
- $condition[]=array('lg_addtime','>=', $start_unixtime);
|
|
|
|
|
|
+ $condition[] = array('lg_addtime', '>=', $start_unixtime);
|
|
}
|
|
}
|
|
if ($end_unixtime) {
|
|
if ($end_unixtime) {
|
|
- $end_unixtime=$end_unixtime+86399;
|
|
|
|
- $condition[]=array('lg_addtime','<=', $end_unixtime);
|
|
|
|
|
|
+ $end_unixtime = $end_unixtime + 86399;
|
|
|
|
+ $condition[] = array('lg_addtime', '<=', $end_unixtime);
|
|
}
|
|
}
|
|
$mname = input('get.mname');
|
|
$mname = input('get.mname');
|
|
if (!empty($mname)) {
|
|
if (!empty($mname)) {
|
|
- $condition[] = array('lg_member_name','=',$mname);
|
|
|
|
|
|
+ $condition[] = array('lg_member_name', '=', $mname);
|
|
}
|
|
}
|
|
$aname = input('get.aname');
|
|
$aname = input('get.aname');
|
|
if (!empty($aname)) {
|
|
if (!empty($aname)) {
|
|
- $condition[] = array('lg_admin_name','=',$aname);
|
|
|
|
|
|
+ $condition[] = array('lg_admin_name', '=', $aname);
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$list_log = $predeposit_model->getPdLogList($condition, 10, '*', 'lg_id desc');
|
|
$list_log = $predeposit_model->getPdLogList($condition, 10, '*', 'lg_id desc');
|
|
View::assign('show_page', $predeposit_model->page_info->render());
|
|
View::assign('show_page', $predeposit_model->page_info->render());
|
|
View::assign('list_log', $list_log);
|
|
View::assign('list_log', $list_log);
|
|
-
|
|
|
|
|
|
+
|
|
View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
|
|
View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
|
|
-
|
|
|
|
|
|
+
|
|
$this->setAdminCurItem('pdlog_list');
|
|
$this->setAdminCurItem('pdlog_list');
|
|
return View::fetch();
|
|
return View::fetch();
|
|
}
|
|
}
|
|
@@ -216,32 +224,34 @@ class Predeposit extends AdminControl {
|
|
/*
|
|
/*
|
|
* 提现设置
|
|
* 提现设置
|
|
*/
|
|
*/
|
|
- public function pdcash_set(){
|
|
|
|
|
|
+ public function pdcash_set()
|
|
|
|
+ {
|
|
$config_model = model('config');
|
|
$config_model = model('config');
|
|
- if(!request()->isPost()){
|
|
|
|
|
|
+ if (!request()->isPost()) {
|
|
$list_setting = rkcache('config', true);
|
|
$list_setting = rkcache('config', true);
|
|
- View::assign('list_setting',$list_setting);
|
|
|
|
|
|
+ View::assign('list_setting', $list_setting);
|
|
$this->setAdminCurItem('pdcash_set');
|
|
$this->setAdminCurItem('pdcash_set');
|
|
return View::fetch();
|
|
return View::fetch();
|
|
- }else{
|
|
|
|
- $update_array=array(
|
|
|
|
- 'member_withdraw_min'=>abs(round(input('post.member_withdraw_min'),2)),
|
|
|
|
- 'member_withdraw_max'=>abs(round(input('post.member_withdraw_max'),2)),
|
|
|
|
- 'member_withdraw_cycle'=>abs(intval(input('post.member_withdraw_cycle'))),
|
|
|
|
|
|
+ } else {
|
|
|
|
+ $update_array = array(
|
|
|
|
+ 'member_withdraw_min' => abs(round(input('post.member_withdraw_min'), 2)),
|
|
|
|
+ 'member_withdraw_max' => abs(round(input('post.member_withdraw_max'), 2)),
|
|
|
|
+ 'member_withdraw_cycle' => abs(intval(input('post.member_withdraw_cycle'))),
|
|
);
|
|
);
|
|
$result = $config_model->editConfig($update_array);
|
|
$result = $config_model->editConfig($update_array);
|
|
if ($result) {
|
|
if ($result) {
|
|
- $this->log(lang('ds_update').lang('admin_predeposit_cashset'),1);
|
|
|
|
|
|
+ $this->log(lang('ds_update') . lang('admin_predeposit_cashset'), 1);
|
|
$this->success(lang('ds_common_op_succ'), 'Predeposit/pdcash_set');
|
|
$this->success(lang('ds_common_op_succ'), 'Predeposit/pdcash_set');
|
|
- }else{
|
|
|
|
- $this->log(lang('ds_update').lang('admin_predeposit_cashset'),0);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ $this->log(lang('ds_update') . lang('admin_predeposit_cashset'), 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
* 提现列表
|
|
* 提现列表
|
|
*/
|
|
*/
|
|
- public function pdcash_list() {
|
|
|
|
|
|
+ public function pdcash_list()
|
|
|
|
+ {
|
|
$condition = array();
|
|
$condition = array();
|
|
$stime = input('get.stime');
|
|
$stime = input('get.stime');
|
|
$etime = input('get.etime');
|
|
$etime = input('get.etime');
|
|
@@ -250,31 +260,31 @@ class Predeposit extends AdminControl {
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
if ($start_unixtime) {
|
|
if ($start_unixtime) {
|
|
- $condition[]=array('pdc_addtime','>=', $start_unixtime);
|
|
|
|
|
|
+ $condition[] = array('pdc_addtime', '>=', $start_unixtime);
|
|
}
|
|
}
|
|
if ($end_unixtime) {
|
|
if ($end_unixtime) {
|
|
- $end_unixtime=$end_unixtime+86399;
|
|
|
|
- $condition[]=array('pdc_addtime','<=', $end_unixtime);
|
|
|
|
|
|
+ $end_unixtime = $end_unixtime + 86399;
|
|
|
|
+ $condition[] = array('pdc_addtime', '<=', $end_unixtime);
|
|
}
|
|
}
|
|
$mname = input('get.mname');
|
|
$mname = input('get.mname');
|
|
if (!empty($mname)) {
|
|
if (!empty($mname)) {
|
|
- $condition[]=array('pdc_member_name','like', "%" . $mname . "%");
|
|
|
|
|
|
+ $condition[] = array('pdc_member_name', 'like', "%" . $mname . "%");
|
|
}
|
|
}
|
|
$pdc_bank_user = input('get.pdc_bank_user');
|
|
$pdc_bank_user = input('get.pdc_bank_user');
|
|
if (!empty($pdc_bank_user)) {
|
|
if (!empty($pdc_bank_user)) {
|
|
- $condition[]=array('pdc_bank_user','like', "%" . $pdc_bank_user . "%");
|
|
|
|
|
|
+ $condition[] = array('pdc_bank_user', 'like', "%" . $pdc_bank_user . "%");
|
|
}
|
|
}
|
|
$paystate_search = input('get.paystate_search');
|
|
$paystate_search = input('get.paystate_search');
|
|
if ($paystate_search != '') {
|
|
if ($paystate_search != '') {
|
|
- $condition[]=array('pdc_payment_state','=',$paystate_search);
|
|
|
|
|
|
+ $condition[] = array('pdc_payment_state', '=', $paystate_search);
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_list = $predeposit_model->getPdcashList($condition, 20, '*', 'pdc_payment_state asc,pdc_id asc');
|
|
$predeposit_list = $predeposit_model->getPdcashList($condition, 20, '*', 'pdc_payment_state asc,pdc_id asc');
|
|
View::assign('predeposit_list', $predeposit_list);
|
|
View::assign('predeposit_list', $predeposit_list);
|
|
View::assign('show_page', $predeposit_model->page_info->render());
|
|
View::assign('show_page', $predeposit_model->page_info->render());
|
|
-
|
|
|
|
|
|
+
|
|
View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
|
|
View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
|
|
-
|
|
|
|
|
|
+
|
|
$this->setAdminCurItem('pdcash_list');
|
|
$this->setAdminCurItem('pdcash_list');
|
|
return View::fetch('pdcash_list');
|
|
return View::fetch('pdcash_list');
|
|
}
|
|
}
|
|
@@ -282,15 +292,16 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 删除提现记录
|
|
* 删除提现记录
|
|
*/
|
|
*/
|
|
- public function pdcash_del() {
|
|
|
|
|
|
+ public function pdcash_del()
|
|
|
|
+ {
|
|
$pdc_id = intval(input('param.pdc_id'));
|
|
$pdc_id = intval(input('param.pdc_id'));
|
|
if ($pdc_id <= 0) {
|
|
if ($pdc_id <= 0) {
|
|
- ds_json_encode(10001, lang('param_error'));
|
|
|
|
|
|
+ ds_json_encode(10001, lang('param_error'));
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdc_id','=',$pdc_id);
|
|
|
|
- $condition[] = array('pdc_payment_state','=',0);
|
|
|
|
|
|
+ $condition[] = array('pdc_id', '=', $pdc_id);
|
|
|
|
+ $condition[] = array('pdc_payment_state', '=', 0);
|
|
$info = $predeposit_model->getPdcashInfo($condition);
|
|
$info = $predeposit_model->getPdcashInfo($condition);
|
|
if (!$info) {
|
|
if (!$info) {
|
|
ds_json_encode(10001, lang('admin_predeposit_parameter_error'));
|
|
ds_json_encode(10001, lang('admin_predeposit_parameter_error'));
|
|
@@ -323,15 +334,16 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 更改提现为支付状态
|
|
* 更改提现为支付状态
|
|
*/
|
|
*/
|
|
- public function pdcash_pay() {
|
|
|
|
|
|
+ public function pdcash_pay()
|
|
|
|
+ {
|
|
$id = intval(input('param.id'));
|
|
$id = intval(input('param.id'));
|
|
if ($id <= 0) {
|
|
if ($id <= 0) {
|
|
- $this->error(lang('admin_predeposit_parameter_error'),'Predeposit/pdcash_list');
|
|
|
|
|
|
+ $this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdcash_list');
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdc_id','=',$id);
|
|
|
|
- $condition[] = array('pdc_payment_state','=',0);
|
|
|
|
|
|
+ $condition[] = array('pdc_id', '=', $id);
|
|
|
|
+ $condition[] = array('pdc_payment_state', '=', 0);
|
|
$info = $predeposit_model->getPdcashInfo($condition);
|
|
$info = $predeposit_model->getPdcashInfo($condition);
|
|
if (!is_array($info) || count($info) < 0) {
|
|
if (!is_array($info) || count($info) < 0) {
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdcash_list');
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdcash_list');
|
|
@@ -361,44 +373,44 @@ class Predeposit extends AdminControl {
|
|
$data['order_sn'] = $info['pdc_sn'];
|
|
$data['order_sn'] = $info['pdc_sn'];
|
|
$data['admin_name'] = $admininfo['admin_name'];
|
|
$data['admin_name'] = $admininfo['admin_name'];
|
|
$predeposit_model->changePd('cash_pay', $data);
|
|
$predeposit_model->changePd('cash_pay', $data);
|
|
- if($info['pdc_bank_type']=='alipay'){//如果是支付宝且开启了支付宝提现
|
|
|
|
|
|
+ if ($info['pdc_bank_type'] == 'alipay') { //如果是支付宝且开启了支付宝提现
|
|
$logic_payment = model('payment', 'logic');
|
|
$logic_payment = model('payment', 'logic');
|
|
- $payment_code='alipay';
|
|
|
|
|
|
+ $payment_code = 'alipay';
|
|
$result = $logic_payment->getPaymentInfo($payment_code);
|
|
$result = $logic_payment->getPaymentInfo($payment_code);
|
|
if ($result['code']) {
|
|
if ($result['code']) {
|
|
$payment_info = $result['data'];
|
|
$payment_info = $result['data'];
|
|
- if($payment_info['payment_config']['alipay_trade_transfer_state'] == 1){
|
|
|
|
|
|
+ if ($payment_info['payment_config']['alipay_trade_transfer_state'] == 1) {
|
|
$payment_api = new $payment_code($payment_info);
|
|
$payment_api = new $payment_code($payment_info);
|
|
$result = $payment_api->fund_transfer($info);
|
|
$result = $payment_api->fund_transfer($info);
|
|
if (!$result['code']) {
|
|
if (!$result['code']) {
|
|
throw new \think\Exception($result['msg'], 10006);
|
|
throw new \think\Exception($result['msg'], 10006);
|
|
}
|
|
}
|
|
- $result = $predeposit_model->editPdcash(array('pdc_payment_code'=>$payment_code,'pdc_trade_sn'=>$result['data']['pdc_trade_sn']), array('pdc_id'=>$id));
|
|
|
|
|
|
+ $result = $predeposit_model->editPdcash(array('pdc_payment_code' => $payment_code, 'pdc_trade_sn' => $result['data']['pdc_trade_sn']), array('pdc_id' => $id));
|
|
if (!$result) {
|
|
if (!$result) {
|
|
throw new \think\Exception(lang('admin_predeposit_cash_edit_fail'), 10006);
|
|
throw new \think\Exception(lang('admin_predeposit_cash_edit_fail'), 10006);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }elseif($info['pdc_bank_type']=='weixin'){//如果是微信且开启了微信提现
|
|
|
|
|
|
+ } elseif ($info['pdc_bank_type'] == 'weixin') { //如果是微信且开启了微信提现
|
|
$logic_payment = model('payment', 'logic');
|
|
$logic_payment = model('payment', 'logic');
|
|
- $payment_code='wxpay_native';
|
|
|
|
|
|
+ $payment_code = 'wxpay_native';
|
|
$result = $logic_payment->getPaymentInfo($payment_code);
|
|
$result = $logic_payment->getPaymentInfo($payment_code);
|
|
if ($result['code']) {
|
|
if ($result['code']) {
|
|
$payment_info = $result['data'];
|
|
$payment_info = $result['data'];
|
|
- if($payment_info['payment_config']['wx_trade_transfer_state'] == 1){
|
|
|
|
|
|
+ if ($payment_info['payment_config']['wx_trade_transfer_state'] == 1) {
|
|
$payment_api = new $payment_code($payment_info);
|
|
$payment_api = new $payment_code($payment_info);
|
|
$result = $payment_api->fund_transfer($info);
|
|
$result = $payment_api->fund_transfer($info);
|
|
if (!$result['code']) {
|
|
if (!$result['code']) {
|
|
throw new \think\Exception($result['msg'], 10006);
|
|
throw new \think\Exception($result['msg'], 10006);
|
|
}
|
|
}
|
|
- $result = $predeposit_model->editPdcash(array('pdc_payment_code'=>$payment_code,'pdc_trade_sn'=>$result['data']['pdc_trade_sn']), array('pdc_id'=>$id));
|
|
|
|
|
|
+ $result = $predeposit_model->editPdcash(array('pdc_payment_code' => $payment_code, 'pdc_trade_sn' => $result['data']['pdc_trade_sn']), array('pdc_id' => $id));
|
|
if (!$result) {
|
|
if (!$result) {
|
|
throw new \think\Exception(lang('admin_predeposit_cash_edit_fail'), 10006);
|
|
throw new \think\Exception(lang('admin_predeposit_cash_edit_fail'), 10006);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
Db::commit();
|
|
Db::commit();
|
|
$this->log($log_msg, 1);
|
|
$this->log($log_msg, 1);
|
|
dsLayerOpenSuccess(lang('admin_predeposit_cash_edit_success'));
|
|
dsLayerOpenSuccess(lang('admin_predeposit_cash_edit_success'));
|
|
@@ -412,14 +424,15 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 查看提现信息
|
|
* 查看提现信息
|
|
*/
|
|
*/
|
|
- public function pdcash_view() {
|
|
|
|
|
|
+ public function pdcash_view()
|
|
|
|
+ {
|
|
$id = intval(input('param.id'));
|
|
$id = intval(input('param.id'));
|
|
if ($id <= 0) {
|
|
if ($id <= 0) {
|
|
$this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdcash_list');
|
|
$this->error(lang('admin_predeposit_parameter_error'), 'Predeposit/pdcash_list');
|
|
}
|
|
}
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('pdc_id','=',$id);
|
|
|
|
|
|
+ $condition[] = array('pdc_id', '=', $id);
|
|
$info = $predeposit_model->getPdcashInfo($condition);
|
|
$info = $predeposit_model->getPdcashInfo($condition);
|
|
if (!is_array($info) || count($info) < 0) {
|
|
if (!is_array($info) || count($info) < 0) {
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdcash_list');
|
|
$this->error(lang('admin_predeposit_record_error'), 'Predeposit/pdcash_list');
|
|
@@ -432,15 +445,16 @@ class Predeposit extends AdminControl {
|
|
* 调节预存款
|
|
* 调节预存款
|
|
*/
|
|
*/
|
|
|
|
|
|
- public function pd_add() {
|
|
|
|
|
|
+ public function pd_add()
|
|
|
|
+ {
|
|
if (!(request()->isPost())) {
|
|
if (!(request()->isPost())) {
|
|
$member_id = intval(input('get.member_id'));
|
|
$member_id = intval(input('get.member_id'));
|
|
- if($member_id>0){
|
|
|
|
|
|
+ if ($member_id > 0) {
|
|
$condition = array();
|
|
$condition = array();
|
|
- $condition[] = array('member_id','=',$member_id);
|
|
|
|
|
|
+ $condition[] = array('member_id', '=', $member_id);
|
|
$member = model('member')->getMemberInfo($condition);
|
|
$member = model('member')->getMemberInfo($condition);
|
|
- if(!empty($member)){
|
|
|
|
- View::assign('member_info',$member);
|
|
|
|
|
|
+ if (!empty($member)) {
|
|
|
|
+ View::assign('member_info', $member);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return View::fetch();
|
|
return View::fetch();
|
|
@@ -532,7 +546,8 @@ class Predeposit extends AdminControl {
|
|
}
|
|
}
|
|
|
|
|
|
//取得会员信息
|
|
//取得会员信息
|
|
- public function checkmember() {
|
|
|
|
|
|
+ public function checkmember()
|
|
|
|
+ {
|
|
$name = input('post.name');
|
|
$name = input('post.name');
|
|
if (!$name) {
|
|
if (!$name) {
|
|
exit(json_encode(array('id' => 0)));
|
|
exit(json_encode(array('id' => 0)));
|
|
@@ -546,35 +561,36 @@ class Predeposit extends AdminControl {
|
|
exit(json_encode(array('id' => 0)));
|
|
exit(json_encode(array('id' => 0)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 导出预存款充值记录
|
|
* 导出预存款充值记录
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- public function export_step1() {
|
|
|
|
|
|
+ public function export_step1()
|
|
|
|
+ {
|
|
$condition = array();
|
|
$condition = array();
|
|
$if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_start_date'));
|
|
$if_start_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_start_date'));
|
|
$if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_end_date'));
|
|
$if_end_date = preg_match('/^20\d{2}-\d{2}-\d{2}$/', input('param.query_end_date'));
|
|
$start_unixtime = $if_start_date ? strtotime(input('param.query_start_date')) : null;
|
|
$start_unixtime = $if_start_date ? strtotime(input('param.query_start_date')) : null;
|
|
$end_unixtime = $if_end_date ? strtotime(input('param.query_end_date')) : null;
|
|
$end_unixtime = $if_end_date ? strtotime(input('param.query_end_date')) : null;
|
|
if ($start_unixtime) {
|
|
if ($start_unixtime) {
|
|
- $condition[] = array('pdr_addtime','>=', $start_unixtime);
|
|
|
|
|
|
+ $condition[] = array('pdr_addtime', '>=', $start_unixtime);
|
|
}
|
|
}
|
|
if ($end_unixtime) {
|
|
if ($end_unixtime) {
|
|
- $end_unixtime=$end_unixtime+86399;
|
|
|
|
- $condition[] = array('pdr_addtime','<=', $end_unixtime);
|
|
|
|
|
|
+ $end_unixtime = $end_unixtime + 86399;
|
|
|
|
+ $condition[] = array('pdr_addtime', '<=', $end_unixtime);
|
|
}
|
|
}
|
|
if (input('param.mname') != '') {
|
|
if (input('param.mname') != '') {
|
|
- $condition[]=array('pdr_member_name','like', "%" . input('param.mname') . "%");
|
|
|
|
|
|
+ $condition[] = array('pdr_member_name', 'like', "%" . input('param.mname') . "%");
|
|
}
|
|
}
|
|
if (input('param.paystate_search') != '') {
|
|
if (input('param.paystate_search') != '') {
|
|
- $condition[]=array('pdr_payment_state','=',input('param.paystate_search'));
|
|
|
|
|
|
+ $condition[] = array('pdr_payment_state', '=', input('param.paystate_search'));
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
if (!is_numeric(input('param.page'))) {
|
|
if (!is_numeric(input('param.page'))) {
|
|
$count = $predeposit_model->getPdRechargeCount($condition);
|
|
$count = $predeposit_model->getPdRechargeCount($condition);
|
|
@@ -613,8 +629,9 @@ class Predeposit extends AdminControl {
|
|
*
|
|
*
|
|
* @param array $data
|
|
* @param array $data
|
|
*/
|
|
*/
|
|
- private function createExcel($data = array()) {
|
|
|
|
- Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
|
|
|
|
|
|
+ private function createExcel($data = array())
|
|
|
|
+ {
|
|
|
|
+ Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
|
|
$excel_obj = new \excel\Excel();
|
|
$excel_obj = new \excel\Excel();
|
|
$excel_data = array();
|
|
$excel_data = array();
|
|
//设置样式
|
|
//设置样式
|
|
@@ -654,12 +671,13 @@ class Predeposit extends AdminControl {
|
|
$excel_obj->generateXML($excel_obj->charset(lang('exp_yc_yckcz'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
|
|
$excel_obj->generateXML($excel_obj->charset(lang('exp_yc_yckcz'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 导出预存款提现记录
|
|
* 导出预存款提现记录
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- public function export_cash_step1() {
|
|
|
|
|
|
+ public function export_cash_step1()
|
|
|
|
+ {
|
|
$condition = array();
|
|
$condition = array();
|
|
$stime = input('get.stime');
|
|
$stime = input('get.stime');
|
|
$etime = input('get.etime');
|
|
$etime = input('get.etime');
|
|
@@ -668,23 +686,23 @@ class Predeposit extends AdminControl {
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
if ($start_unixtime) {
|
|
if ($start_unixtime) {
|
|
- $condition[] = array('pdc_addtime','>=', $start_unixtime);
|
|
|
|
|
|
+ $condition[] = array('pdc_addtime', '>=', $start_unixtime);
|
|
}
|
|
}
|
|
if ($end_unixtime) {
|
|
if ($end_unixtime) {
|
|
- $end_unixtime=$end_unixtime+86399;
|
|
|
|
- $condition[] = array('pdc_addtime','<=', $end_unixtime);
|
|
|
|
|
|
+ $end_unixtime = $end_unixtime + 86399;
|
|
|
|
+ $condition[] = array('pdc_addtime', '<=', $end_unixtime);
|
|
}
|
|
}
|
|
$mname = input('get.mname');
|
|
$mname = input('get.mname');
|
|
if (!empty($mname)) {
|
|
if (!empty($mname)) {
|
|
- $condition[]=array('pdc_member_name','like', "%" . $mname . "%");
|
|
|
|
|
|
+ $condition[] = array('pdc_member_name', 'like', "%" . $mname . "%");
|
|
}
|
|
}
|
|
$pdc_bank_user = input('get.pdc_bank_user');
|
|
$pdc_bank_user = input('get.pdc_bank_user');
|
|
if (!empty($pdc_bank_user)) {
|
|
if (!empty($pdc_bank_user)) {
|
|
- $condition[]=array('pdc_bank_user','like', "%" . $pdc_bank_user . "%");
|
|
|
|
|
|
+ $condition[] = array('pdc_bank_user', 'like', "%" . $pdc_bank_user . "%");
|
|
}
|
|
}
|
|
$paystate_search = input('get.paystate_search');
|
|
$paystate_search = input('get.paystate_search');
|
|
if ($paystate_search != '') {
|
|
if ($paystate_search != '') {
|
|
- $condition[]=array('pdc_payment_state','=',$paystate_search);
|
|
|
|
|
|
+ $condition[] = array('pdc_payment_state', '=', $paystate_search);
|
|
}
|
|
}
|
|
|
|
|
|
$predeposit_model = Model('predeposit');
|
|
$predeposit_model = Model('predeposit');
|
|
@@ -726,8 +744,9 @@ class Predeposit extends AdminControl {
|
|
*
|
|
*
|
|
* @param array $data
|
|
* @param array $data
|
|
*/
|
|
*/
|
|
- private function createCashExcel($data = array()) {
|
|
|
|
- Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
|
|
|
|
|
|
+ private function createCashExcel($data = array())
|
|
|
|
+ {
|
|
|
|
+ Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
|
|
$excel_obj = new \excel\Excel();
|
|
$excel_obj = new \excel\Excel();
|
|
$excel_data = array();
|
|
$excel_data = array();
|
|
//设置样式
|
|
//设置样式
|
|
@@ -758,7 +777,8 @@ class Predeposit extends AdminControl {
|
|
/**
|
|
/**
|
|
* 预存款明细信息导出
|
|
* 预存款明细信息导出
|
|
*/
|
|
*/
|
|
- public function export_mx_step1() {
|
|
|
|
|
|
+ public function export_mx_step1()
|
|
|
|
+ {
|
|
$condition = array();
|
|
$condition = array();
|
|
$stime = input('get.stime');
|
|
$stime = input('get.stime');
|
|
$etime = input('get.etime');
|
|
$etime = input('get.etime');
|
|
@@ -767,22 +787,22 @@ class Predeposit extends AdminControl {
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$start_unixtime = $if_start_date ? strtotime($stime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
$end_unixtime = $if_end_date ? strtotime($etime) : null;
|
|
if ($start_unixtime) {
|
|
if ($start_unixtime) {
|
|
- $condition[] = array('lg_addtime','>=',$start_unixtime);
|
|
|
|
|
|
+ $condition[] = array('lg_addtime', '>=', $start_unixtime);
|
|
}
|
|
}
|
|
if ($end_unixtime) {
|
|
if ($end_unixtime) {
|
|
- $end_unixtime=$end_unixtime+86399;
|
|
|
|
- $condition[] = array('lg_addtime','<=',$end_unixtime);
|
|
|
|
|
|
+ $end_unixtime = $end_unixtime + 86399;
|
|
|
|
+ $condition[] = array('lg_addtime', '<=', $end_unixtime);
|
|
}
|
|
}
|
|
$mname = input('get.mname');
|
|
$mname = input('get.mname');
|
|
if (!empty($mname)) {
|
|
if (!empty($mname)) {
|
|
- $condition[] = array('lg_member_name','=',$mname);
|
|
|
|
|
|
+ $condition[] = array('lg_member_name', '=', $mname);
|
|
}
|
|
}
|
|
$aname = input('get.aname');
|
|
$aname = input('get.aname');
|
|
if (!empty($aname)) {
|
|
if (!empty($aname)) {
|
|
- $condition[] = array('lg_admin_name','=',$aname);
|
|
|
|
|
|
+ $condition[] = array('lg_admin_name', '=', $aname);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
$predeposit_model = model('predeposit');
|
|
$predeposit_model = model('predeposit');
|
|
if (!is_numeric(input('param.page'))) {
|
|
if (!is_numeric(input('param.page'))) {
|
|
$count = $predeposit_model->getPdLogCount($condition);
|
|
$count = $predeposit_model->getPdLogCount($condition);
|
|
@@ -813,8 +833,9 @@ class Predeposit extends AdminControl {
|
|
*
|
|
*
|
|
* @param array $data
|
|
* @param array $data
|
|
*/
|
|
*/
|
|
- private function createmxExcel($data = array()) {
|
|
|
|
- Lang::load(base_path() .'admin/lang/'.config('lang.default_lang').'/export.lang.php');
|
|
|
|
|
|
+ private function createmxExcel($data = array())
|
|
|
|
+ {
|
|
|
|
+ Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/export.lang.php');
|
|
$excel_obj = new \excel\Excel();
|
|
$excel_obj = new \excel\Excel();
|
|
$excel_data = array();
|
|
$excel_data = array();
|
|
//设置样式
|
|
//设置样式
|
|
@@ -849,12 +870,13 @@ class Predeposit extends AdminControl {
|
|
$excel_obj->addWorksheet($excel_obj->charset(lang('exp_mx_rz'), CHARSET));
|
|
$excel_obj->addWorksheet($excel_obj->charset(lang('exp_mx_rz'), CHARSET));
|
|
$excel_obj->generateXML($excel_obj->charset(lang('exp_mx_rz'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
|
|
$excel_obj->generateXML($excel_obj->charset(lang('exp_mx_rz'), CHARSET) . input('param.page') . '-' . date('Y-m-d-H', TIMESTAMP));
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取卖家栏目列表,针对控制器下的栏目
|
|
* 获取卖家栏目列表,针对控制器下的栏目
|
|
*/
|
|
*/
|
|
- protected function getAdminItemList() {
|
|
|
|
|
|
+ protected function getAdminItemList()
|
|
|
|
+ {
|
|
$menu_array = array(
|
|
$menu_array = array(
|
|
array(
|
|
array(
|
|
'name' => 'pdrecharge_list',
|
|
'name' => 'pdrecharge_list',
|
|
@@ -879,7 +901,7 @@ class Predeposit extends AdminControl {
|
|
array(
|
|
array(
|
|
'name' => 'pd_add',
|
|
'name' => 'pd_add',
|
|
'text' => lang('pd_add'),
|
|
'text' => lang('pd_add'),
|
|
- 'url' => "javascript:dsLayerOpen('".(string)url('Predeposit/pd_add')."','".lang('pd_add')."')"
|
|
|
|
|
|
+ 'url' => "javascript:dsLayerOpen('" . (string)url('Predeposit/pd_add') . "','" . lang('pd_add') . "')"
|
|
),
|
|
),
|
|
);
|
|
);
|
|
return $menu_array;
|
|
return $menu_array;
|