Merge remote-tracking branch 'origin/feature/admin_optimize' into feature/admin_optimize

# Conflicts:
#	Data/update.sql
master
liuweiwen 5 years ago
commit b444a3546b

@ -2039,6 +2039,32 @@ function getPromoteCompanyList() {
return $data;
}
//获取游戏cp分成比例 $type=false时返回最低分成比例
function getGameCpRadio($game_id,$amount,$type) {
if (!$type) {
$data = M('cp_game_ratio','tab_')->where(['game_id'=>$game_id])->order('begin_total_amount asc')->find();
} else {
//取两条
$ladderData = M('cp_game_ratio','tab_')->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$amount]])->limit(0,2)->order('begin_total_amount desc')->select();
// dump($ladderData);die();
foreach($ladderData as $key => $value) {
if ($value['instanceof'] == 1 && $value['begin_total_amount'] <= $amount
|| $value['instanceof'] == 2 && $value['begin_total_amount'] != $amount ) {
$data['ratio'] = $value['ratio'];
break;
} else {
$data['ratio'] = $value['ratio'];
}
}
}
return $data['ratio']?$data['ratio']:0;
}
?>

@ -706,16 +706,20 @@ function getPromoteAccount($promoteId)
return M('promote', 'tab_')->where($map)->getField('account');
}
//获取推广员列表 $level 0-全部
function getPromoteByLevel($level = 0)
//获取推广员列表 $level 0-全部 $companyId 推广公司 0-全部
function getPromoteByLevel($level = 0, $companyId = 0)
{
$field = 'id, account, real_name';
if ($level) {
$map['_string'] = '1 = 1';
if ($level > 0) {
$map['level'] = $level;
$promotes = M('promote', 'tab_')->field($field)->where($map)->select();
} else {
$promotes = M('promote', 'tab_')->field($field)->select();
}
if ($companyId > 0) {
$map['company_id'] = $companyId;
}
$promotes = M('promote', 'tab_')->field($field)->where($map)->select();
return $promotes;
}

@ -1073,7 +1073,7 @@ public function auto_rrdae(){
$map['level'] = 1;
$map['ver_status'] = 1;
$map['settlement_type'] = ($settlement == 3) ? 1 : $settlement;
$promotes = M('promote', 'tab_')->field('id, account, chain, settlement_type')->where($map)->select();
$promotes = M('promote', 'tab_')->field('id, account, chain, settlement_type, auto_review_withdraw_status')->where($map)->select();
$success = 0;
$error_withdraw = 0;
$error_spend = 0;

@ -5887,6 +5887,10 @@ class ExportController extends Controller
if (strlen(I('company_belong'))) {
$map['company_belong'] = I("company_belong");
}
if (!is_null(I('admin_uid', null))) {
$map['admin_id'] = I('admin_uid');
}
//为数据权限添加
setPowerPromoteIds($map, 'tab_promote.id');
@ -7114,6 +7118,7 @@ class ExportController extends Controller
$xlsCell = array(
array('game_name','游戏'),
array('game_type_name','游戏类型'),
array('partner_name','合作公司'),
array('cash_count','游戏现金金额'),
array('balance_coin_count','平台币直充支出'),
@ -7145,6 +7150,10 @@ class ExportController extends Controller
$map['_string'] .= " s.pay_time < {$timeend}";
}
if (!empty(I('game_type_id'))) {
$map['g.game_type_id'] = I('game_type_id');
}
$xlsData = D("spend")->gameStatistics($map);
foreach ($xlsData as $key => $value) {
$xlsData[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count'];

@ -725,6 +725,10 @@ class FinanceController extends ThinkController
}
$map['_string'] .= " s.pay_time < {$timeend}";
}
if (!empty(I('game_type_id'))) {
$map['g.game_type_id'] = I('game_type_id');
}
$startTime = time();
//游戏统计列表
$data = D("spend")->gameStatistics($map, $row, $p);
@ -749,6 +753,8 @@ class FinanceController extends ThinkController
$sumInside = $totalData['inside_cash_count'];
$sumAll = $sumCash + $sumBalance + $sumInside;
$game_types = M("game_type", 'tab_')->field('id, type_name')->select();
$this->assign('game_types', $game_types);
$this->assign('sumCash', $sumCash);
$this->assign('sumBalance', $sumBalance);
$this->assign('sumInside', $sumInside);

@ -99,6 +99,11 @@ class PromoteController extends ThinkController
if (strlen(I('company_belong'))) {
$map['company_belong'] = I("company_belong");
}
if (!is_null(I('admin_uid', null))) {
$map['admin_id'] = I('admin_uid');
}
$this->m_title = '推广员列表';
$this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find());
if (isset($_REQUEST['row'])) {
@ -176,6 +181,8 @@ class PromoteController extends ThinkController
if ($page) {
$this->assign('_page', $page);
}
$admins = M('member')->field('uid,nickname')->select();
$this->assign('admins', $admins);
$this->assign('list_data', $list_data);
$this->display();
}
@ -1216,6 +1223,13 @@ class PromoteController extends ThinkController
$map['pb.can_view_recharge'] = I('can_view_recharge');
}
if (!is_null(I('company_id', null))) {
$map['p.company_id'] = I('company_id');
}
if (!is_null(I('admin_id', null))) {
$map['p.admin_id'] = I('admin_id');
}
$this->m_title = '推广公会归属管理';
$this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/belong','status'=>1])->find());
if (isset($_REQUEST['row'])) {
@ -1229,8 +1243,9 @@ class PromoteController extends ThinkController
$model = M('promote_belong', 'tab_');
$list_data = $model->alias('pb')
->join('left join tab_promote as p on p.id=pb.promote_id')
->join('left join tab_promote_company as pc on pc.id = p.company_id')
->where($map)
->field('p.*,pb.*')
->field('p.*,pb.*, pc.company_name')
->page($p, $row)
->order('verify_status asc,applicant_time asc')
->select();
@ -1241,8 +1256,12 @@ class PromoteController extends ThinkController
if ($page) {
$this->assign('_page', $page);
}
$companys = M('promote_company', 'tab_')->field('id, company_name')->select();
$admins = M('member')->field('uid,nickname')->select();
$this->assign('is_admin', is_administrator());
$this->assign('list_data', $list_data);
$this->assign('companys', $companys);
$this->assign('admins', $admins);
$this->display();
}

@ -22,22 +22,44 @@ class PromoteGameRatioController extends ThinkController
{
$params = I('get.');
$group = $params['group'] ?? 1;
$companyId = $params['company_id'] ?? 0;
$companyBelong = $params['company_belong'] ?? '';
$promoteId = $params['promote_id'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$gameTypeId = $params['game_type_id'] ?? 0;
$status = $params['status'] ?? '';
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
$map['_string'] = 'game_id = relation_game_id';
$where['_string'] = '1 = 1';
if ($companyId || ($companyBelong !== '' && in_array($companyBelong, [0, 1]))) {
$promoteMap['_string'] = '1 = 1';
if ($companyId) {
$promoteMap['company_id'] = $companyId;
}
if ($companyBelong !== '' && in_array($companyBelong, [0, 1])) {
$promoteMap['company_belong'] = $companyBelong;
}
$promoteIds = D('promote')->where($promoteMap)->getField('id', true);
$promoteIds = $promoteIds ?? [-1];
$where['promote_id'] = ['in', $promoteIds];
}
if ($promoteId) {
$map['promote_id'] = intval($promoteId);
}
if ($gameTypeId) {
$gameIds = D('game')->where(['game_type_id' => $gameTypeId])->getField('id', true);
$gameIds = $gameIds ?? [-1];
$where['game_id'] = ['in', $gameIds];
}
if ($gameId) {
$map['game_id'] = intval($gameId);
}
if ($status !== '') {
$map['status'] = intval($status);
}
$map['_complex'] = $where;
$field = 'create_time, update_time';
if ($group == 1) {
@ -68,8 +90,8 @@ class PromoteGameRatioController extends ThinkController
if ($promoteGameRatios) {
$promoteIds = array_column($promoteGameRatios, 'promote_id');
$gameIds = array_column($promoteGameRatios, 'game_id');
$promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status';
$gameFiled = 'id, relation_game_name, ratio';
$promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status, company_id, company_belong';
$gameFiled = 'id, relation_game_name, ratio, game_type_name';
$promotes = M('promote', 'tab_')->where(array('id' => ['in', $promoteIds]))->getField($promoteFiled, true);
$games = M('game', 'tab_')->where(array('id' => ['in', $gameIds]))->getField($gameFiled, true);
@ -83,14 +105,22 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteCreateTime = '未知';
$thisPromoteStatus = '待审核';
$thisPromoteVerStatus = '未知';
$thisCompanyName = '未知';
$thisCompanyBelong = '未知';
$thisGameTypeName = '未知';
$thisGameName = '未知';
$thisGameRatio = '0.00%';
$thisLastRatio = $promoteGameRatio['last_ratio'] . '%';
$thisLastTurnoverRatio = $promoteGameRatio['last_turnover_ratio'] ? json_decode($promoteGameRatio['last_turnover_ratio'], true) : [];
$thisLastRatio = $thisLastTurnoverRatio ? "{$thisLastRatio} - " . $thisLastTurnoverRatio[count($thisLastTurnoverRatio) - 1]['ratio'] . '%' : $thisLastRatio;
$thisRatio = $promoteGameRatio['ratio'] . '%';
$thisTurnoverRatio = $promoteGameRatio['turnover_ratio'] ? json_decode($promoteGameRatio['turnover_ratio'], true) : [];
$thisRatio = $thisTurnoverRatio ? "{$thisRatio} - " . $thisTurnoverRatio[count($thisTurnoverRatio) - 1]['ratio'] . '%' : $thisRatio;
$thisTurnoverRatios = $promoteGameRatio['turnover_ratio'] ? json_decode($promoteGameRatio['turnover_ratio'], true) : [];
$thisRatioDtl = "默认:{$promoteGameRatio['ratio']}%";
if ($thisTurnoverRatios) {
foreach ($thisTurnoverRatios as $thisTurnoverRatio) {
$thisIntervalClosedStatusText = isset($thisTurnoverRatio['instanceof']) ? ($thisTurnoverRatio['instanceof'] == 1 ? '≥' : '>') : '≥';
$thisRatioDtl .= "<br>月流水{$thisIntervalClosedStatusText}{$thisTurnoverRatio['turnover']},比例:{$thisTurnoverRatio['ratio']}%";
}
}
$thisLastRatioStatus = $promoteGameRatio['last_ratio_status'];
$thisStatusText = self::$statusList[$promoteGameRatio['status']];
$thisStatusText = ($promoteGameRatio['status'] == -1) ? '<span style="color: red;">' . $thisStatusText . '</span>' : $thisStatusText;
@ -106,11 +136,14 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteStatus = get_info_status($promotes[$thisPromoteId]['status'], 3);
$thisPromoteStatus = $thisPromoteStatus ?? '待审核';
$thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['ver_status'], 2);
$thisCompanyName = getPromoteCompanyName($promotes[$thisPromoteId]['company_id']);
$thisCompanyBelong = $promotes[$thisPromoteId]['company_belong'] == 1 ? '外团' : '内团';
}
if ($issetGame) {
$thisGameName = $games[$thisGameId]['relation_game_name'];
$thisGameRatio = $games[$thisGameId]['ratio'];
$thisGameRatio = ($thisGameRatio ?? '0.00') . '%';
$thisGameTypeName = $games[$thisGameId]['game_type_name'];
}
$record = [
@ -121,9 +154,12 @@ class PromoteGameRatioController extends ThinkController
'promote_create_time' => $thisPromoteCreateTime,
'promote_status_text' => $thisPromoteStatus,
'promote_ver_status_text' => $thisPromoteVerStatus,
'company_name' => $thisCompanyName,
'company_belong' => $thisCompanyBelong,
'game_name' => $thisGameName,
'game_type_name' => $thisGameTypeName,
'last_ratio' => (($thisLastRatioStatus == 1 || $group != 1) ? $thisLastRatio : $thisGameRatio),
'ratio' => $thisRatio,
'ratio_dtl' => $thisRatioDtl,
'valid_date' => $validDate,
'remark' => $promoteGameRatio['remark'],
'status_text' => $thisStatusText,
@ -158,16 +194,20 @@ class PromoteGameRatioController extends ThinkController
exit;
}
$gameTypelist = getGameTypes();
$companys = getPromoteCompanys();
$reviewRule = $this->getReviewRule();
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
$this->assign('companys', $companys);
$this->assign('gameTypeList', $gameTypelist);
$this->assign('group', $group);
$this->assign('records', $records);
$this->assign('count', $count);
$this->assign('gameList', getAllGameList(true));
$this->assign('promoteList', getPromoteByLevel(1));
$this->assign('promoteList', getPromoteByLevel(1, intval(I('company_id', 0))));
$this->assign('statusList', self::$statusList);
$this->assign('reviewRule', $reviewRule);
$this->assign('is_admin', is_administrator());
@ -192,8 +232,8 @@ class PromoteGameRatioController extends ThinkController
$this->error('默认分成比例不能为空');
}
$save['turnover_ratio'] = [];
if (!empty(array_filter($params['turnover'])) || !empty(array_filter($params['turnover_ratio']))) {
if (is_array($params['turnover']) && is_array($params['turnover_ratio'])) {
if (!empty(array_filter($params['turnover'])) || !empty(array_filter($params['turnover_ratio'])) || !empty(array_filter($params['instanceof']))) {
if (is_array($params['turnover']) && is_array($params['turnover_ratio']) && is_array($params['instanceof'])) {
foreach ($params['turnover'] as $turnover) {
if (empty($turnover)) {
$this->error('月流水不能为空');
@ -204,6 +244,11 @@ class PromoteGameRatioController extends ThinkController
$this->error('月流水分成比例不能为空');
}
}
foreach ($params['instanceof'] as $intervalClosedStatus) {
if (!in_array($intervalClosedStatus, [1, 2])) {
$this->error('月流水分符号不能为空');
}
}
$turnoverCount = count($params['turnover']);
$sortTurnover = $params['turnover'];
sort($sortTurnover);
@ -225,6 +270,7 @@ class PromoteGameRatioController extends ThinkController
$save['turnover_ratio'][] = [
'turnover' => bcdiv($turnover, 1, 2),
'ratio' => bcdiv($params['turnover_ratio'][$key], 1, 2),
'instanceof' => (isset($params['instanceof'][$key]) ? $params['instanceof'][$key] : 1),
];
}
$save['turnover_ratio'] = json_encode($save['turnover_ratio']);
@ -243,14 +289,15 @@ class PromoteGameRatioController extends ThinkController
if (empty($promoteGameRatio)) {
$this->error('参数异常');
}
if ($promoteGameRatio['status'] == -1 || $save['begin_time'] != $promoteGameRatio['begin_time'] || $save['end_time'] != $promoteGameRatio['end_time'] || $save['ratio'] != $promoteGameRatio['ratio'] || $save['remark'] != $promoteGameRatio['remark'] || $save['turnover_ratio'] != $promoteGameRatio['turnover_ratio']) {
$this->isWithdraw($promoteGameRatio['promote_id'], $save['begin_time']);
if ($promoteGameRatio['status'] == -1 || $save['instanceof'] != $promoteGameRatio['instanceof'] || $save['begin_time'] != $promoteGameRatio['begin_time'] || $save['end_time'] != $promoteGameRatio['end_time'] || $save['ratio'] != $promoteGameRatio['ratio'] || $save['remark'] != $promoteGameRatio['remark'] || $save['turnover_ratio'] != $promoteGameRatio['turnover_ratio']) {
$this->isWithdraw($promoteGameRatio['promote_id'], $save['begin_time'], $save['end_time']);
if ($promoteGameRatio['status'] == 1) {
$save['last_turnover_ratio'] = $promoteGameRatio['turnover_ratio'];
$save['last_ratio'] = $promoteGameRatio['ratio'];
$save['last_ratio_status'] = 1;
}
$saveMap['promote_id'] = $promoteGameRatio['promote_id'];
$saveMap['relation_game_id'] = $promoteGameRatio['relation_game_id'];
$result = D(self::MODEL_NAME)->where($saveMap)->save($save);
$logResult = $result;
@ -293,7 +340,7 @@ class PromoteGameRatioController extends ThinkController
$this->error('参数异常');
}
$this->isWithdraw($promoteId, $save['begin_time']);
$this->isWithdraw($promoteId, $save['begin_time'], $save['end_time']);
$map['promote_id'] = $promoteId;
$save['promote_id'] = $promoteId;
@ -329,6 +376,7 @@ class PromoteGameRatioController extends ThinkController
$params = I('get.');
$id = $params['id'] ?? 0;
$id = intval($id);
$companyId = 0;
$metaTitle = '游戏分成比例申请';
if ($id) {
$metaTitle .= '--修改';
@ -347,18 +395,30 @@ class PromoteGameRatioController extends ThinkController
$lastRatio = ($gameRatio ?? '0.00') . '%';
}
$companyId = $promoteGameRatio['company_id'];
$promoteGameRatio['company_id'] = D('promote')->where(['id' => $promoteGameRatio['promote_id']])->getField('company_id');
$this->assign('record', $promoteGameRatio);
$this->assign('lastRatio', $lastRatio);
}
$companys = getPromoteCompanys();
$this->assign('companys', $companys);
$this->assign('gameList', getAllGameList(true));
$this->assign('promoteList', getPromoteByLevel(1));
$this->assign('promoteList', getPromoteByLevel(1, $companyId));
$this->meta_title = $metaTitle;
$this->display();
}
}
private function isWithdraw($promoteId, $beginTime)
public function getPromotes()
{
$level = 1;
$companyId = intval(I('company_id', 0));
$promotes = getPromoteByLevel($level, $companyId);
$this->ajaxReturn($promotes);
}
private function isWithdraw($promoteId, $beginTime, $endTime)
{
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote)) {
@ -370,11 +430,38 @@ class PromoteGameRatioController extends ThinkController
$withdrawMap['promote_id'] = $promoteId;
$withdrawMap['status'] = ['neq', -2];
if (empty($endTime)) {
$withdrawWhere['settlement_begin_time'] = ['egt', $beginTime];
$withdrawWhere['settlement_end_time'] = ['egt', $beginTime];
} else {
$withdrawWhere['settlement_begin_time'] = ['between', [$beginTime, $endTime]];
$withdrawWhere['settlement_end_time'] = ['between', [$beginTime, $endTime]];
}
$withdrawWhere['_logic'] = 'or';
$withdrawMap['_complex'] = $withdrawWhere;
$withdrawMap['settlement_begin_time'] = ['egt', $beginTime];
$withdraw = M('withdraw', 'tab_')->where($withdrawMap)->order('create_time desc')->find();
if (!empty($withdraw) && $withdraw['status'] != -2) {
$time = date('Y-m', $beginTime);
$this->error("{$time}月已有订单申请提现, 无法变更分成比例,请重新选择开始时间");
$withdraws = M('withdraw', 'tab_')->field('settlement_begin_time, settlement_end_time')
->where($withdrawMap)
->order('settlement_begin_time asc, settlement_end_time asc')
->select();
if (!empty($withdraws)) {
$times = [];
$text = '';
foreach ($withdraws as $withdraw) {
$settlementBeginTime = !empty($withdraw['settlement_begin_time']) ? date('Y-m', $withdraw['settlement_begin_time']) : '';
$settlementEndTime = date('Y-m', $withdraw['settlement_end_time']);
if ($settlementBeginTime && !in_array($settlementBeginTime, $times)) {
$times[] = $settlementBeginTime;
$text .= "{$settlementBeginTime}月、";
}
if (!in_array($settlementEndTime, $times)) {
$times[] = $settlementEndTime;
$text .= "{$settlementEndTime}月、";
}
}
$text = rtrim($text, '、');
$text .= '已有订单申请提现, 无法变更分成比例,请重新选择开始时间';
$this->error($text);
}
}

@ -2,6 +2,7 @@
namespace Admin\Controller;
use Admin\Model\PromoteModel;
use Home\Controller\FileController;
use User\Api\UserApi as UserApi;
use Admin\Model\WithdrawModel;
@ -1005,6 +1006,7 @@ class QueryController extends ThinkController
public function withdraw()
{
$page = I('p', 1);
$row = I('row', 10);
$map['_string'] = '1=1';
$adminid = C('USER_ADMINISTRATOR');//获取超管id
$adminmobile = M('UcenterMember')->field('mobile')->find($adminid);
@ -1030,6 +1032,13 @@ class QueryController extends ThinkController
} else {
$map['promote_id'] = array('gt', 0);
}
if (!empty($_REQUEST['company_id'])) {
$promoteIds = D('promote')->where(['company_id' => $_REQUEST['company_id']])
->getField('id', true);
$promoteIds = $promoteIds ?? [-1];
$where['promote_id'] = ['in', $promoteIds];
$map['_complex'] = $where;
}
$order = 'create_time desc';
if (isset($_REQUEST['data_order'])) {
@ -1042,40 +1051,68 @@ class QueryController extends ThinkController
}
}
}
$fields = 'id, widthdraw_number, sum_money, promote_id, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time';
$count = 0;
if (I('export', 0) == 1) {
$records = D('withdraw')->field('widthdraw_number, sum_money, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time')
$records = D('withdraw')->field($fields)
->where($map)
->order($order)
->select();
if (!empty($records)) {
$data = [];
foreach ($records as $record) {
$record['op_id_text'] = $this->getOpTypeText($record['op_type'], $record['op_id']);
$record['last_op_id_text'] = $this->getOpTypeText($record['last_op_type'], $record['last_op_id']);
$record['op_type_text'] = getPromoteWithdrawOpType($record['op_type']);
$record['last_op_type_text'] = getPromoteWithdrawOpType($record['last_op_type']);
$record['settlement_type_text'] = getPromoteWithdrawSettlementType($record['settlement_type']);
$data[] = [
'widthdraw_number' => $record['widthdraw_number'],
'sum_money' => $record['sum_money'],
'promote_account' => $record['promote_account'],
'op_id_text' => $this->getOpTypeText($record['op_type'], $record['op_id']),
'last_op_id_text' => $this->getOpTypeText($record['last_op_type'], $record['last_op_id']),
'op_type_text' => getPromoteWithdrawOpType($record['op_type']),
'last_op_type_text' => getPromoteWithdrawOpType($record['last_op_type']),
'settlement_type_text' => getPromoteWithdrawSettlementType($record['settlement_type']),
'settlement_begin_time' => $record['settlement_begin_time'] ? date('Y-m-d H:i:s', $record['settlement_begin_time']) : '--',
'settlement_end_time' => date('Y-m-d H:i:s', $record['settlement_end_time']),
'create_time' => date('Y-m-d H:i:s', $record['create_time']),
'status_text' => promoteWithdrawStatus($record['status']),
'respond' => $record['respond'],
'audit_time' => $record['audit_time'] ? date('Y-m-d H:i:s', $record['audit_time']) : '--',
];
} else {
$records = D('withdraw')->field($fields)
->where($map)
->order($order)
->page($page, $row)
->select();
$count = D('withdraw')->field($fields)
->where($map)
->count();
}
$datas = [];
if (!empty($records)) {
$promoteIds = array_column($records, 'promote_id');
$promoteCompanys = D('promote')->join('tab_promote_company as company on tab_promote.company_id = company.id')
->where(['tab_promote.id' => ['in', $promoteIds]])
->getField('tab_promote.id, company.company_name', true);
foreach ($records as $record) {
$record['op_id_text'] = $this->getOpTypeText($record['op_type'], $record['op_id']);
$record['last_op_id_text'] = $this->getOpTypeText($record['last_op_type'], $record['last_op_id']);
$record['op_type_text'] = getPromoteWithdrawOpType($record['op_type']);
$record['last_op_type_text'] = getPromoteWithdrawOpType($record['last_op_type']);
$record['settlement_type_text'] = getPromoteWithdrawSettlementType($record['settlement_type']);
$record['company_name'] = isset($promoteCompanys[$record['promote_id']]) ? $promoteCompanys[$record['promote_id']] : '未知';
$data = [
'widthdraw_number' => $record['widthdraw_number'],
'sum_money' => $record['sum_money'],
'company_name' => $record['company_name'],
'promote_account' => $record['promote_account'],
'op_id_text' => $this->getOpTypeText($record['op_type'], $record['op_id']),
'last_op_id_text' => $this->getOpTypeText($record['last_op_type'], $record['last_op_id']),
'op_type_text' => getPromoteWithdrawOpType($record['op_type']),
'last_op_type_text' => getPromoteWithdrawOpType($record['last_op_type']),
'settlement_type_text' => getPromoteWithdrawSettlementType($record['settlement_type']),
'settlement_begin_time' => $record['settlement_begin_time'] ? date('Y-m-d H:i:s', $record['settlement_begin_time']) : '--',
'settlement_end_time' => date('Y-m-d H:i:s', $record['settlement_end_time']),
'create_time' => date('Y-m-d H:i:s', $record['create_time']),
'status_text' => promoteWithdrawStatus($record['status']),
'respond' => $record['respond'],
'audit_time' => $record['audit_time'] ? date('Y-m-d H:i:s', $record['audit_time']) : '--',
];
if (I('export', 0) != 1) {
$data['id'] = $record['id'];
$data['status'] = $record['status'];
}
$datas[] = $data;
}
if (I('export', 0) == 1) {
$field = [
'widthdraw_number' => '结算单号',
'sum_money' => '结算金额',
'company_name' => '推广公司',
'promote_account' => '推广员账号',
'op_id_text' => '操作人',
'op_type_text' => '操作人类型',
@ -1089,17 +1126,11 @@ class QueryController extends ThinkController
'respond' => '说明',
'audit_time' => '审核时间',
];
data2csv($data,"推广结算", $field);
data2csv($datas,"推广结算", $field);
exit;
}
}
$model = array(
'm_name' => 'withdraw',
'order' => $order,
'title' => '渠道提现',
'template_list' => 'withdraw',
);
$map1 = array('status' => ['neq', -1]);
//为数据权限添加
setPowerPromoteIds($map1);
@ -1110,15 +1141,21 @@ class QueryController extends ThinkController
$this->assign('total', $total);
$this->assign('ttotal', $ttotal);
$this->assign('ytotal', $ytotal);
$user = A('Bill', 'Event');
$this->m_title = '推广提现';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Query/withdraw', 'status' => 1])->find());
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
//为数据权限添加
setPowerPromoteIds($map);
$companys = getPromoteCompanys();
$this->assign('companys', $companys);
$this->assign('is_admin', is_administrator());
$user->money_list($model, $page, $map);
$this->assign('list_data', $datas);
$this->display();
}
public function getWithdraw()
@ -1669,4 +1706,87 @@ class QueryController extends ThinkController
}
$this->ajaxReturn(['balance' => $balance]);
}
public function autoReview($autoStatus = 0)
{
if ($_POST) {
$promoteIds = I('ids', '');
$autoStatus = intval($autoStatus);
if (empty($promoteIds)) {
$this->error('请选择需要操作的数据');
}
if (!in_array($autoStatus, [0, 1])) {
$this->error('参数错误');
}
$map['id'] = ['in', $promoteIds];
$time = time();
$save['auto_review_withdraw_status'] = $autoStatus;
$save['auto_review_withdraw_updated_time'] = $time;
$result = D('promote')->where($map)->save($save);
if ($result === false) {
$this->error('操作失败');
} else {
$this->success('操作成功');
}
} else {
$page = intval(I('p', 1));
$row = intval(I('row', 10));
$companyId = intval(I('company_id', 0));
$promoteId = intval(I('promote_id', 0));
$autoReviewWithdrawStatus = I('status', '');
if ($companyId > 0) {
$map['company_id'] =$companyId;
}
if ($promoteId > 0) {
$map['id'] =$promoteId;
}
if ($autoReviewWithdrawStatus !== '') {
$map['auto_review_withdraw_status'] = $autoReviewWithdrawStatus;
}
$map['level'] = 1;
$field = 'id, account, company_id, auto_review_withdraw_status';
$promotes = D('promote')->field($field)
->where($map)
->order('auto_review_withdraw_updated_time desc')
->page($page, $row)
->select();
$count = D('promote')->field($field)
->where($map)
->count();
$companys = getPromoteCompanys();
$companyList = array_column($companys, 'company_name', 'id');
$promoteList = (new PromoteModel())->getPromotersByLevel();
$records = [];
if (!empty($promotes)) {
foreach ($promotes as $promote) {
$promote['company_name'] = $companyList[$promote['company_id']] ?? '未知';
if ($promote['auto_review_withdraw_status'] == 0) {
$className = 'auto-closed';
$text = '关闭';
} else {
$className = 'auto-open';
$text = '开启';
}
$promote['auto_review_withdraw_status_text'] = "<span class='{$className}'>{$text}</span>";
$records[] = $promote;
}
}
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
$this->assign('meta_title', '推广提现自动审核管理');
$this->assign('records', $records);
$this->assign('count', $count);
$this->assign('companys', $companys);
$this->assign('promoteList', $promoteList);
$this->display('auto_review');
}
}
}

@ -83,7 +83,7 @@ class StatementController extends ThinkController
$CompanyId = $_REQUEST['company_id']; //对账公司id
$statement_type = $_REQUEST['statement_type'];
$is_month = false;//是否是月结判断
$is_month = false;//是否是月结判断,非月结无需梯度计算
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
//判断是否是月结
$tm = explode('-',$_REQUEST['time_start']);
@ -154,15 +154,16 @@ class StatementController extends ThinkController
"game_id"=>$v['game_id'],
"begin_total_amount"=>0,
);
if($is_month){
$map['begin_total_amount'] = array("ELT",$v['pay_amount']);
};
$ratiores = $CpGameRatio->where($map)->order("begin_total_amount desc")->limit(1)->select();
if(empty($ratiores)){
$redio = 0;
}else{
$redio = $ratiores[0]['ratio'];
}
// if($is_month){
// $map['begin_total_amount'] = array("ELT",$v['pay_amount']);
// };
// $ratiores = $CpGameRatio->where($map)->order("begin_total_amount desc")->limit(1)->select();
// if(empty($ratiores)){
// $redio = 0;
// }else{
// $redio = $ratiores[0]['ratio'];
// }
$redio = getGameCpRadio($v['game_id'],$v['pay_amount'],$is_month);//获取分成比例
$v['second_ratio'] = $redio;
$v['first_ratio'] = (100-$redio);
if($statement_type == 0){

@ -230,4 +230,103 @@ class StatementMangementController extends ThinkController
}
public function rewardManageList($row = 10, $p = 1)
{
$map = [];
$list = M('reward_record', 'tab_')->where($map)->page($p, $row)->select();
if ($list) {
$companys[1] = array_column(M('partner', 'tab_')->field('id, partner as name')->select(), 'name', 'id');
$companys[2] = array_column(M('promote_company', 'tab_')->field('id, company_name as name')->select(), 'name', 'id');
$games = array_column(M('game', 'tab_')->field('relation_game_id, relation_game_name')->group('relation_game_id')->select(), 'relation_game_name', 'relation_game_id');
foreach ($list as &$item) {
$item['company_name'] = $companys[$item['company_type']][$item['company_id']];
$item['accounts'] = json_decode($item['accounts'], true) ?: [];
$item['reward_type_desc'] = $item['reward_type'] == 1 ? "奖励" : "惩罚";
$item['company_type_desc'] = $item['company_type'] == 1 ? "上游公司" : "下游公司";
$item['relation_game_name'] = $games[$item['relation_game_id']];
// if ($item['company_type'] == 1) {
// } else {
// }
}
}
$count = M('reward_record', 'tab_')->where($map)->count();
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('list', $list);
$this->display();
}
public function rewardManageSave($id=0)
{
if (IS_POST) {
$data = [
'reward_type' => I('reward_type'),
'company_type' => I('company_type'),
'company_id' => I('company_id'),
'relation_game_id' => I('relation_game_id'),
'money' => I('money'),
'content' => I('content'),
'remark' => I('remark'),
];
$accounts = I('account');
$user_types = I('user_type');
if ($accounts) {
foreach ($accounts as $index => $account) {
$data['accounts'][] = array_merge(['account'=>$account], ['user_type'=>$user_types[$index]]);
}
} else {
$data['accounts'] = [];
}
$data['accounts'] = json_encode($data['accounts']);
if (!is_numeric(I('money'))) {
return $this->error('请输入正确的金额');
}
if (empty(I('content'))) {
return $this->error('请填写事件内容');
}
if ($id) {
$upt = M('reward_record', 'tab_')->where(['id'=>$id])->save($data);
return $upt ? $this->success('更新成功', U('StatementMangement/rewardManageList')) : $this->error('更新失败');
} else {
$data['create_time'] = time();
$data['creater_id'] = is_login();
$ins = M('reward_record', 'tab_')->add($data);
return $ins ? $this->success('新增成功', U('StatementMangement/rewardManageList')) : $this->error('新增失败');
}
} else {
$games = M('game', 'tab_')->field('relation_game_id, relation_game_name')->group('relation_game_id')->select();
$this->assign('games', $games);
if ($id) {
if (I('delete')) {
$upt = M('reward_record', 'tab_')->where(['id'=>$id])->delete();
return $upt ? $this->success('删除成功') : $this->error('删除失败');
} else {
$data = M('reward_record', 'tab_')->where(['id'=>$id])->find();
if (!$data) return $this->error("未找到该记录");
$data['accounts'] = json_decode($data['accounts'], true) ?: [];
$this->assign('data', $data);
}
}
$this->display();
}
}
public function getCompanys($type=1)
{
if ($type == 1) {
$data = M('partner', 'tab_')->field('id, partner as name')->select();
} elseif ($type == 0) {
$data = [];
} else {
$data = M('promote_company', 'tab_')->field('id, company_name as name')->select();
}
return $this->success($data, '', true);
}
}

@ -841,7 +841,7 @@ class SpendModel extends Model
public function gameStatistics($map, $row = 0, $page = 1)
{
$query = $this->alias("s")
->field("s.game_id,s.game_name,p.partner as partner_name,
->field("s.game_id,s.game_name,p.partner as partner_name, g.game_type_name,
SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count")

@ -193,7 +193,7 @@ class WithdrawModel extends Model{
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(1);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
@ -279,9 +279,16 @@ class WithdrawModel extends Model{
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
} else {
if ($sumAmount > $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
}
@ -322,7 +329,7 @@ class WithdrawModel extends Model{
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(2);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
@ -400,9 +407,16 @@ class WithdrawModel extends Model{
$sumAmount = $sumAmount ?? 0;
$ratio = 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
} else {
if ($sumAmount > $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
}
@ -433,7 +447,7 @@ class WithdrawModel extends Model{
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(3);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
@ -486,9 +500,16 @@ class WithdrawModel extends Model{
$sumAmount = $sumAmount ?? 0;
$ratio = 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
} else {
if ($sumAmount > $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
}
@ -543,9 +564,16 @@ class WithdrawModel extends Model{
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
if (empty($turnoverRatio['instanceof']) || $turnoverRatio['instanceof'] == 1) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
} else {
if ($sumAmount > $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
}

@ -107,6 +107,15 @@
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_type_id" name="game_type_id" class="select_gallery" >
<option value="">请选择游戏类型</option>
<volist name="game_types" id="type">
<option value="{$type.id}" <if condition="$type.id eq I('game_type_id', null)">selected</if> >{$type.type_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="开始时间"/>
@ -152,6 +161,8 @@
<th >游戏</th>
<th>游戏类型</th>
<th ><div class="tooltip">游戏现金金额<span class="tooltiptext"><span style="margin-left: -10px">第三方支付(微信,支付宝,快捷)。</span></span></div></th>
<th ><div class="tooltip">平台币直充支出<span class="tooltiptext"><span style="margin-left: -10px">平台币购买游戏道具所产生的金额</span></span></div></th>
@ -180,6 +191,7 @@
<tr>
<td ><if condition="$data.partner_name neq ''">{$data.partner_name}<else/></if></td>
<td ><if condition="$data.game_name neq ''">{$data.game_name}<else/></if></td>
<td ><if condition="$data.game_type_name neq ''">{$data.game_type_name}<else/></if></td>
<td ><if condition="$data.cash_count neq ''">{$data.cash_count}<else/>0</if></td>
<td class="coin-detail" data-pay_type="0" style="color: #0066cc;cursor: pointer"
data-url="{:U('Finance/coinDetail',array(
@ -215,7 +227,7 @@
</tr>
</volist>
<tr>
<td colspan="2" ><span>总计</span></td>
<td colspan="3" ><span>总计</span></td>
<td ><span><if condition="$sumCash neq ''">{$sumCash}<else/>0</if></span></td>
<td><if condition="$sumBalance neq ''">{$sumBalance}<else/>0</if></td>
<td><if condition="$sumInside neq ''">{$sumInside}<else/>0</if></td>

@ -57,6 +57,22 @@
<div class="input-list">
<input type="text" name="account" placeholder="请输入会长账号" value="{:I('account')}">
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option value="">推广公司</option>
<volist name="companys" id="c">
<option value="{$c.id}" <if condition="$c.id eq I('company_id', null)">selected</if> >{$c.company_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="admin_id" name="admin_id" class="select_gallery" >
<option value="">归属管理员</option>
<volist name="admins" id="admin">
<option value="{$admin.uid}" <if condition="$admin.uid eq I('admin_id')">selected</if> >{$admin.nickname}</option>
</volist>
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="company_relation">
@ -101,6 +117,7 @@
<th>会长ID</th>
<th>会长账号</th>
<th>手机号码</th>
<th>推广公司</th>
<th ><a class="paixu" data-order='create_time'>注册时间</a></th>
<th>状态</th>
<th>身份状态</th>
@ -112,6 +129,7 @@
<th>审核</th>
<th>申请人</th>
<th>确认人</th>
<th>归属管理员</th>
<th>操作</th>
</tr>
</thead>
@ -144,6 +162,7 @@
</if>-->
{$data.mobile_phone}
</td>
<td>{$data.company_name}</td>
<td>{:set_show_time($data['create_time'])}</td>
<td>
<?php $status_str = get_info_status($data['status'],3); $status_str = $status_str ?: '待审核';?>
@ -213,6 +232,7 @@
</td>
<td>{$data['applicant_name']}</td>
<td>{$data['approver_name']}</td>
<td>{:get_admin_nickname($data['admin_id'])}</td>
<td>
<a href="{:U('belong_edit',array('id'=>$data['id']))}" class="">编辑</a>
</td>

@ -102,6 +102,14 @@
<option value="4">组员</option>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="admin_uid" name="admin_uid" class="select_gallery" >
<option value="">归属管理员</option>
<volist name="admins" id="admin">
<option value="{$admin.uid}" <if condition="$admin.uid eq I('admin_uid')">selected</if> >{$admin.nickname}</option>
</volist>
</select>
</div>
<div class="input-list input-list-admin search_label_rehab">
<select id="admin_id" name="admin_id" class="select_gallery" >
<option value="">商务专员</option>
@ -196,6 +204,7 @@
<th>所属会长</th>
<th>工会归属</th>
<th>工会关系</th>
<th>归属管理员</th>
<th>商务专员</th>
<th>状态</th>
<th>身份状态</th>
@ -248,6 +257,7 @@
</td>
<td>{$data['company_belong_str']}</td>
<td>{$data['company_relation_str']}</td>
<td>{:get_admin_nickname($data['admin_id'])}</td>
<td>{:get_business_affairs_account($data['ba_id'])}</td>
<td>
<?php $status_str = get_info_status($data['status'],3); $status_str = $status_str ?: '待审核';?>
@ -325,7 +335,7 @@
<tbody>
<if condition = "empty($list_data)">
<tr>
<td colspan="7" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="10" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "list_data">

@ -81,8 +81,26 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"><i class="mustmark">*</i>会长账号</td>
<td class="l"><i class="mustmark">*</i>推广公司</td>
<td class="r">
<select name="company_id" id="company_id" class="select_gallery" <notempty name="record">disabled</notempty>>
<option value="">推广公司</option>
<empty name="record">
<volist name="companys" id="vo">
<option value="{$vo.id}">{$vo.company_name}</option>
</volist>
<else/>
<volist name="companys" id="vo">
<option value="{$vo.id}" <if condition="$vo['id'] eq $record['company_id']">selected</if> >{$vo.company_name}</option>
</volist>
</empty>
</select>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>会长账号:</td>
<td class="r promote_id">
<select name="promote_id" id="promote_id" class="select_gallery" <notempty name="record">disabled</notempty>>
<option value="">会长账号</option>
<empty name="record">
@ -139,14 +157,18 @@
<div class="list-ratio">
<empty name="record['turnover_ratio']">
<div class="li-ratio">
<label>月流水大于等于:</label>
<label class="instanceof_text" style="margin-right: 10px;">月流水</label>
<select name="instanceof[]" style="width: 50px;margin-right: 10px;">
<option value="1"></option>
<option value="2">></option>
</select>
<div class="turnover">
<input type="text" class="txt" name="turnover[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 100px;margin-right: 10px;">
<input type="text" class="txt" name="turnover[]" value="" placeholder="请输入金额" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 100px;margin-right: 10px;">
<span></span>
</div>
<label>分成比例:</label>
<div class="turnover-ratio">
<input type="text" class="txt" name="turnover_ratio[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 60px;">
<input type="text" class="txt" name="turnover_ratio[]" value="" placeholder="请输入比例" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 60px;">
<span class="form_unit" style="margin-right: 10px;">%</span>
<span class="error-message">sadasdas</span>
</div>
@ -156,7 +178,11 @@
<else/>
<volist name="record['turnover_ratio']" key="key" id="vo">
<div class="li-ratio">
<label>月流水大于等于:</label>
<label class="instanceof_text" style="margin-right: 10px;">月流水</label>
<select name="instanceof[]" style="width: 50px;margin-right: 10px;">
<option value="1" <if condition="empty($vo['instanceof']) or $vo['instanceof'] eq 1">selected</if>>≥</option>
<option value="2" <if condition="!empty($vo['instanceof']) and $vo['instanceof'] eq 2">selected</if>>></option>
</select>
<div class="turnover">
<input type="text" class="txt" name="turnover[]" value="{$vo['turnover']|default=''}" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 100px;margin-right: 10px;">
<span></span>
@ -259,6 +285,30 @@ $(function(){
promoteGameRatioData.end_time = '';
promoteGameRatioData.remark = '';
$('#company_id').change(function (e) {
var companyId = parseInt($(this).val());
$.ajax({
type: 'post',
url: "{:U('getPromotes')}",
dataType: 'json',
data: {'company_id': companyId},
success: function (data) {
var html = '<option value="" selected>会长账号</option>';
if (data.length > 0) {
for (let i = 0;i < data.length;i++) {
html += '<option value="' + data[i]['id'] + '">' + data[i]['account'] + '(' + data[i]['real_name'] + ')' + '</option>';
}
}
$('#promote_id').html(html);
$('#promote_id').select2();
getPromoteGameRatio();
},
error: function (result) {
console.log(result);
}
});
});
$('#ratio, #begin_time, #end_time, #remark').change(function () {
var val = $(this).val();
var elementIdName = $(this).attr('id');
@ -266,13 +316,14 @@ $(function(){
});
$('#promote_id, #game_id').change(function () {
var promoteId = parseInt($('#promote_id').val());
var gameId = parseInt($('#game_id').val());
getPromoteGameRatio(promoteId, gameId);
getPromoteGameRatio();
});
function getPromoteGameRatio(promoteId, gameId)
function getPromoteGameRatio()
{
var promoteId = parseInt($('#promote_id').val());
var gameId = parseInt($('#game_id').val());
$.ajax({
type: 'post',
url: "{:U('getPromoteGameRatio')}",
@ -340,14 +391,18 @@ $(function(){
var delBtn = $('.iconfont-btn-del');
var html = '';
html += '<div class="li-ratio">';
html += '<label>月流水大于等于:</label>';
html += '<label class="instanceof_text">月流水:</label>';
html += '<select name="instanceof[]" style="width: 50px;margin-right: 10px;">';
html += '<option value="1"></option>';
html += '<option value="2">></option>';
html += '</select>';
html += '<div class="turnover">';
html += '<input type="text" class="txt" name="turnover[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style="width: 100px;margin-right: 10px;">';
html += '<input type="text" class="txt" name="turnover[]" value="" placeholder="请输入金额" onKeyUp="value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style="width: 100px;margin-right: 10px;">';
html += '<span></span>';
html += '</div>';
html += '<label>分成比例:</label>';
html += '<div class="turnover-ratio">';
html += '<input type="text" class="txt" name="turnover_ratio[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style="width: 60px;">';
html += '<input type="text" class="txt" name="turnover_ratio[]" value="" placeholder="请输入比例" onKeyUp="value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style="width: 60px;">';
html += '<span class="form_unit" style="margin-right: 10px;">%</span>';
html += '<span class="error-message"></span>';
html += '</div>';

@ -72,6 +72,21 @@
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option value="">推广公司</option>
<volist name="companys" id="vo">
<option value="{$vo.id}">{$vo.company_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="company_belong" name="company_belong" class="select_gallery" >
<option value="">内外团</option>
<option value="0" <if condition="0 eq I('company_belong', '') and '' nheq I('company_belong', '')">selected</if>>内团</option>
<option value="1" <if condition="1 eq I('company_belong', '')">selected</if>>外团</option>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" >
<option value="">推广员账号</option>
@ -80,6 +95,14 @@
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="game_type_id" name="game_type_id" class="select_gallery" >
<option value="">游戏类型</option>
<volist name="gameTypeList" id="vo">
<option value="{$vo.id}" <if condition="$vo.id eq I('game_type_id')">selected</if> >{$vo.type_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_id" class="select_gallery" >
<option value="">游戏名称</option>
@ -88,7 +111,7 @@
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<div class="input-list input-list-promote search_label_rehab">
<select id="status" name="status" class="select_gallery" >
<option value="">审核状态</option>
<?php foreach ($statusList as $key => $status) :?>
@ -117,9 +140,12 @@
<th>注册时间</th>
<th>状态</th>
<th>身份状态</th>
<th>推广公司</th>
<th>工会归属</th>
<th>已申请游戏</th>
<th>游戏类型</th>
<th>原分成比例</th>
<th>当前分成比例</th>
<th>公会阶梯比例详细信息</th>
<th>开始时间</th>
<th>备注</th>
<th>分成比例审核</th>
@ -153,9 +179,16 @@
<td>{$record.promote_create_time}</td>
<td>{$record.promote_status_text}</td>
<td>{$record.promote_ver_status_text}</td>
<td>{$record.company_name}</td>
<td>{$record.company_belong}</td>
<td>{$record.game_name}</td>
<td>{$record.game_type_name}</td>
<td>{$record.last_ratio}</td>
<td>{$record.ratio}</td>
<td style="line-height: 16px;text-indent: 0;">
<div style="text-align: left;width: 90%;margin-left: 5%;margin-top: 10px;margin-bottom: 10px;">
{$record.ratio_dtl}
</div>
</td>
<td>{$record.valid_date}</td>
<td>{$record.remark}</td>
<td>{$record.status_text}</td>

@ -0,0 +1,233 @@
<extend name="Public/base"/>
<block name="css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/promote.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.textarea-style {
width: 200px;
height: 80px;
border-radius: 5px;
padding: 5px;
}
.mustmark {
color: #FF0000;
font-style: normal;
margin: 0 3px;
}
.auto-closed {
border: 0 solid;
border-radius: 3px;
background-color: #999;
color: #fff;
padding: 5px 10px;
}
.auto-open {
border: 0 solid;
border-radius: 3px;
background-color: #4bbd00;
color: #fff;
padding: 5px 10px;
}
</style>
</block>
<block name="body">
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.form.js"></script>
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/md5.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:推广员提现自动审核管理</p>
</div>
<div class="cf top_nav_list">
<empty name="model.extend">
<div class="fl button_list">
<div class="tools">
<a class="ajax-post" target-form="ids" url="{:U('autoReview',array('autoStatus' => 1))}"><span class="button_icon button_icon1"></span>开启自动审核</a>
<a class="ajax-post" target-form="ids" url="{:U('autoReview',array('autoStatus' => 0))}"><span class="button_icon button_icon2"></span>关闭自动审核</a>
</div>
</div>
</empty>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option value="">推广公司</option>
<volist name="companys" id="vo">
<option value="{$vo.id}">{$vo.company_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery">
<option value="">推广员账号</option>
<volist name="promoteList" id="vo">
<option value="{$vo.id}">{$vo.account}({$vo.real_name})</option>
</volist>
</select>
</div>
<div class="input-list search_label_rehab">
<select name="status" class="select_gallery" style="width:120px;">
<option value="">自动审核</option>
<option value="0">关闭</option>
<option value="1">开启</option>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Query/autoReview','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
<a class="sch-btn" style="background-color: #999;" href="{:U('withdraw')}" >返回</a>
</div>
<!-- <div class="input-list">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>12,),I('get.')))}">导出</a>
</div> -->
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>推广公司</th>
<th>推广员账号</th>
<th>自动审核</th>
<!-- <th>操作</th>-->
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="records">
<td colspan="11" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="records" id="record">
<tr>
<td>
<input class="ids" type="checkbox" value="{$record['id']}" name="ids[]">
</td>
<td>{$record.company_name}</td>
<td>{$record.account}</td>
<td>{$record.auto_review_withdraw_status_text}</td>
</tr>
</volist>
</empty>
<tr class="data_summary">
<td>汇总</td>
<td colspan="99">累计提现:{:null_to_0(floor($total*100)/100)}元</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Query/withdraw">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
<script src="__STATIC__/jquery.cookie.js" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Query/withdraw')}');
$(function(){
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
console.log($order_type);
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
});
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
});
</script>
</block>

@ -58,6 +58,7 @@
<div class="tools">
<a class="ajax-post" target-form="ids" url="{:U('set_withdraw_status')}"><span class="button_icon button_icon12"></span>通 过</a>
<a class="agree" data-id="ids"><span class="button_icon button_icon13"></span>驳 回</a>
<a href="{:U('autoReview')}"><span class="button_icon button_icon9 "></span>自动审核管理</a>
</div>
</div>
</empty>
@ -66,6 +67,14 @@
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" >
<option value="">推广公司</option>
<volist name="companys" id="vo">
<option value="{$vo.id}">{$vo.company_name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_account" class="select_gallery" style="width:120px;">
<option value="">推广员账号</option>
@ -123,6 +132,7 @@
</th>
<th>提现单号</th>
<th><a class="paixu" data-order='sum_money'>提现金额</a></th>
<th>推广公司</th>
<th>推广员账号</th>
<th>操作人</th>
<th>操作人类型</th>
@ -158,41 +168,19 @@
</td>
<td>{$data.widthdraw_number}</td>
<td onclick="details('{$data["id"]}')"><span class="money_color">{$data.sum_money}</span></td>
<td>
<!--<if condition="$is_admin eq true ">
{:get_promote_name($data['promote_id'])}
<else />
{:encryptStr(get_promote_name($data['promote_id']))}
</if>-->
{:get_promote_name($data['promote_id'])}
</td>
<td>
<if condition="$data.op_type eq 1">
{:get_promote_name($data['op_id'])}
<elseif condition="$data.op_type eq 2"/>
{:getAdminNickname($data['op_id'])}
<else/>
自动
</if>
</td>
<td>{:getPromoteWithdrawOpType($data['op_type'])}</td>
<td>
<if condition="$data.last_op_type eq 1">
{:get_promote_name($data['last_op_id'])}
<elseif condition="$data.last_op_type eq 2"/>
{:getAdminNickname($data['last_op_id'])}
<else/>
自动
</if>
</td>
<td>{:getPromoteWithdrawOpType($data['last_op_type'])}</td>
<td>{:getPromoteWithdrawSettlementType($data['settlement_type'])}</td>
<td><notempty name="data.settlement_begin_time">{$data.settlement_begin_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td><notempty name="data.settlement_end_time">{$data.settlement_end_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td><notempty name="data.create_time">{$data.create_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td><span <if condition="$data['status'] == -2">style="color: #999;"</if>>{:promoteWithdrawStatus($data['status'])}</span></td>
<td>{$data.company_name}</td>
<td>{$data.promote_account}</td>
<td>{$data.op_id_text}</td>
<td>{$data.op_type_text}</td>
<td>{$data.last_op_id_text}</td>
<td>{$data.last_op_type_text}</td>
<td>{$data.settlement_type_text}</td>
<td>{$data.settlement_begin_time}</td>
<td>{$data.settlement_end_time}</td>
<td>{$data.create_time}</td>
<td>{$data.status_text}</td>
<td>{$data.respond}</td>
<td><notempty name="data.audit_time">{$data.audit_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td>{$data.audit_time}</td>
<td>
<div class="partakebtn">
<if condition="$data.status eq 0">

@ -0,0 +1,152 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">奖罚记录管理</h3>
<p class="description_text">上下游奖罚记录管理</p>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" href="{:U('StatementMangement/rewardManageSave')}">添加</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>奖罚类型</th>
<th>公司类型</th>
<th>公司名称</th>
<th>涉及账号</th>
<th>游戏</th>
<th>事件</th>
<th>金额</th>
<th>备注</th>
<th>添加人</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($list)">
<tr>
<td colspan="10" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "list">
<volist name="list" id="data">
<tr>
<td>{$data.reward_type_desc}</td>
<td>{$data.company_type_desc}</td>
<td>{$data.company_name}</td>
<td>
<?php foreach ($data['accounts'] as $account):?>
<div>
<?php if ($account['user_type'] == 1):?>推广员/<?php else:?>玩家/<?php endif;?>{$account['account']}
</div>
<?php endforeach;?>
</td>
<td>{$data.relation_game_name}</td>
<td>{$data.content}</td>
<td>{$data.money}</td>
<td>{$data.remark}</td>
<td>{:get_admin_nickname($data['creater_id'])}</td>
<td>
<a href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Promote/lists/type/{:I('type',1)}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
highlight_subnav("{:U('StatementMangement/rewardManageList')}");
</script>
</block>

@ -0,0 +1,186 @@
<extend name="Public/base" />
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
.bnt_add,.bnt_remove,.bnt_save{
height: 30px;
width: 20px;
font-size: 20px;
line-height: 10px;
color: #3399ff;
background: none;
border: none;
margin-left: 20px;
cursor: pointer;
}
.bnt_remove{
color: #F70909;
}
.bnt_save{
color: #4DB361;
}
</style>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
</block>
<!-- 管理员用户组新增和编辑页面 -->
<block name="body">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<form action="{:U('StatementMangement/rewardManageSave')}" enctype="application/x-www-form-urlencoded" method="POST"
class="form-horizontal form_info_ml">
<div class="formtitle"><span>奖惩编辑</span></div>
<ul class="form_info ">
<input type="hidden" name="id" value="{$data.id}" />
<li>
<label>奖惩类型</label>
<select id="reward_type" name="reward_type" class="select_gallery">
<option value="1" <?php if ($data['reward_type'] == 1):?>selected<?php endif;?>>奖励</option>
<option value="2" <?php if ($data['reward_type'] == 2):?>selected<?php endif;?>>惩罚</option>
</select>
</li>
<li>
<label>公司类型</label>
<select id="company_type" name="company_type" class="select_gallery" onchange="companyTypeChange()">
<option value="1" <?php if ($data['company_type'] == 1):?>selected<?php endif;?>>上游公司</option>
<option value="2" <?php if ($data['company_type'] == 2):?>selected<?php endif;?>>下游公司</option>
</select>
</li>
<li>
<label>公司名称</label>
<select id="company_id" name="company_id" class="select_gallery">
</select>
</li>
<?php if ($data['accounts']):?>
<?php foreach ($data['accounts'] as $k => $account):?>
<?php if ($k == 0):?>
<li class="user-account">
<label>涉及账号</label>
<select name="user_type[]" class="select_gallery user_type" onchange="userAccountChange(this)">
<option value="1" <?php if ($account['user_type'] == 1):?>selected<?php endif;?>>推广员</option>
<option value="2" <?php if ($account['user_type'] == 2):?>selected<?php endif;?>>玩家</option>
</select>
<input type="text" class="txt table_text_input" name="account[]" value="{$account['account']}" placeholder="账号">
<button type="button" class="bnt_add"></button>
</li>
<?php else:?>
<li class="user-account">
<label>涉及账号</label>
<select name="user_type[]" class="select_gallery user_type" onchange="userAccountChange(this)">
<option value="1" <?php if ($account['user_type'] == 1):?>selected<?php endif;?>>推广员</option>
<option value="2" <?php if ($account['user_type'] == 2):?>selected<?php endif;?>>玩家</option>
</select>
<input type="text" class="txt table_text_input" name="account[]" value="{$account['account']}" placeholder="账号">
<button type="button" class="bnt_remove"></button>
</li>
<?php endif;?>
<?php endforeach;?>
<?php else:?>
<li class="user-account">
<label>涉及账号</label>
<select name="user_type[]" class="select_gallery user_type" onchange="userAccountChange(this)">
<option value="1">推广员</option>
<option value="2">玩家</option>
</select>
<input type="text" class="txt table_text_input" name="account[]" value="" placeholder="账号">
<button type="button" class="bnt_add"></button>
</li>
<?php endif;?>
<li>
<label>游戏</label>
<select id="relation_game_id" name="relation_game_id" class="select_gallery">
<?php foreach ($games as $game):?>
<option value="{$game['relation_game_id']}" <?php if ($game['relation_game_id'] == $data['relation_game_id']):?>selected<?php endif;?> >{$game['relation_game_name']}</option>
<?php endforeach;?>
</select>
</li>
<li>
<label>事件</label>
<textarea name="content" class="" placeholder="事件" >{$data.content}</textarea>
</li>
<li>
<label>金额</label>
<input name="money" type="text" class="" placeholder="金额" value="{$data.money}" />
</li>
<li>
<label>备注</label>
<textarea name="remark" class="" placeholder="备注" >{$data.remark}</textarea>
</li>
<li>
<label>&nbsp;</label><input type="submit" id="submit" value="确认保存" target-form="form-horizontal" class="form_btn">
<input type="button" value="返 回" target-form="form-horizontal" class="form_btn ajax-post" onclick="javascript:void(window.history.go(-1))">
</li>
</ul>
</form>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="AuthManager/index">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script type="text/javascript">
highlight_subnav('{:U('StatementMangement/rewardManageList')}');
$(".bnt_add").bind("click",function(){
var a= '<li class="user-account"><label>涉及账号</label><select name="user_type[]" class="select_gallery user_type" onchange="userAccountChange(this)"><option value="1">推广员</option><option value="2">玩家</option></select><input type="text" class="txt table_text_input" name="account[]" value="" placeholder="账号"><button type="button" class="bnt_remove"></button>';
$(".user-account:last").after(a);
});
$(document).on('click', '.bnt_remove', function(){
$(this).parents('li').remove();
});
var company_id = '{$data["company_id"]}';
function companyTypeChange()
{
var companyType = $('#company_type').val();
$.ajax({
url:"{:U('StatementMangement/getCompanys')}",
dataType:'JSON',
data: {'type':companyType},
success:function(response){
var companyData = '';
$.each(response.info, function(index, item){
if (company_id == item.id) {
companyData += "<option value='"+item.id+"' selected >"+item.name+"</option>";
} else {
companyData += "<option value='"+item.id+"' >"+item.name+"</option>";
}
});
$('#company_id').html(companyData);
}
});
}
companyTypeChange();
</script>
</block>

@ -1455,3 +1455,21 @@ function getPromoteWithdrawSettlementType($type = null)
return Admin\Model\WithdrawModel::$settlementTypeList;
}
}
//获取推广公司列表
function getPromoteCompanys()
{
return M('promote_company', 'tab_')->field('id, company_name')->where(['status' => 1])->select();
}
function getPromoteCompanyName($companyId)
{
$companyName = M('promote_company', 'tab_')->where(['id' => $companyId])->getField('company_name');
return $companyName ?? '未知';
}
function getGameTypes()
{
return M('game_type', 'tab_')->field('id, type_name')->where(['status' => 1])->select();
}

@ -1106,6 +1106,30 @@ ADD COLUMN `can_view_recharge` tinyint(1) NOT NULL default 0 COMMENT '是否显
ALTER TABLE `tab_cp_game_ratio`
ADD COLUMN `instanceof` tinyint(2) NOT NULL DEFAULT 1 COMMENT '运算符1:>= ; 2:>' AFTER `game_id`;
-- 2020-02-04
ALTER TABLE `tab_promote`
ADD COLUMN `auto_review_withdraw_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '提现自动审核状态0-关闭 1-开启';
ALTER TABLE `tab_promote`
ADD COLUMN `auto_review_withdraw_updated_time` int(10) NOT NULL DEFAULT 0 COMMENT '提现自动审核状态更新时间';
ALTER TABLE `tab_promote`
ADD INDEX `auto_review_withdraw_status`(`auto_review_withdraw_status`) USING BTREE;
-- 奖罚记录
CREATE TABLE `tab_reward_record` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`reward_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '奖罚类型 1奖励 2惩罚',
`company_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '公司类型 1上游公司 2下游公司',
`company_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '公司ID 当公司类型为上游CP公司时展示合作方管理下的公司反之展示推广公司管理下的公司',
`accounts` json NOT NULL,
`relation_game_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏id',
`content` varchar(1000) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '事件内容',
`money` double(11,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '金额',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`creater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE `tab_company_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`partner` varchar(60) NOT NULL COMMENT '合作方名称',

Loading…
Cancel
Save