本协议由以下双方于{$time}签订:
-合同编号:{$code}
+合同编号:{$sn}
甲方:海南万盟天下科技有限公司
注册地址:海南省海口市南海大道26号海口国家高新区创业孵化中心A楼5层A1-1268室
联系电话:13067391751
@@ -237,8 +237,6 @@ and open the template in the editor.diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php
index a271b502a..8ffbd1820 100644
--- a/Application/Home/Controller/DownloadController.class.php
+++ b/Application/Home/Controller/DownloadController.class.php
@@ -2774,23 +2774,29 @@ class DownloadController extends BaseController {
->buildSql();
unset($map['begintime']);
unset($map['endtime']);
- $roles = M('user_play_info', 'tab_')
- ->field("*,$sqlCost as cost,$sqlCount as count,$sqlTodayCost as today_cost")
- ->where($map)
- ->order('play_time desc')
- ->select();
- foreach ($roles as $role) {
+ $subQuery = M('user_play_info', 'tab_')
+ ->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today")
+ ->where($map)
+ ->having('recharge_cost > 0')
+ ->order('play_time desc')
+ ->buildSql();
+ $roles = M()->field(' * ')
+ ->table($subQuery)
+ ->alias('a')
+ ->order('play_time desc')
+ ->select();
+ foreach ($roles as $role) {
$records[] = [
- 'user_account' => $role['user_account'],
+ 'user_account' => encryption($role['user_account']),
'game_name' => $role['game_name'],
'role_name' => $role['role_name'],
'role_id' => $role['role_id'],
'role_level' => $role['role_level'],
'server_id' => $role['server_id'],
'server_name' => $role['server_name'],
- 'recharge_cost' => $role['cost'],
- 'recharge_count' => $role['count'],
- 'recharge_cost_today' => $role['cost_today'],
+ 'recharge_cost' => empty($role['recharge_cost']) ? 0 : $role['recharge_cost'],
+ 'recharge_count' => empty($role['recharge_count']) ? 0 : $role['recharge_count'],
+ 'recharge_cost_today' => empty($role['recharge_cost_today']) ? 0 : $role['recharge_cost_today'],
'play_time' => $role['play_time'],
'play_ip' => $role['play_ip'],
'promote_id' => $role['promote_id'],
diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php
index b783521f0..605c26ad4 100644
--- a/Application/Home/Controller/FinanceController.class.php
+++ b/Application/Home/Controller/FinanceController.class.php
@@ -567,7 +567,7 @@ class FinanceController extends BaseController
}
//审核拒绝 重新审核
- public function renewReview($id)
+ public function renewReview()
{
//是否是会长
$this->purview();
@@ -581,6 +581,29 @@ class FinanceController extends BaseController
$this->ajaxReturn($data);
}
- $id = intval($id);
+ $id = intval(I('id', 0));
+ $data = M('withdraw', 'tab_')->find($id);
+ if (empty($data) || $data['status'] != -1) {
+ $data['status'] = 0;
+ $data['msg'] = '数据异常';
+ $this->ajaxReturn($data);
+ }
+ if ($data['promote_id'] != $this->loginPromote['id']) {
+ $data['status'] = 0;
+ $data['msg'] = '权限异常';
+ $this->ajaxReturn($data);
+ }
+
+ $save['status'] = 0;
+ $save['id'] = $id;
+ $res = M('withdraw', 'tab_')->save($save);
+ if ($res === false) {
+ $data['status'] = 0;
+ $data['msg'] = '提交失败';
+ } else {
+ $data['status'] = 1;
+ $data['msg'] = '提交成功';
+ }
+ $this->ajaxReturn($data);
}
}
\ No newline at end of file
diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php
index ccfd6e84f..d3858aa4b 100644
--- a/Application/Home/Controller/PromoteController.class.php
+++ b/Application/Home/Controller/PromoteController.class.php
@@ -867,6 +867,7 @@ class PromoteController extends BaseController
$realName = I('real_name', '');
$status = I('status', 'all');
$promoteType = I('promote_type', 0);
+ $parentId = I('parent_id', 0);
$loginer = $this->getLoginPromote();
$map = [];
@@ -892,6 +893,9 @@ class PromoteController extends BaseController
if ($realName) {
$map['real_name'] = ['like', '%' . $realName . '%'];
}
+ if ($parentId) {
+ $map['parent_id'] = $parentId;
+ }
if ($status != 'all') {
$map['status'] = ['eq', $status];
}
@@ -899,10 +903,8 @@ class PromoteController extends BaseController
list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) {
-
$records[$key]['idcard'] = encryption($value['idcard']);
$records[$key]['mobile_phone'] = encryption($value['mobile_phone']);
-
}
$ids = array_column($records, 'id');
@@ -941,6 +943,23 @@ class PromoteController extends BaseController
$promoteTypeName = '推广员';
}
+ $parentMap = [];
+ $parentMap['chain'] = ['like', $loginer['chain'] . $loginer['id'] . '/%'];
+ $isGetParents = true;
+ if ($loginer['level'] == 1 && $promoteType == 1) {
+ $parentMap['level'] = 2;
+ } elseif ($loginer['level'] == 1 && $promoteType == 2) {
+ $parentMap['level'] = 3;
+ } elseif ($loginer['level'] == 2 && $promoteType == 2) {
+ $parentMap['level'] = 3;
+ } else {
+ $isGetParents = false;
+ }
+ $parents = null;
+ if ($isGetParents) {
+ $parents = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($parentMap)->select();
+ }
+ $this->assign('parents', $parents);
$this->assign('promoteTypeName', $promoteTypeName);
$this->assign('hasChildList', $hasChildList);
$this->assign('hasPlayerList', $hasPlayerList);
diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php
index f411f529a..260dc2c8c 100644
--- a/Application/Home/Controller/SafeController.class.php
+++ b/Application/Home/Controller/SafeController.class.php
@@ -443,38 +443,13 @@ class SafeController extends BaseController{
public function safeDocument() {
$time = time();
- $today = date('Y-m-d');
- $username = $_REQUEST['username'];
- $tsession =S($today);
- if(S($username)) {
- $code = S($username);
- }else {
- if(!empty($tsession)) {
- $num = $tsession + 1;
- }else {
- $num = 1;
- }
- $promoteRs = M('promote','tab_')->where(['account'=>$username])->getField('create_time',true);
- $code = date('Ymd',$promoteRs[0])."_".$num;
- }
+ $loginPromote = $this->getLoginPromote();
+ $sn = date('Ymd') . '-' . strtoupper(substr(md5($loginPromote['id']), 8, 16));
$endTime = date('Y-m-d',strtotime('+1 year'));
$this->assign('time',date('Y-m-d',$time));
$this->assign('endTime',$endTime);
- $this->assign('code',$code);
- $this->assign('username',$username);
+ $this->assign('sn',$sn);
$this->display();
}
-
- public function ajaxAgree() {
- $username = $_REQUEST['username'];
- $code = $_REQUEST['code'];
- $today = date('Y-m-d');
- if(empty(S($username))) {
- S($username, $code);
- $t = S($today);
- S($today,$t+1);
- }
- $this->ajaxReturn(['code'=>10000]);
- }
}
\ No newline at end of file
diff --git a/Application/Home/View/default/Finance/withdrawRecord.html b/Application/Home/View/default/Finance/withdrawRecord.html
index 59b56dfb0..03c52bf83 100644
--- a/Application/Home/View/default/Finance/withdrawRecord.html
+++ b/Application/Home/View/default/Finance/withdrawRecord.html
@@ -174,9 +174,9 @@
本协议由以下双方于{$time}签订:
-合同编号:{$code}
+合同编号:{$sn}
甲方:海南万盟天下科技有限公司
注册地址:海南省海口市南海大道26号海口国家高新区创业孵化中心A楼5层A1-1268室
联系电话:13067391751
@@ -237,8 +237,6 @@ and open the template in the editor.