diff --git a/Application/Base/Repository/PromoteRepository.class.php b/Application/Base/Repository/PromoteRepository.class.php
index 55a3a8b4f..867984aa7 100644
--- a/Application/Base/Repository/PromoteRepository.class.php
+++ b/Application/Base/Repository/PromoteRepository.class.php
@@ -234,7 +234,6 @@ class PromoteRepository {
$resultMap = ['_string' => 'user_id in (' . $inQuery . ')'];
$items = M('user_play_info', 'tab_')->field(['count(*) count', 'promote_id'])->where($resultMap)->group('promote_id')->select();
-
$records = [];
foreach ($items as $item) {
$promoteId = $item['promote_id'];
@@ -372,21 +371,31 @@ class PromoteRepository {
$params['time_column'] = 'pay_time';
$map = $this->getPublicAchievementMap($ids, $params);
$items = M('spend', 'tab_')->field(['sum(pay_amount) amount', 'promote_id', 'pay_way'])->where($map)->group('promote_id, pay_way')->select();
+ // echo M()->getLastSql();die();
$records = [];
foreach ($items as $item) {
+ $promoteId = $item['promote_id'];
+ if (isset($params['basicPromotes'][$promoteId])) {
+ $promoteId = $params['basicPromotes'][$promoteId];
+ }
if ($item['pay_way'] == -1) {
- $records[$item['promote_id']]['ban_coin'] = $item['amount'];
+ if (isset($records[$promoteId]) && isset($records[$promoteId]['ban_coin'])) {
+ $records[$promoteId]['ban_coin'] += $item['amount'];
+ } else {
+ $records[$promoteId]['ban_coin'] = $item['amount'];
+ }
} elseif ($item['pay_way'] == 0) {
- $records[$item['promote_id']]['coin'] = $item['amount'];
+ if (isset($records[$promoteId]) && isset($records[$promoteId]['coin'])) {
+ $records[$promoteId]['coin'] += $item['amount'];
+ } else {
+ $records[$promoteId]['coin'] = $item['amount'];
+ }
} else {
- if (isset($records[$item['promote_id']])) {
- $records[$item['promote_id']]['cash'] = isset($records[$item['promote_id']]['cash']) ?
- $records[$item['promote_id']]['cash'] + $item['amount'] :
- $item['amount'];
+ if (isset($records[$promoteId]) && isset($records[$promoteId]['cash'])) {
+ $records[$promoteId]['cash'] += $item['amount'];
} else {
- $records[$item['promote_id']]['cash'] = $item['amount'];
+ $records[$promoteId]['cash'] = $item['amount'];
}
-
}
}
foreach ($ids as $id) {
diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php
index 84609cca9..255b4d206 100644
--- a/Application/Home/Controller/QueryController.class.php
+++ b/Application/Home/Controller/QueryController.class.php
@@ -1906,6 +1906,11 @@ class QueryController extends BaseController
public function achievement()
{
$time = I('time', date('Y-m-d'));
+ if(!empty($time)) {
+ $defaultTime = $time ;
+ }else {
+ $defaultTime = date('Y-m-d',time());
+ }
$sdkVersion = I('sdk_version', 0);
$gameId = I('game_id', 0);
$serverId = I('server_id', 0);
@@ -1995,37 +2000,37 @@ class QueryController extends BaseController
$rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params);
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
-
+
if (I('p', 1) == 1) {
$selfParams = $params;
$selfParams['isContainSubs'] = false;
- $selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$promote['id']], $selfParams);
- $selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$promote['id']], $selfParams);
- $selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$promote['id']], $selfParams);
- // $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$promote['id']], $selfParams);
- $selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$promote['id']], $selfParams);
- $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$promote['id']], $selfParams);
- $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$promote['id']], $selfParams);
- $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$promote['id']], $selfParams);
- $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$promote['id']], $selfParams);
-
+ $selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
+ $selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$parent['id']], $selfParams);
+ $selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$parent['id']], $selfParams);
+ // $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams);
+ $selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams);
+ $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams);
+ $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams);
+ $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams);
+ $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams);
+
$records[] = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => $parent['real_name'],
'level' => $parent['level'],
- 'create_role_count' => $selfCreateRoleCountList[$promote['id']],
- 'create_role_user_count' => $selfCreateRoleUserCountList[$promote['id']],
- 'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$promote['id']],
- // 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$promote['id']],
- 'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$promote['id']],
- 'login_user_count' => $selfLoginUserCountList[$promote['id']],
- 'recharge_count' => $selfRechargeCountList[$promote['id']],
- 'recharge_user_count' => $selfRechargeUserCountList[$promote['id']],
- 'recharge_amount' => $selfRechargeAmountList[$promote['id']]['ban_coin'] + $rechargeAmountList[$promote['id']]['coin'] + $rechargeAmountList[$promote['id']]['cash'],
- 'recharge_by_ban_coin' => $selfRechargeAmountList[$promote['id']]['ban_coin'],
- 'recharge_by_coin' => $selfRechargeAmountList[$promote['id']]['coin'],
- 'recharge_by_cash' => $selfRechargeAmountList[$promote['id']]['cash'],
+ 'create_role_count' => $selfCreateRoleCountList[$parent['id']],
+ 'create_role_user_count' => $selfCreateRoleUserCountList[$parent['id']],
+ 'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$parent['id']],
+ // 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']],
+ 'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']],
+ 'login_user_count' => $selfLoginUserCountList[$parent['id']],
+ 'recharge_count' => $selfRechargeCountList[$parent['id']],
+ 'recharge_user_count' => $selfRechargeUserCountList[$parent['id']],
+ 'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $rechargeAmountList[$parent['id']]['coin'] + $rechargeAmountList[$parent['id']]['cash'],
+ 'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'],
+ 'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'],
+ 'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'],
'current_display' => $currentDisplay,
];
}
@@ -2065,6 +2070,7 @@ class QueryController extends BaseController
$this->assign('parentid', $parentId);
$this->assign('count', $count);
$this->assign('timeout', $timeout);
+ $this->assign('time',$defaultTime);
$this->display();
}
diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php
index 2b21a142c..f411f529a 100644
--- a/Application/Home/Controller/SafeController.class.php
+++ b/Application/Home/Controller/SafeController.class.php
@@ -319,28 +319,8 @@ class SafeController extends BaseController{
$addressArr = explode(',', json_decode($address)[0]);
$promoteInfo['addressdata'] = $addressArr;
$this->assign('addr',json_decode($address)[1]);
- }else {
- $this->assign('addr','未填写地址');
}
$promoteInfo['address'] = json_decode($address);
- if(empty($promoteInfo['bank_card'])) {
- $promoteInfo['bank_card'] = " ";
- }
- if(empty($promoteInfo['email'])) {
- $promoteInfo['email'] = " ";
- }
- if(empty($promoteInfo['real_name'])) {
- $promoteInfo['real_name'] = " ";
- }
- if(empty($promoteInfo['mobile_phone'])) {
- $promoteInfo['mobile_phone'] = " ";
- }
- if(empty($promoteInfo['bank_name'])) {
- $promoteInfo['bank_name'] = " ";
- }
- if(empty($promoteInfo['idcard'])) {
- $promoteInfo['idcard'] = " ";
- }
$this->assign("ver_status",$promoteInfo['ver_status']);
$this->assign('promoteinfo', $promoteInfo);
@@ -354,12 +334,13 @@ class SafeController extends BaseController{
$id = get_pid();
$rs = M("promote","tab_")->field('anothpic,ver_status,real_name,bank_card,mobile_phone,email,address,idcard')->where(['id'=>$id])->find();
$anothpic = $rs['anothpic'];
- if(!empty($anothpic)) {
+ /* if(!empty($anothpic)) {
$idcarpicArr = explode(',', $anothpic);
foreach ($idcarpicArr as $key => $value) {
$promoteInfo['valuedata'][$key] = $value;
}
- }
+ } */
+ $promoteInfo = "";
$address = json_decode($rs['address'],false)[1];
$this->assign('addr',$address);
$this->assign('ver_status',$rs['ver_status']);
@@ -377,6 +358,42 @@ class SafeController extends BaseController{
$account_type = $_REQUEST["account_type"];
$bank = $_REQUEST["bank"];
$agreementpic = $_REQUEST["agreementpic"];
+ if(empty($tel)) {
+ $this->error("手机号码不能为空");
+ return false;
+ }
+ $pattern = "/^1[3|5|7|8]\\d{9}$/i";
+ if(!preg_match($pattern, $tel)) {
+ $this->error("手机号码格式不合法");
+ return false;
+ }
+
+ if(empty($address1)) {
+ $this->error("地址不能为空");
+ return false;
+ }
+ if(empty($email)) {
+ $this->error("邮箱不能为空");
+ return false;
+ }
+ $patternemail = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
+ if (!preg_match($patternemail, $email)) {
+ $this->error('邮箱地址错误');
+ return false;
+ }
+ if(empty($bank)) {
+ $this->error("卡号不能为空");
+ return false;
+ }
+ $bank_card_pattern = "/^\d{10,19}$/u";
+ if (!preg_match($bank_card_pattern, $bank)) {
+ $this->error('卡号格式错误');
+ return false;
+ }
+ if(empty($agreementpic)) {
+ $this->error("补充协议不能为空");
+ return false;
+ }
$Res = M("promote","tab_")->field('address')->where(['id'=>$id])->find();
$address = json_decode($Res['address'],false);
$address[1] = $address1;
diff --git a/Application/Home/View/default/Query/achievement.html b/Application/Home/View/default/Query/achievement.html
index b295ed228..b2c1a9bb4 100644
--- a/Application/Home/View/default/Query/achievement.html
+++ b/Application/Home/View/default/Query/achievement.html
@@ -61,14 +61,14 @@
diff --git a/Application/Home/View/default/Safe/editModify.html b/Application/Home/View/default/Safe/editModify.html
index e063c954a..96ab1b25d 100644
--- a/Application/Home/View/default/Safe/editModify.html
+++ b/Application/Home/View/default/Safe/editModify.html
@@ -212,7 +212,7 @@
+'
'
diff --git a/Application/Home/View/default/Safe/modifyBaseInfo.html b/Application/Home/View/default/Safe/modifyBaseInfo.html
index 1ace1661e..e645fd7a8 100644
--- a/Application/Home/View/default/Safe/modifyBaseInfo.html
+++ b/Application/Home/View/default/Safe/modifyBaseInfo.html
@@ -84,23 +84,21 @@
-
-
-