diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index d34964caf..59f7e8482 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -724,7 +724,7 @@ function getAllGameList($groupByRelation = false) { $field = 'id, game_name, relation_game_id, relation_game_name'; if ($groupByRelation) { - $games = M('game', 'tab_')->field($field)->group('relation_game_id')->select(); + $games = M('game', 'tab_')->field($field)->where('id = relation_game_id')->group('relation_game_id')->select(); } else { $games = M('game', 'tab_')->field($field)->select(); } diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index d837eafe7..79ff49961 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -295,11 +295,14 @@ class AjaxController extends ThinkController{ $data['game_ratio'] = $handleStatementData; $data['company_name'] = $second_party_info['partner']; $data['mobile_phone'] = $second_party_info['link_phone']; + $data['bank_card'] = $second_party_info['bank_account']; + $data['account_openin'] = $second_party_info['opening_bank']; $data['settlement_type'] = $second_party_info['settlement_type']; $data['address'] = $second_party_info['address']; $data['real_name'] = $second_party_info['link_man']; $data['bank_account_name'] = $second_party_info['bank_account_name']; $data['settlement_type_value'] = $getStatementData['settlement_type']; + $data['settlement_type_value'] = $getStatementData['settlement_type']; $data['invoice_item'] = $second_party_info['invoice_item']; $data['invoice_type'] = $second_party_info['invoice_type']; diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 911f4ec86..118624446 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -5884,6 +5884,9 @@ class ExportController extends Controller if (I('status')) { $map['tab_promote.status'] = I('status'); } + if (strlen(I('company_belong'))) { + $map['company_belong'] = I("company_belong"); + } //为数据权限添加 setPowerPromoteIds($map, 'tab_promote.id'); diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index 5e34a7abc..46ac6e309 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -19,6 +19,7 @@ use BaiduBce\Auth\SignOptions; use BaiduBce\Log\LogFactory; use Admin\Model\AuthRuleModel; use Admin\Model\AuthGroupModel; +use Base\Service\GameService; /** * 后台首页控制器 @@ -172,6 +173,15 @@ class GameController extends ThinkController $this->error('游戏标示不能为空!'); exit; } + $downloadWays = $_POST['download_ways'] ?? []; + if (in_array(GameService::DOWNLOAD_BETA, $downloadWays)) { + if (empty($_POST['beta_url'])) { + return $this->error("请在Beta按钮开启的情况填写Beta链接"); + } + if (!preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) { + return $this->error("请填写正确的Beta链接"); + } + } $_POST['relation_game_name'] = $_POST['game_name']; if ($_POST['sdk_version'] == 1) { unset($_POST['ios_game_address']); @@ -205,6 +215,10 @@ class GameController extends ThinkController //$_POST['material_url'] = $_POST['file_url'].$_POST['file_name']; $_POST['discount'] == '' ? $_POST['discount'] = 10 : $_POST['discount']; $_POST['short'] = $short; + + $gameService = new GameService(); + $_POST['download_ways'] = $gameService->getDownLoadWaysValue($downloadWays); + $game = D(self::model_name);//M('$this->$model_name','tab_'); $res = $game->update(); if (!$res) { @@ -338,15 +352,18 @@ class GameController extends ThinkController exit; } - if ($_POST['beta_status'] == 1 && empty($_POST['beta_url'])) { - return $this->error("请在Beta按钮开启的情况填写Beta链接"); - } - if (!empty($_POST['beta_url']) && !preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) { - return $this->error("请填写正确的Beta链接"); + $downloadWays = $_POST['download_ways'] ?? []; + if (in_array(GameService::DOWNLOAD_BETA, $downloadWays)) { + if (empty($_POST['beta_url'])) { + return $this->error("请在Beta按钮开启的情况填写Beta链接"); + } + if (!preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) { + return $this->error("请填写正确的Beta链接"); + } } /*if($_POST['apply_status']==0&&$_POST['game_status']==1){ $this->error('游戏未审核不允许显示');//游戏添加完成 - }*/ + }*/ $_POST['introduction'] = str_replace(array("\r\n", "\r", "\n"), "~~", $_POST['introduction']); if (!empty($_POST['display_site'])) { @@ -360,7 +377,10 @@ class GameController extends ThinkController $_POST['discount'] == '' ? $_POST['discount'] = 10 : $_POST['discount']; $_POST['detail_content'] = $content; $_POST['pay_config'] = json_encode($_POST['pay_config']); + $gameService = new GameService(); + $_POST['download_ways'] = $gameService->getDownLoadWaysValue($downloadWays); $res = $game->update(); + $id = $res["id"]; $sibling = D("Game")->find($id); $map['relation_game_id'] = $sibling['relation_game_id']; @@ -395,9 +415,6 @@ class GameController extends ThinkController $phone['back_map'] = $sibling['back_map']; $phone['flooring_page_video'] = $sibling['flooring_page_video']; $phone['flooring_page_video_cover'] = $sibling['flooring_page_video_cover']; - $phone['supersign_status'] = $sibling['supersign_status']; - $phone['beta_url'] = $_POST['beta_url']; - $phone['beta_status'] = $_POST['beta_status']; M('Game', 'tab_')->data($phone)->where(array('id' => $another['id']))->save(); //同时修改代充游戏折扣 $set_fidel['status'] = 1; diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 1a8e4f3d8..223d6d0fc 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -96,6 +96,9 @@ class PromoteController extends ThinkController if (I("promote_level")) { $map['level'] = I("promote_level"); } + if (strlen(I('company_belong'))) { + $map['company_belong'] = I("company_belong"); + } $this->m_title = '推广员列表'; $this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find()); if (isset($_REQUEST['row'])) { @@ -221,6 +224,10 @@ class PromoteController extends ThinkController if ($this->accountExist($account)) { $this->error('该账号已存在'); } + $res = M('promote', 'tab_')->where(['mobile_phone' => $mobile_phone])->field('id')->find(); + if ($res) { + $this->error('该手机号已存在'); + } $company_belong = $_REQUEST['company_belong'] ?? 0; $company_relation = $_REQUEST['company_relation'] ?? 0; $data = array( @@ -1205,6 +1212,10 @@ class PromoteController extends ThinkController $map['p.account'] = array('like','%'.I('account').'%'); } + if (!is_null(I('can_view_recharge', null))) { + $map['pb.can_view_recharge'] = I('can_view_recharge'); + } + $this->m_title = '推广公会归属管理'; $this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/belong','status'=>1])->find()); if (isset($_REQUEST['row'])) { @@ -1235,7 +1246,7 @@ class PromoteController extends ThinkController $this->display(); } - public function belong_add($promote_id=null, $company_belong = null, $company_relation = null, $remark = null) + public function belong_add($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null) { if (IS_POST) { if (empty($promote_id)) { @@ -1245,6 +1256,7 @@ class PromoteController extends ThinkController 'promote_id' => $promote_id, 'company_belong' => $company_belong, 'company_relation' => $company_relation, + 'can_view_recharge' => $can_view_recharge, 'verify_status' => 0, 'remark' => $remark, 'applicant_id' => getAdmin(), @@ -1271,7 +1283,7 @@ class PromoteController extends ThinkController } } - public function belong_edit($promote_id=null, $company_belong = null, $company_relation = null, $remark = null) + public function belong_edit($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null) { if (IS_POST) { if (empty($promote_id)) { @@ -1281,6 +1293,7 @@ class PromoteController extends ThinkController 'promote_id' => $promote_id, 'company_belong' => $company_belong, 'company_relation' => $company_relation, + 'can_view_recharge' => $can_view_recharge, 'verify_status' => 0, 'remark' => $remark, 'applicant_id' => getAdmin(), @@ -1320,7 +1333,8 @@ class PromoteController extends ThinkController foreach ($promote_belongs as $promote_belong) { $update = [ 'company_belong' => $promote_belong['company_belong'], - 'company_relation' => $promote_belong['company_relation'] + 'company_relation' => $promote_belong['company_relation'], + 'can_view_recharge' => $promote_belong['can_view_recharge'], ]; $res = M("promote", "tab_") ->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ") diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 0d08c400c..0f6701687 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -28,7 +28,7 @@ class PromoteGameRatioController extends ThinkController $page = $params['p'] ? intval($params['p']) : 1; $row = $params['row'] ? intval($params['row']) : 10; - $map['_string'] = '1 = 1'; + $map['_string'] = 'game_id = relation_game_id'; if ($promoteId) { $map['promote_id'] = intval($promoteId); } @@ -43,11 +43,13 @@ class PromoteGameRatioController extends ThinkController if ($group == 1) { $query = D(self::MODEL_NAME)->field($field, true) ->where($map) + ->group('promote_id, relation_game_id') ->order('update_time desc, id desc'); $metaTitle = $csvTitle = '公会分成管理'; } else { $query = M(self::MODEL_NAME . '_log', 'tab_')->field($field, true) ->where($map) + ->group('promote_id, relation_game_id, create_time') ->order('create_time desc, id desc'); $metaTitle = $csvTitle = '公会分成申请记录'; } @@ -56,7 +58,10 @@ class PromoteGameRatioController extends ThinkController } $promoteGameRatios = $query->select(); if (I('export', 0) != 1) { - $count = D(self::MODEL_NAME)->where($map)->count(); + $count = count(D(self::MODEL_NAME)->where($map) + ->group('promote_id, relation_game_id') + ->order('update_time desc, id desc') + ->select()); } $records = []; @@ -64,7 +69,7 @@ class PromoteGameRatioController extends ThinkController $promoteIds = array_column($promoteGameRatios, 'promote_id'); $gameIds = array_column($promoteGameRatios, 'game_id'); $promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status'; - $gameFiled = 'id, game_name, ratio'; + $gameFiled = 'id, relation_game_name, ratio'; $promotes = M('promote', 'tab_')->where(array('id' => ['in', $promoteIds]))->getField($promoteFiled, true); $games = M('game', 'tab_')->where(array('id' => ['in', $gameIds]))->getField($gameFiled, true); @@ -103,7 +108,7 @@ class PromoteGameRatioController extends ThinkController $thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['ver_status'], 2); } if ($issetGame) { - $thisGameName = $games[$thisGameId]['game_name']; + $thisGameName = $games[$thisGameId]['relation_game_name']; $thisGameRatio = $games[$thisGameId]['ratio']; $thisGameRatio = ($thisGameRatio ?? '0.00') . '%'; } @@ -161,7 +166,7 @@ class PromoteGameRatioController extends ThinkController $this->assign('group', $group); $this->assign('records', $records); $this->assign('count', $count); - $this->assign('gameList', getAllGameList()); + $this->assign('gameList', getAllGameList(true)); $this->assign('promoteList', getPromoteByLevel(1)); $this->assign('statusList', self::$statusList); $this->assign('reviewRule', $reviewRule); @@ -232,6 +237,7 @@ class PromoteGameRatioController extends ThinkController $save['remark'] = $params['remark'] ?? ''; $save['status'] = 0; $save['update_time'] = $time; + $model = new PromoteGameRatioModel(); if (!empty($params['id'])) {//修改 $promoteGameRatio = D(self::MODEL_NAME)->find($params['id']); if (empty($promoteGameRatio)) { @@ -245,13 +251,25 @@ class PromoteGameRatioController extends ThinkController $save['last_ratio'] = $promoteGameRatio['ratio']; $save['last_ratio_status'] = 1; } - $save['id'] = intval($params['id']); - $result = D(self::MODEL_NAME)->save($save); + $saveMap['relation_game_id'] = $promoteGameRatio['relation_game_id']; + $result = D(self::MODEL_NAME)->where($saveMap)->save($save); $logResult = $result; } else { $result = true; $logResult = false; } + + if ($result === false) { + $this->error('保存失败'); + } + if ($logResult) { + $promoteGameRatioIds = D(self::MODEL_NAME)->where(array('relation_game_id' => $promoteGameRatio['relation_game_id']))->getField('id', true); + if (!empty($promoteGameRatioIds)) { + foreach ($promoteGameRatioIds as $promoteGameRatioId) { + $model->addLog($promoteGameRatioId); + } + } + } } else {//新增 if (empty($params['promote_id'])) { $this->error('请选择会长账号'); @@ -261,6 +279,14 @@ class PromoteGameRatioController extends ThinkController } $promoteId = intval($params['promote_id']); $gameId = intval($params['game_id']); + $relationGameId = D('game')->where(array('id' => $gameId))->getField('relation_game_id'); + if (empty($relationGameId)) { + $this->error('数据异常'); + } + $gameIds = D('game')->where(array('relation_game_id' => $relationGameId))->getField('id', true); + if (empty($gameIds)) { + $this->error('数据异常'); + } $promote = M('promote', 'tab_')->find($promoteId); if (empty($promote) || $promote['level'] != 1) { @@ -270,36 +296,35 @@ class PromoteGameRatioController extends ThinkController $this->isWithdraw($promoteId, $save['begin_time']); $map['promote_id'] = $promoteId; - $map['game_id'] = $gameId; - $promoteGameRatio = D(self::MODEL_NAME)->where($map)->find(); - if ($promoteGameRatio) { - $this->error('网络异常'); - } $save['promote_id'] = $promoteId; - $save['game_id'] = $gameId; $save['last_turnover_ratio'] = ''; $save['applicant_id'] = is_login(); $save['create_time'] = $time; - $result = D(self::MODEL_NAME)->add($save); - $logResult = $result; - } - - if ($result === false) { - $this->error('保存失败'); - } else { - if ($logResult) { - if (empty($params['id'])) { - $promoteGameRatioId = $result; - } else { - $promoteGameRatioId = $params['id']; + M()->startTrans(); + foreach ($gameIds as $gameId) { + $map['game_id'] = $gameId; + $promoteGameRatio = D(self::MODEL_NAME)->where($map)->find(); + if ($promoteGameRatio) { + $this->error('网络异常'); } - $model = new PromoteGameRatioModel(); - $model->addLog($promoteGameRatioId); - } + $save['game_id'] = $gameId; + $save['relation_game_id'] = $relationGameId; + $result = D(self::MODEL_NAME)->add($save); + $logResult = $result; - $this->success('保存成功', U('lists')); + if ($result === false) { + M()->rollback(); + $this->error('保存失败'); + } + if ($logResult) { + $model->addLog($result); + } + } + M()->commit(); } + + $this->success('保存成功', U('lists')); } else { $params = I('get.'); $id = $params['id'] ?? 0; @@ -326,7 +351,7 @@ class PromoteGameRatioController extends ThinkController $this->assign('lastRatio', $lastRatio); } - $this->assign('gameList', getAllGameList()); + $this->assign('gameList', getAllGameList(true)); $this->assign('promoteList', getPromoteByLevel(1)); $this->meta_title = $metaTitle; $this->display(); @@ -365,8 +390,11 @@ class PromoteGameRatioController extends ThinkController $this->error('操作失败'); } + $promoteGameRatioMap['id'] = ['in', $ids]; + $relationGameIds = D(self::MODEL_NAME)->where($promoteGameRatioMap)->getField('relation_game_id', true); + $time = time(); - $map['id'] = ['in', $ids]; + $map['relation_game_id'] = ['in', $relationGameIds]; $map['status'] = 0; $save['status'] = $status; $save['reviewer_id'] = is_login(); @@ -378,17 +406,16 @@ class PromoteGameRatioController extends ThinkController $result = D(self::MODEL_NAME)->where($map)->save($save); if ($result) { $model = new PromoteGameRatioModel(); - foreach ($ids as $id) { - $model->addLog($id); - if ($status == 1) { - $promoteGameRatio = D(self::MODEL_NAME)->find($id); - if (!empty($promoteGameRatio)) { + $promoteGameRatios = D(self::MODEL_NAME)->where(array('relation_game_id' => ['in', $relationGameIds]))->select(); + if (!empty($promoteGameRatios)) { + foreach ($promoteGameRatios as $promoteGameRatio) { + $promoteId = $promoteGameRatio['promote_id']; + $promoteMap['chain'] = ['like', "/{$promoteId}/%"]; + $promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + $model->addLog($promoteGameRatio['id']); + if ($status == 1) { if ($promoteGameRatio['begin_time'] <= strtotime(date('Y-m-d', time()))) { - $promoteId = $promoteGameRatio['promote_id']; - $promoteMap['chain'] = ['like', "/{$promoteId}/%"]; - $promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true); - $promoteIds[] = $promoteId; - $spendMap['promote_id'] = ['in', $promoteIds]; $spendMap['game_id'] = $promoteGameRatio['game_id']; if ($promoteGameRatio['end_time'] > 0) { diff --git a/Application/Admin/Controller/PublicController.class.php b/Application/Admin/Controller/PublicController.class.php index 25274d90a..0b76890d8 100644 --- a/Application/Admin/Controller/PublicController.class.php +++ b/Application/Admin/Controller/PublicController.class.php @@ -4,6 +4,7 @@ namespace Admin\Controller; use User\Api\UserApi; use Com\Wechat; use Com\WechatAuth; +use Base\Tool\TaskClient; /** * 后台首页控制器 @@ -78,7 +79,9 @@ class PublicController extends \Think\Controller if (IS_POST) { /* 检测验证码 TODO: */ - $this->checksafecode($mobile, $verify, false); + if (!$this->checksafecode($mobile, $verify)) { + $this->error('验证码错误'); + } $promote = M('promote', 'tab_')->where([ 'mobile_phone' => $mobile, 'level' => 1, @@ -341,41 +344,31 @@ class PublicController extends \Think\Controller */ public function telsafecode($phone = '', $delay = 10, $flag = true) { - $result = R('Common/Sms/send_sms_code', array($phone, $delay, false)); - - if ($result['code'] == 200) { + $taskClient = new TaskClient(); + $result = $taskClient->sendSms($phone, get_client_ip()); + $data = []; + if ($result['code'] == TaskClient::SUCCESS) { $data['status'] = 1; - $data['data'] = $result['data']; } else { $data['status'] = 0; } - - $data['msg'] = $result['msg']; - + $data['msg'] = $result['message']; echo json_encode($data); exit; } /** * 手机安全码验证 - * @param bool $flag true 用于直接异步请求 false 用于方法调用 - * @param [type] $vcode [description] */ - public function checksafecode($phone, $vcode, $flag = true) + public function checksafecode($phone, $code) { - $result = R('Common/Sms/verify_sms_code', array($phone, $vcode, false)); - - if ($result['code'] == 200) { - $data['status'] = 1; - if ($flag) { - echo json_encode($data); - exit; - } + $taskClient = new TaskClient(); + $result = $taskClient->checkSms($phone, $code); + $data = []; + if ($result && $result['code'] == TaskClient::SUCCESS) { + return true; } else { - $data['status'] = 0; - $data['msg'] = $result['msg']; - echo json_encode($data); - exit; + return false; } } diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 0b3f21d51..a346f441f 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1470,14 +1470,17 @@ class QueryController extends ThinkController } if ($_REQUEST['device']) { - $map['game_name'] = ['like','%'.$_REQUEST['device'].'%']; - } +// $map['tab_spend.sdk_version'] = $_REQUEST['device']; + $spendMap['tab_spend.sdk_version'] = $_REQUEST['device']; + } + $spendMap['tab_spend.pay_status'] = 1; //获取spend表中的数据,同时根据会长id进行group分类 $data = M('Spend','tab_') - ->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,game_name,SUBSTRING_INDEX(`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id ") + ->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,tab_spend.game_name,SUBSTRING_INDEX(tab_spend.`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id,tab_game.ratio,tab_game.relation_game_id ") ->join("left join tab_promote on promote_id = tab_promote.id") - ->where(['pay_status'=>1]) + ->join("left join tab_game on tab_game.id=tab_spend.game_id") + ->where($spendMap) ->group("my_time,game_names,root_id") ->order("my_time Desc") ->select(false); @@ -1493,9 +1496,9 @@ class QueryController extends ThinkController //关联表获取会长账号名 $data = M()->table('('.$data.') as a') - ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio") + ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio,a.ratio as game_ratio") ->join("left join tab_promote on root_id = tab_promote.id") - ->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.game_id and tab_ratio.promote_id=root_id") + ->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.relation_game_id and tab_ratio.promote_id=root_id") // ->join("left join tab_cp_game_ratio as game_ratio on game_ratio.game_id = a.game_id") ->page($page,$row) ->where($map) @@ -1520,10 +1523,9 @@ class QueryController extends ThinkController if ($value['ratio']) { $data[$key]['downstream'] = $value['pay_amount'] * ($value['ratio']*0.01); } else { - $data[$key]['downstream'] = $value['pay_amount'] * 0; + $data[$key]['downstream'] = $value['pay_amount'] * ($value['game_ratio']*0.01); } - $value['turnover_ratio'] = json_decode($value['turnover_ratio'],true); // dd($value); @@ -1575,14 +1577,22 @@ class QueryController extends ThinkController $map['my_time'] = $_REQUEST['count_date']; } +// if ($_REQUEST['device']) { +// $map['game_name'] = ['like','%'.$_REQUEST['device'].'%']; +// } + if ($_REQUEST['device']) { - $map['game_name'] = ['like','%'.$_REQUEST['device'].'%']; +// $map['tab_spend.sdk_version'] = $_REQUEST['device']; + $spendMap['tab_spend.sdk_version'] = $_REQUEST['device']; + } + $spendMap['tab_spend.pay_status'] = 1; + //获取spend表中的数据,同时根据会长id进行group分类 $data = M('Spend','tab_') ->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,game_name,SUBSTRING_INDEX(`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id,pay_way ") ->join("left join tab_promote on promote_id = tab_promote.id") - ->where(['pay_status'=>1]) + ->where($spendMap) ->group("my_time,game_names,root_id,pay_way") ->order("my_time Desc") ->select(false); diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index 2f21630e9..504d22e38 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -48,7 +48,6 @@ class StatementMangementController extends ThinkController // var_dump($data);die(); foreach ($data as $key => $value) { $data[$key]['order'] = json_decode($value['second_party_info'],true)['order_type']; - var_dump($data[$key]['order']); } $sumData = M("statement","tab_") diff --git a/Application/Admin/Model/PromoteModel.class.php b/Application/Admin/Model/PromoteModel.class.php index 8f7fe3ebd..564b09a39 100644 --- a/Application/Admin/Model/PromoteModel.class.php +++ b/Application/Admin/Model/PromoteModel.class.php @@ -415,7 +415,7 @@ class PromoteModel extends Model{ foreach ($result as $key => $value) { $parseData[$key] = $value; $parseData[$key]['company_belong_str'] = $value['company_belong'] ? '外团' : '内团'; - $parseData[$key]['company_relation_str'] = $value['company_belong'] ? '只维护' : '自主开发及维护'; + $parseData[$key]['company_relation_str'] = $value['company_relation'] ? '只维护' : '自主开发及维护'; } return $parseData; } diff --git a/Application/Admin/Model/WithdrawModel.class.php b/Application/Admin/Model/WithdrawModel.class.php index ea73951c1..d4efe6dd4 100644 --- a/Application/Admin/Model/WithdrawModel.class.php +++ b/Application/Admin/Model/WithdrawModel.class.php @@ -226,7 +226,7 @@ class WithdrawModel extends Model{ return 1; } - //月结 +//月结 public function promoteWithdrawPerMonthByPromote($promote, $initial = false, $data = []) { $promoteIds = $this->getPromoteChildren($promote); diff --git a/Application/Admin/View/Game/add.html b/Application/Admin/View/Game/add.html index 1fc3cd195..c1ac8fa69 100644 --- a/Application/Admin/View/Game/add.html +++ b/Application/Admin/View/Game/add.html @@ -408,16 +408,39 @@ - 超级签Token: - - - + 超级签Token: + + + - 超级签URL: - - - + 超级签URL: + + + + + + Beta版本链接: + + + + + + + 下载方式 + + + + + + + @@ -1284,9 +1307,11 @@ $("input[name='appstatus'][value=1]").prop("disabled",true); $("input[name='appstatus'][value=0]").prop("disabled",true); $("input[name='appstatus'][value=0]").prop("checked",true); + $('.ios-display').hide(); }else{ $("input[name='appstatus'][value=1]").removeAttr("disabled"); $("input[name='appstatus'][value=0]").removeAttr("disabled"); + $('.ios-display').show(); } }) diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index a0ee70f2b..cfe29af1a 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -447,28 +447,6 @@ - - Beta版本链接: - - - - - - - Beta版本是否开启 - - - - - - - - - 知识产权 @@ -570,6 +548,7 @@ + 超级签Token: @@ -582,32 +561,29 @@ - - 超级签状态: - - - - - - - - - - - - - + Beta版本链接: + + + - + + 下载方式 + + + + + + + + + diff --git a/Application/Admin/View/Promote/belong.html b/Application/Admin/View/Promote/belong.html index ae7200bee..827046b5f 100644 --- a/Application/Admin/View/Promote/belong.html +++ b/Application/Admin/View/Promote/belong.html @@ -73,7 +73,13 @@ - +
+ +
@@ -100,6 +106,7 @@ 身份状态 内外团 归属状态 + 充值信息权限 申请时间 备注 审核 @@ -181,6 +188,14 @@ 只维护 + + + 禁止 + + + 开放 + + {:set_show_time($data['applicant_time'])} {$data['remark']} @@ -208,9 +223,9 @@
- + {$_page|default=''}
diff --git a/Application/Admin/View/Promote/belong_add.html b/Application/Admin/View/Promote/belong_add.html index 2f6e6b177..b8cc5467a 100644 --- a/Application/Admin/View/Promote/belong_add.html +++ b/Application/Admin/View/Promote/belong_add.html @@ -89,6 +89,22 @@ + + + 充值信息查看权限: + + + + + + + + + 备注: diff --git a/Application/Admin/View/Promote/belong_edit.html b/Application/Admin/View/Promote/belong_edit.html index d3eade694..f39d3750a 100644 --- a/Application/Admin/View/Promote/belong_edit.html +++ b/Application/Admin/View/Promote/belong_edit.html @@ -100,6 +100,26 @@ + + 充值信息查看权限: + + + + + + + + + 备注: diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index e03f60b9d..319ef2847 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -134,6 +134,14 @@ + +
+ +
+ diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html index 7d14a96be..a75a45d7a 100644 --- a/Application/Admin/View/PromoteGameRatio/applyRatio.html +++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html @@ -105,11 +105,11 @@ - + - + diff --git a/Application/Admin/View/Query/marketList.html b/Application/Admin/View/Query/marketList.html index 61ab31b83..0f240b493 100644 --- a/Application/Admin/View/Query/marketList.html +++ b/Application/Admin/View/Query/marketList.html @@ -111,8 +111,8 @@
diff --git a/Application/Admin/View/StatementMangement/createDownstreamOrder.html b/Application/Admin/View/StatementMangement/createDownstreamOrder.html index 359783339..ecc9c7baf 100644 --- a/Application/Admin/View/StatementMangement/createDownstreamOrder.html +++ b/Application/Admin/View/StatementMangement/createDownstreamOrder.html @@ -200,6 +200,14 @@