解决冲突

master
ELF 5 years ago
commit ed25d54dc8

@ -1865,7 +1865,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
foreach ($data['statement_info'] as $key => $value) {
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1)->mergeCells("J$line:K$line");
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']);
if ($value['statement_type'] == 1) {//罚款
if ($value['statement_type'] > 0) {//罚款
$product_name = $value['type_name'];
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line , '-');
$objPHPExcel->getActiveSheet()->setCellValue('G'.$line, '-');
@ -1950,7 +1950,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->removeConditionalStyles();
$objPHPExcel->getActiveSheet()->setCellValue('A'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']);
if ($value['statement_type'] == 1) {//罚款
if ($value['statement_type']>0) {//罚款
$product_name = $value['type_name'];
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, '-');
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, '-');
@ -2018,10 +2018,23 @@ function getWithdrawNumber() {
//上有流水计算
function caculateUpstream($game_id,$pay_amount) {
$data = M('cp_game_ratio','tab_')
$ladderData = M('cp_game_ratio','tab_')
->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$pay_amount],'is_del'=>0])
->order('begin_total_amount Desc')
->find();
->limit(0,2)
->order('begin_total_amount desc')
->select();
foreach($ladderData as $key => $value) {
if ($value['instanceof'] == 1 && $value['begin_total_amount'] <= $pay_amount
|| $value['instanceof'] == 2 && $value['begin_total_amount'] != $pay_amount ) {
$data['ratio'] = $value['ratio'];
break;
} else {
$data['ratio'] = $value['ratio'];
}
}
return number_format($pay_amount*($data['ratio']/100),2,'.','');

@ -270,9 +270,18 @@ class AjaxController extends ThinkController{
$statementData = json_decode($getStatementData['statement_info'],true);
$reward = 0;
$forfeit = 0;
if ($statementData) {
$data['sum'] = $getStatementData['statement_money'];
$data['pay_amount'] = $getStatementData['pay_amount'];
$data['reward'] = 0;
$data['forfeit'] = 0;
$handleStatementData = [];
foreach ($statementData as $key=>$sv) {
if ($sv['game_id']) {
@ -287,9 +296,15 @@ class AjaxController extends ThinkController{
$handleStatementData[$sv['game_id']][] = $nowVal;
} else {
$data['forfeit'] = $sv['sum_money'];
if ($sv['statement_type'] == 2) {
$data['reward'] += $sv['sum_money'];
} else if ($sv['statement_type'] == 1) {
$data['forfeit'] += $sv['sum_money'];
}
}
}
// dump($handleStatementData);die();
$first_party_info = json_decode($getStatementData['first_party_info'],true);
$second_party_info = json_decode($getStatementData['second_party_info'],true);
$data['game_ratio'] = $handleStatementData;
@ -345,11 +360,21 @@ class AjaxController extends ThinkController{
if (!in_array($v['game_name'],$gameStr)) {
array_push($gameStr,$v['game_name']);
} else {
$game_ratio[$v['game_name']] = $v;
unset($data['game_ratio'][$key]);
// var_dump($key);
if (!$game_ratio[$v['game_name']]) {
$game_ratio[$v['game_name']] = $v;
}
else {
$game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount'];
}
unset($value[$k]);
}
}
if (!$value) {
unset($data['game_ratio'][$key]);
}
}
// dump($data['game_ratio']);die();
@ -358,6 +383,32 @@ class AjaxController extends ThinkController{
foreach ($value as $k => &$v) {
$startTime = strtotime($v['begin_time']);
$endTime = strtotime($v['end_time']);
$rewardData = M('reward_record','tab_')
->field("sum(tab_reward_record.money) as money,reward_type")
->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id")
->where(['company_type'=>2,'relation_game_name'=>['like',"%{$v['game_name']}%"],'company_id'=>$data['company_id'],'reward_time'=>['between',[$startTime,$endTime]]])
->group('reward_type')
->select();
foreach ($rewardData as $key => $valReward) {
if ($valReward['reward_type']==1) {
$reward = $reward + $valReward['money'];
} else if ($valReward['reward_type']==2) {
$forfeit = $forfeit + $valReward['money'];
}
}
// dump($reward);die();
if ($game_ratio[$v['game_name']]) {
$v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.','');
@ -370,6 +421,9 @@ class AjaxController extends ThinkController{
}
$data['reward'] = $reward;
$data['forfeit'] = $forfeit;
$yfData = M('tool','tab_')->where(['name'=>'company_info'])->find();
$yfData = json_decode($yfData['config'],true);

@ -1054,87 +1054,108 @@ class ExportController extends Controller
break;
case 7:
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', '%' . trim($_REQUEST['user_account']) . '%');
$map['user_account'] = array('like', trim($_REQUEST['user_account']));
unset($_REQUEST['user_account']);
}
if (isset($_REQUEST['spend_ip'])) {
$map['spend_ip'] = array('like', '%' . trim($_REQUEST['spend_ip']) . '%');
$map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%');
unset($_REQUEST['spend_ip']);
}
if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) {
$map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1));
unset($_REQUEST['time-start']);
unset($_REQUEST['time-end']);
}
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1));
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
}
if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) {
$map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['start']), strtotime($_REQUEST['end']) + 24 * 60 * 60 - 1));
unset($_REQUEST['start']);
unset($_REQUEST['end']);
}
if(isset($_REQUEST['game_name'])){
if($_REQUEST['game_name']=='全部'){
if (isset($_REQUEST['game_name'])) {
if ($_REQUEST['game_name'] == '全部') {
unset($_REQUEST['game_name']);
}else{
$map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
} else {
$map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
unset($_REQUEST['game_name']);
}
}
if(isset($_REQUEST['server_name'])){
$map['tab_spend.server_name']=$_REQUEST['server_name'];
unset($_REQUEST['server_name']);
if (isset($_REQUEST['game_type']) && $_REQUEST['game_type']) {
$map['sdk_version'] = $_REQUEST['game_type'];
}
if (isset($_REQUEST['server_id'])) {
$map['server_id'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
if (isset($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = array('like', '%' . trim($_REQUEST['pay_order_number']) . '%');
$map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number']));
unset($_REQUEST['pay_order_number']);
}
if (isset($_REQUEST['extend'])) {
$map['extend'] = array('like', trim($_REQUEST['extend']));
unset($_REQUEST['extend']);
}
if (isset($_REQUEST['pay_status'])) {
$map['pay_status'] = $_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
}
if (isset($_REQUEST['pay_way'])) {
$map['pay_way'] = $_REQUEST['pay_way'];
unset($_REQUEST['pay_status']);
if ($_REQUEST['pay_way'] == 2) {
$map['pay_way'] = ['in', '2,3,4'];
} else {
$map['pay_way'] = $_REQUEST['pay_way'];
}
unset($_REQUEST['pay_way']);
}
if (isset($_REQUEST['pay_game_status'])) {
$map['pay_game_status'] = $_REQUEST['pay_game_status'];
unset($_REQUEST['pay_game_status']);
}
// $promoteRoot = getPowerPromoteIds();
// $data_empower_type = session('user_auth')['data_empower_type'];
// $promoteRoot = getPowerPromoteIds();
// $data_empower_type = session('user_auth')['data_empower_type'];
//
// if ($promoteRoot) {
// $map['promote_id'] =array('in',$promoteRoot);
// } else if(!$promoteRoot&&$data_empower_type!=1){
// $map['id'] = array('lt',1);
// }
// if ($promoteRoot) {
// $map['promote_id'] =array('in',$promoteRoot);
// } else if(!$promoteRoot&&$data_empower_type!=1){
// $map['id'] = array('lt',1);
// }
setPowerPromoteIds($map,'promote_id');
if(isset($_REQUEST['promote_id'])) {
if ($_REQUEST['promote_id'] == 0) {
if (isset($_REQUEST['promote_id'])) {
$promoteId = intval($_REQUEST['promote_id']);
if ($promoteId == 0) {
$map['promote_id'] = 0;
} else {
$map['_complex'] = ['tp.chain'=>['like', "%/{$_REQUEST['promote_id']}/%"], 'tp.id'=>$_REQUEST['promote_id'], '_logic' => 'or'];
$promoteMap['chain'] = ['like', "%/$promoteId/%"];
$promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
$tab_promote_join = "left join tab_promote as tp on tp.id = tab_spend.promote_id";
//unset($_REQUEST['promote_id']);
}
if ($_REQUEST['data_order'] != '') {
$data_order = reset(explode(',', $_REQUEST['data_order']));
$data_order_type = end(explode(',', $_REQUEST['data_order']));
$this->assign('userarpu_order', $data_order);
$this->assign('userarpu_order_type', $data_order_type);
$sort = $data_order == 3 ? 'desc' : 'asc';
$order = $data_order_type . ' ' . $sort;
} else {
$tab_promote_join = false;
$order = ' pay_time desc ';
}
// if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
// $map1 = $map;
// $map1['pay_status'] = 1;
// } else {
// $map = '1 = 2';
// $map1 = $map;
// }
$map1 = $map;
$map1['pay_status'] = 1;
$total = D('Spend')->where($map1)->join($tab_promote_join)->sum('pay_amount');
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$total = M('Spend','tab_')->where($map1)->sum('pay_amount');
// var_dump($total);die();
$total=$total?$total:0;
$xlsCell = array(
@ -1155,10 +1176,7 @@ class ExportController extends Controller
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = D('Spend')
->field('pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status')
->where($map)
->join($tab_promote_join)
->order('pay_time DESC')
->count();
$perSize = 10000;//每次查询的条数
@ -1167,15 +1185,21 @@ class ExportController extends Controller
// var_dump($count);die();
for($i = 1; $i <= $pages; $i++) {
$xlsData = D('Spend')
// ->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status')
// ->where($map)
// ->limit(($i-1)*$perSize ,$perSize)
// ->join($tab_promote_join)
// ->order('pay_time DESC')
// ->select();
->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status')
->where($map)
->limit(($i-1)*$perSize ,$perSize)
->join($tab_promote_join)
->order('pay_time DESC')
->order($order ? $order : 'pay_time desc')
->select();
foreach($xlsData as $value) {
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
$value['extend'] = $value['extend'].'`';
$value['pay_way'] = get_pay_way($value['pay_way']);
$value['pay_status'] = get_info_status($value['pay_status'],9);
$value['pay_game_status'] = get_info_status($value['pay_game_status'],14);
@ -7139,7 +7163,7 @@ class ExportController extends Controller
if (!empty(I('timestart'))) {
$timestart = strtotime(I('timestart'));
$map['_string'] = "s.pay_time > {$timestart}";
$map['_string'] = "s.pay_time >= {$timestart}";
}
if (!empty(I('timeend'))) {

@ -241,6 +241,51 @@ class FileController extends AdminController
$this->ajaxReturn($return);
}
/**
* 上传图片
* @author huajie <banhuajie@163.com>
*/
public function uploadPictureNotLimit()
{
//TODO: 用户登录检测
/* 返回标准数据 */
$return = array('status' => 1, 'info' => '上传成功', 'data' => '');
/* 调用文件上传组件上传文件 */
$Picture = D('Picture');
$pic_driver = C('PICTURE_UPLOAD_DRIVER');
$info = $Picture->upload(
$_FILES,
C('PICTURE_UPLOAD'),
C('PICTURE_UPLOAD_DRIVER'),
C("UPLOAD_{$pic_driver}_CONFIG"),
$_REQUEST['flag']
); //TODO:上传到远程服务器
// 添加水印
// if ($_REQUEST['flag']) {
// $this->addWatermarkOnPic($info['download']);
// }
/* 记录图片信息 */
if ($info) {
$return['status'] = 1;
if (empty($info['download'])) {
$file = $info['file'];
} else {
$file = $info['download'];
}
$return = array_merge($file, $return);
} else {
$return['status'] = 0;
$return['info'] = $Picture->getError();
}
ob_clean();
/* 返回JSON数据 */
$this->ajaxReturn($return);
}
public function uploadDoc()
{

@ -17,6 +17,8 @@ use BaiduBce\Services\Bos\CannedAcl;
use BaiduBce\Services\Bos\BosOptions;
use BaiduBce\Auth\SignOptions;
use BaiduBce\Log\LogFactory;
use Admin\Model\AuthRuleModel;
use Admin\Model\AuthGroupModel;
use Base\Service\GameService;
/**
@ -301,9 +303,46 @@ class GameController extends ThinkController
}
}
public function delSociatyGames() {
$res = ['code' => 10000];
$id = $_REQUEST['id'];
$delRest = M('sociaty_games','tab_')->where(['id'=>$id])->delete();
if($delRest) {
$res['code'] = 10001;
$this->ajaxReturn($res);
}
}
public function edit($id = null)
{
if (IS_POST) {
if(!empty($_REQUEST['apply_auth'])) {
$gameData['apply_auth'] = $_REQUEST['apply_auth'];
$game_appid = $_REQUEST['game_appid'];
$gameId = M('game','tab_')->where(['game_appid' => $game_appid])->getField('id');
M('game','tab_')->where(['id'=>$gameId])->save($gameData);
if($_REQUEST['apply_auth'] == 1) {
M('sociaty_games','tab_')->where(['game_id'=>$gameId])->delete();
}
if(!empty($_REQUEST['promote_data'])) {
$promote_data = json_decode($_REQUEST['promote_data'],TRUE);
$game_appid = $_REQUEST['game_appid'];
$gameId = M('game','tab_')->where(['game_appid' => $game_appid])->getField('id');
$gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gameId])->select();
$dataList = array();
foreach($promote_data as $key => $promoteInfo) {
$isSociaty = M('sociaty_games','tab_')->where(['promote_id'=>intval($promoteInfo['value']),'game_id'=>intval($gameId)])->getField('id');
if(!empty($isSociaty)) {
// $this->error("选择会长中有已存在会长");
}else {
$dataList[] = ['promote_id' => intval($promoteInfo['value']),'game_id' => intval($gameId),'status'=>$gameInfo[0]['game_status'],'create_time'=>time()];
}
}
M('sociaty_games','tab_')->addAll($dataList);
}
// $_REQUEST['apply_auth'] == 1 ? $this->success('开放全部会长权限成功') : $this->success('设置会长权限成功');
}
if ($_POST['game_score'] < 0 || $_POST['game_score'] > 5) {
$this->error('游戏评分只能为0-5之间的数字');
exit;
@ -419,7 +458,30 @@ class GameController extends ThinkController
$data['icon_data'] = explode(',', $data['icon']);
}
$apply_auth = M('game','tab_')->where(['id'=>$id])->getField('apply_auth');
$this->assign('apply_auth',$apply_auth);
$sociatyGames = M('sociaty_games','tab_')->where(['game_id'=>$id])->select();
$sociatyGamesData = [];
if(!empty($sociatyGames)) {
foreach($sociatyGames as $key => $value) {
$sociatyGamesData[$key]['id'] = $value['id'];
if($value['promote_id'] == -1) {
$sociatyGamesData[$key]['promoteAccount'] = "官方渠道";
}else {
$promoteAccount = M('promote','tab_')->where(['id'=>$value['promote_id']])->getField('account');
$sociatyGamesData[$key]['promoteAccount'] = $promoteAccount;
}
$sociatyGamesData[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
$applyStatus = M('apply','tab_')->field('id')->where(['game_id'=>$value['game_id'],'status'=>1])->select();
if(empty($applyStatus)) {
$sociatyGamesData[$key]['isPromote'] = "否";
}else {
$sociatyGamesData[$key]['isPromote'] = "是";
}
}
}
$this->assign('sociatygames',$sociatyGamesData);
$data['introduction'] = str_replace("~~", "\r\n", $data['introduction']);
$this->assign('data', $data);
$this->assign('game_id', $id);
@ -430,6 +492,11 @@ class GameController extends ThinkController
$this->m_title = '游戏列表';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Game/lists', 'status' => 1])->find());
$this->assign('game_ratio',$game_ratio);
$auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) )
->getfield('id,id,title,rules');
$empower_type = M('AuthGroup')->field('data_empower_type')->where(array('id'=>1))->find();
$this->assign('data_empower_type', $empower_type['data_empower_type']);
$this->assign('auth_group', $auth_group);
$this->display();
}
}
@ -906,4 +973,92 @@ class GameController extends ThinkController
//M('cp_game_ratio', 'tab_')->where("id=".$_POST['data_id'])->data(array("is_del"=>"1","update_time"=>time()))->save();
echo(json_encode(array("result"=>"1","desc"=>"删除成功")));
}
public function uploadExcel1() {
Vendor("PHPExcel.PHPExcel");
$gid = $_REQUEST['game_id'];
if(@is_uploaded_file($_FILES['file']['tmp_name'])){
$upfile = $_FILES["file"];
$name = $upfile["name"];
$type = $upfile["type"];
$size = $upfile["size"];
$tmp_name = $upfile["tmp_name"];
$savePath = $_SERVER['DOCUMENT_ROOT'].__ROOT__.'/Uploads/Excel/';
move_uploaded_file($tmp_name,$savePath.$name);
$file_name = $savePath.$name;
$error=$upfile["error"];//上传后系统返回的值
$extension = strtolower( pathinfo($file_name, PATHINFO_EXTENSION) );
if($extension == 'xlsx') {
$objReader = \PHPExcel_IOFactory::createReader('excel2007');
}elseif($extension == 'csv') {
$objReader = \PHPExcel_IOFactory::createReader('csv');
}else {
$objReader = \PHPExcel_IOFactory::createReader('Excel5');//创建读取实例
}
$objPHPExcel = $objReader->load($file_name,$encode='utf-8');//加载文件
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$dataList = [];
$outPromote = []; //录入出错的会长
$outGame = []; //录入出错的游戏
$successAccount = [];
$keyPro = 0;
$keyGame = 0;
$keyData = 0;
for($i=2;$i<=$highestRow;$i++)
{
$promoteAccount = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue();
$promoteInfo = M('promote','tab_')->field('id')->where(['account' => $promoteAccount ])->find();
if($promote_id == -1) {$promoteInfo['account'] = "官方渠道"; }
if(empty($promoteInfo)) {
$outPromote[$keyPro]['promote_account'] = $promoteAccount;
$keyPro += 1;
}else {
$promote_id = $promoteInfo['id'];
}
$gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gid])->select();
$time = time();
$isSociaty = M('sociaty_games','tab_')->where(['promote_id'=>$promote_id,'game_id'=>$gid])->getField('id');
if(empty($isSociaty) && !empty($gameInfo) && !empty($promoteInfo)) {
$dataList[$keyData] = ['promote_id'=>$promote_id,'game_id'=>$gid,'status'=>$gameInfo[0]['game_status'],'create_time'=>$time];
$successAccount[$keyData] = ['account'=>$promoteAccount];
$keyData += 1;
}
}
$backData['outPromote'] = $outPromote;
$backData['datalist'] = $successAccount;
M('sociaty_games','tab_')->addAll($dataList);
$gameData['apply_auth'] = 2;
M('game','tab_')->where(['id'=>$gid])->save($gameData);
$this->ajaxReturn(json_encode($backData,TRUE));
}
}
function getRootPromote() {
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
$data_president = M('AuthGroup')->field('data_president')->where(array('id'=>1))->find();
$promoteData = array_merge([0=>['value'=>'-1','title'=>'官方渠道']],$promoteData);
$returnData = array('data_president'=>$data_president['data_president'],'list'=>$promoteData);
$this->ajaxReturn(json_encode($returnData));
}
//下载模板
public function downloadDemo() {
$game_id = $_REQUEST['game_id'];
$game_name = M('game','tab_')->where(['id'=>$game_id])->getField('game_name');
$data[] = [
'promoteid' => "官方渠道",
];
$field = array(
"promoteid"=>"会长账号",
);
data2csv($data,'【'.$game_name.'】'.'模板',$field);
}
}

@ -100,7 +100,7 @@ class PartnerController extends ThinkController
$this->error('合作方已存在');
}
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
if(!checkPhone(I('link_phone'))) {
$this->error('联系电话格式不正确');
}
$res2 = $model->where(['link_phone' => I('link_phone')])->getField('id');
@ -173,7 +173,7 @@ class PartnerController extends ThinkController
$this->error('合作方已存在');
}
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
if(!checkPhone(I('link_phone'))) {
$this->error('联系电话格式不正确');
}
$res2 = $model->where([

@ -1224,6 +1224,10 @@ class PromoteController extends ThinkController
$map['pb.can_view_recharge'] = I('can_view_recharge');
}
if (!is_null(I('company_type', null))) {
$map['pb.company_type'] = I('company_type');
}
if (!is_null(I('company_id', null))) {
$map['p.company_id'] = I('company_id');
}
@ -1266,7 +1270,7 @@ class PromoteController extends ThinkController
$this->display();
}
public function belong_add($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null)
public function belong_add($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null, $company_type = null)
{
if (IS_POST) {
if (empty($promote_id)) {
@ -1277,6 +1281,7 @@ class PromoteController extends ThinkController
'company_belong' => $company_belong,
'company_relation' => $company_relation,
'can_view_recharge' => $can_view_recharge,
'company_type' => $company_type,
'verify_status' => 0,
'remark' => $remark,
'applicant_id' => getAdmin(),
@ -1303,7 +1308,7 @@ class PromoteController extends ThinkController
}
}
public function belong_edit($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null)
public function belong_edit($promote_id=null, $company_belong = null, $company_relation = null, $remark = null, $can_view_recharge = null, $company_type = null)
{
if (IS_POST) {
if (empty($promote_id)) {
@ -1314,6 +1319,7 @@ class PromoteController extends ThinkController
'company_belong' => $company_belong,
'company_relation' => $company_relation,
'can_view_recharge' => $can_view_recharge,
'company_type' => $company_type,
'verify_status' => 0,
'remark' => $remark,
'applicant_id' => getAdmin(),
@ -1346,6 +1352,7 @@ class PromoteController extends ThinkController
'verify_status' => $verify_status,
'approver_id' => getAdmin(),
'approver_name' => getAdmin('username'),
'verify_time' => time()
]);
if (!is_null($res) ) {
if ($verify_status == 1) {//审核通过才修改推广员的归属关系
@ -1368,4 +1375,134 @@ class PromoteController extends ThinkController
}
public function certification()
{
if ($_POST) {
$promoteId = intval(I('post.id', 0));
if (empty($promoteId)) {
$this->error('参数异常');
}
$promote = D('promote')->field('real_name, idcard, mobile_phone')->where(array('id' => $promoteId))->find();
if (empty($promote)) {
$this->error('参数异常');
}
if (empty($promote['real_name']) || $promote['real_name'] != I('post.real_name', '')) {
if (empty($_POST['real_name'])) {
$this->error('真实姓名不能为空');
}
$save['real_name'] = I('post.real_name', '');
}
if (empty($promote['idcard']) || $promote['idcard'] != I('post.idcard', '')) {
if (empty($_POST['idcard'])) {
$this->error('身份证号码不能为空');
}
if(!is_idcard($_POST['idcard'])) {
$this->error('证件号码错误');
}
$save['idcard'] = I('post.idcard', '');
}
if (empty($promote['mobile_phone']) || $promote['mobile_phone'] != I('post.mobile_phone', '')) {
if (empty($_POST['mobile_phone'])) {
$this->error('手机号码不能为空');
}
$patternPhone = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($patternPhone, $_POST['mobile_phone'])) {
$this->error("手机号码格式不合法");
}
$save['mobile_phone'] = I('post.mobile_phone', '');
}
if (empty($_POST['idcarpic'])) {
$this->error('身份证证件照不能为空');
}
if (empty($_POST['s_province'])) {
$this->error('联系省份不能为空');
}
if (empty($_POST['s_city'])) {
$this->error('联系地级市不能为空');
}
if (empty($_POST['s_county'])) {
$this->error('联系市、县级市不能为空');
}
if (empty($_POST['s_address'])) {
$this->error('详细地址不能为空');
}
if (empty($_POST['email'])) {
$this->error('邮箱不能为空');
}
$patternEmail = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
if (!preg_match($patternEmail, $_POST['email'])) {
$this->error('邮箱地址错误');
}
if (empty($_POST['account_type'])) {
$this->error('账户类型不能为空');
}
if (empty($_POST['bank_name'])) {
$this->error('开户银行不能为空');
}
if (empty($_POST['bank_account'])) {
$this->error('银行户名不能为空');
}
$patternBankAccount = "/^[\x{4e00}-\x{9fa5}]{2,}$/u";
if (!preg_match($patternBankAccount, $_POST['bank_account'])) {
$this->error('银行卡开户人姓名错误');
}
if (empty($_POST['bank_card'])) {
$this->error('卡号不能为空');
}
$patternBankCard = "/^\d{10,19}$/u";
if (!preg_match($patternBankCard, $_POST['bank_card'])) {
$this->error('卡号格式错误');
}
$save['id'] = $promoteId;
$save['ver_status'] = 1;
$save['idcarpic'] = I('post.idcarpic', '');
$save['address'][] = I('post.s_province', '') . ',' . I('post.s_city', '') . ',' . I('post.s_county', '');
$save['address'][] = I('post.s_address', '');
$save['address'] = json_encode($save['address']);
$save['email'] = I('post.email', '');
$save['account_type'] = intval(I('post.account_type', 1));
$save['bank_name'] = I('post.bank_name', '');
$save['bank_account'] = I('post.bank_account', '');
$save['bank_card'] = I('post.bank_card', '');
if (isset($_POST['businesspic'])) {
$save['businesspic'] = I('post.businesspic', '');
}
if (isset($_POST['agreementpic'])) {
$save['agreementpic'] = I('post.agreementpic', '');
}
if (isset($_POST['anothpic'])) {
$save['anothpic'] = I('post.anothpic', '');
}
$result = D('promote')->save($save);
if ($result === false) {
$this->error('操作失败');
} else {
$this->success('操作成功');
}
} else {
$promoteId = intval(I('id', 0));
if ($promoteId <= 0) {
$this->error('参数错误');
}
$promote = D('promote')->where(array('id' => $promoteId))->find();
$promote['idcarpic_array'] = $promote['idcarpic'] ? explode(',', $promote['idcarpic']) : [];
$promote['businesspic_array'] = $promote['businesspic'] ? explode(',', $promote['businesspic']) : [];
$promote['agreementpic_array'] = $promote['agreementpic'] ? explode(',', $promote['agreementpic']) : [];
$promote['anothpic_array'] = $promote['anothpic'] ? explode(',', $promote['anothpic']) : [];
$promote['address'] = json_decode($promote['address'], true);
if (!empty($promote['address'])) {
foreach ($promote['address'] as &$address) {
$address = explode(',', $address);
}
}
$this->assign('records', $promote);
$this->assign('meta_title', '资质认证');
$this->display();
}
}
}

@ -346,7 +346,7 @@ class PublicController extends \Think\Controller
public function telsafecode($phone = '', $delay = 10, $flag = true)
{
$taskClient = new TaskClient();
$result = $taskClient->sendSmsCode($phone, get_client_ip());
$result = $taskClient->sendSms($phone, get_client_ip());
$data = [];
if ($result['code'] == TaskClient::SUCCESS) {
$data['status'] = 1;

@ -1007,6 +1007,7 @@ class QueryController extends ThinkController
{
$page = I('p', 1);
$row = I('row', 10);
$reviewTypeList = WithdrawModel::$reviewTypeList;
$map['_string'] = '1=1';
$adminid = C('USER_ADMINISTRATOR');//获取超管id
$adminmobile = M('UcenterMember')->field('mobile')->find($adminid);
@ -1023,6 +1024,9 @@ class QueryController extends ThinkController
if (isset($_REQUEST['settlement_type'])) {
$map['settlement_type'] = $_REQUEST['settlement_type'];
}
if (isset($_REQUEST['review_type'])) {
$map['review_type'] = $_REQUEST['review_type'];
}
if (isset($_REQUEST['promote_account'])) {
if ($_REQUEST['promote_account'] == '全部') {
unset($_REQUEST['promote_account']);
@ -1052,7 +1056,7 @@ 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';
$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, review_type';
$count = 0;
if (I('export', 0) == 1) {
$records = D('withdraw')->field($fields)
@ -1093,6 +1097,7 @@ class QueryController extends ThinkController
'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']),
'review_type_text' => $reviewTypeList[$record['review_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']),
@ -1118,6 +1123,7 @@ class QueryController extends ThinkController
'op_type_text' => '操作人类型',
'last_op_id_text' => '最后操作人',
'last_op_type_text' => '最后操作人类型',
'review_type_text' => '审核模式',
'settlement_type_text' => '提现模式',
'settlement_begin_time' => '结算开始时间',
'settlement_end_time' => '结算截止时间',
@ -1153,6 +1159,7 @@ class QueryController extends ThinkController
setPowerPromoteIds($map);
$companys = getPromoteCompanys();
$this->assign('companys', $companys);
$this->assign('reviewTypeList', $reviewTypeList);
$this->assign('is_admin', is_administrator());
$this->assign('list_data', $datas);
$this->display();
@ -1194,11 +1201,10 @@ class QueryController extends ThinkController
$this->ajaxReturn(['msg' => $msg]);
}
public function set_withdraw_status()
public function set_withdraw_status($status = 1)
{
$withdraw = M('withdraw', "tab_");
$ids = I('ids', 0);
$status = 1;
if (empty($ids)) {
$this->error('参数异常');
}
@ -1207,14 +1213,21 @@ class QueryController extends ThinkController
} else {
$map['id'] = $ids;
}
$map['status'] = 0;
switch ($status) {
case 1:
$map['status'] = 0;
break;
case 2:
$map['status'] = 1;
break;
}
$save['audit_time'] = time();
$save['status'] = $status;
$res = $withdraw->where($map)->save($save);
if ($res === false) {
$this->error('审核失败');
if ($res) {
$this->success('操作成功', U('withdraw'));
} else {
$this->success('审核成功', U('withdraw'));
$this->error('操作失败');
}
}
@ -1764,7 +1777,7 @@ class QueryController extends ThinkController
$records = [];
if (!empty($promotes)) {
foreach ($promotes as $promote) {
$promote['company_name'] = $companyList[$promote['company_id']] ?? '未知';
$promote['company_name'] = ($companyList[$promote['company_id']] ? $companyList[$promote['company_id']] : ($promote['company_id'] == 0 ? '万盟天下科技' : '未知'));
if ($promote['auto_review_withdraw_status'] == 0) {
$className = 'auto-closed';
$text = '关闭';

@ -18,8 +18,14 @@ class StatementController extends ThinkController
$first_party_info = json_decode($dbres['first_party_info'],true);
$second_party_info = json_decode($dbres['second_party_info'],true);
$statement_info = json_decode($dbres['statement_info'],true);
$fine = array_pop($statement_info);
if($dbres['company_name'] == $first_party_info['partner']){
$first_partner_type=0;
}else{
$first_partner_type=1;
}
// $fine = array_pop($statement_info);
$senddata = array(
"first_partner_type"=>$first_partner_type,
"first_part_company"=>$first_party_info['partner'],
"second_part_company"=>$second_party_info['partner'],
"statement_type"=>$_REQUEST['pay_type'] == 0 ? 1 :0,
@ -27,13 +33,13 @@ class StatementController extends ThinkController
"second_party_info"=>$second_party_info,
"statement_info"=>$statement_info,
"statement_count"=>array("sum_money"=>$dbres['statement_money'],"pay_amount"=>$dbres['pay_amount']),
"fine"=>$fine['sum_money'],
"fine"=>0,
"statement_begin_time"=>date("Y-m-d",$dbres['statement_begin_time']),
"statement_end_time"=>date("Y-m-d",$dbres['statement_end_time'])
);
$this->assign("data",$senddata);
if($_REQUEST['pay_type'] == 0){
$this->assign("company",$dbres['company_name']);
$this->assign("company",$second_party_info['partner']);
}else{
$this->assign("company",$first_party_info['partner']);
}
@ -56,15 +62,20 @@ class StatementController extends ThinkController
$this->ajaxReturn(array("error"=>"database error","code"=>2000));
}
}
public function getCompanyList()
{
$data = array();
$data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select();
$data['cpCompany']= getPartner();
$this->ajaxReturn(array("success"=>$data,"code"=>2000));
}
//获取推广公司基础信息
public function getCpCompanyInfo()
{
$CompanyId = $_REQUEST['company_id'];
if($CompanyId == 0){
$mycompany = M("tool","tab_")->field("config")->where("name='company_info'")->find();
$info = json_decode($mycompany['config'],true);
$info['id'] = 0;
unset($info['status']);
$company_type = $_REQUEST['company_type'];
if($company_type == 'pt'){
$info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find();
}else{
$info = M("partner","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find();
}
@ -81,7 +92,8 @@ class StatementController extends ThinkController
$map["pay_status"] = 1;
$CompanyId = $_REQUEST['company_id']; //对账公司id
$statement_type = $_REQUEST['statement_type'];
$statement_type = $_REQUEST['statement_type'];//付款方
$first_partner_type = $_REQUEST['first_partner_type'];//甲方类型0cp,1pt
$is_month = false;//是否是月结判断,非月结无需梯度计算
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
@ -164,8 +176,14 @@ class StatementController extends ThinkController
// $redio = $ratiores[0]['ratio'];
// }
$redio = getGameCpRadio($v['game_id'],$v['pay_amount'],$is_month);//获取分成比例
$v['second_ratio'] = $redio;
$v['first_ratio'] = (100-$redio);
if($first_partner_type==0){
//甲方cp
$v['first_ratio'] = round($redio,2);
$v['second_ratio'] = round((100-$redio),2);
}else{
$v['second_ratio'] = round($redio,2);
$v['first_ratio'] = round((100-$redio),2);
}
if($statement_type == 0){
$v['sum_money'] = round($v['pay_amount']*$v['first_ratio']/100,2);
}else{
@ -180,6 +198,62 @@ class StatementController extends ThinkController
$v['statement_end_time']=$_REQUEST['time_end'];
$v['statement_type']=0;
}
//获取奖罚
$rrmap = array(
"reward_time" => ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]],
"company_type"=>1,
"company_id"=>$CompanyId
);
$rfres = M("RewardRecord","tab_")
->field("
IFNULL(SUM(CASE WHEN reward_type = 1 THEN money ELSE 0 END),0) as reward_count,
IFNULL(SUM(CASE WHEN reward_type = 2 THEN money ELSE 0 END),0) as fine_count
")
->where($rrmap)->find();
if($statement_type == 0 ){
//乙->甲 甲方cp
if($first_partner_type==0){
$reward_count = $rfres['reward_count']-0;
$fine_count = 0-$rfres['fine_count'];
}else{
$reward_count = 0-$rfres['reward_count'];
$fine_count = $rfres['fine_count']-0;
}
}else{
if($first_partner_type==0){
$reward_count = 0-$rfres['reward_count']-0;
$fine_count = $rfres['fine_count']-0;
}else{
$reward_count = $rfres['reward_count']-0;
$fine_count = 0-$rfres['fine_count'];
}
}
if($rfres['reward_count'] > 0){
$list[] = array(
"statement_begin_time"=>$_REQUEST['time_start'],
"statement_end_time"=>$_REQUEST['time_end'],
'statement_type'=>2,
"game_name"=>"奖励",
'pay_amount'=>$reward_count,
'sum_money'=>$reward_count,
);
$countarr['pay_amount'] +=$reward_count;
$countarr['sum_money']+=$reward_count;
}
if($rfres['fine_count'] > 0){
$list[] = array(
"statement_begin_time"=>$_REQUEST['time_start'],
"statement_end_time"=>$_REQUEST['time_end'],
'statement_type'=>1,
"game_name"=>"罚款",
'pay_amount'=>$fine_count,
'sum_money'=>$fine_count,
);
$countarr['pay_amount'] += $fine_count;
$countarr['sum_money'] += $fine_count;
}
$countarr['pay_amount'] = round($countarr['pay_amount'],2);
$countarr['sum_money'] = round($countarr['sum_money'],2);
@ -188,19 +262,26 @@ class StatementController extends ThinkController
}
//添加数据
public function doAddCpStatement($id = 0){
$first_partner_type = $_REQUEST['first_partner_type'];
if($first_partner_type == 0){
//甲方cp
$company = $_REQUEST['first_party_info'];
}else{
$company =$_REQUEST['second_party_info'];
}
$second_party_info = $_REQUEST['second_party_info'];
$statement_info = $_REQUEST['statement_info'];
$statement_info[] = array(
"sum_money"=>$_REQUEST['fine'],
"type_name"=>"罚款",
"statement_type"=>1
);
// $statement_info[] = array(
// "sum_money"=>$_REQUEST['fine'],
// "type_name"=>"罚款",
// "statement_type"=>1
// );
//拼凑数据
$adddata = array(
"statement_type"=>0,
"company_id"=>$second_party_info['id'],
"company_name"=>$second_party_info['partner'],
"link_phone"=>$second_party_info['link_phone'],
"company_id"=>$company['id'],
"company_name"=>$company['partner'],
"link_phone"=>$company['link_phone'],
"statement_begin_time"=>strtotime($_REQUEST['statement_begin_time']),
"statement_end_time"=>strtotime($_REQUEST['statement_end_time']),
'create_time'=>time(),

@ -233,6 +233,18 @@ class StatementMangementController extends ThinkController
public function rewardManageList($row = 10, $p = 1)
{
$map = [];
if (!empty(I("game_name"))) {
$game_ids = array_column(getGameByName(I("game_name")), 'id');
if ($game_ids) {
$map['relation_game_id'] = ['in', $game_ids];
}
}
if (!empty(I('partner_id'))) {
$map['company_id'] = I('partner_id');
}
if (!empty(I('account'))) {
$map['accounts'] = ['like', '%' . I('account') . '%'];
}
$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');
@ -313,6 +325,9 @@ class StatementMangementController extends ThinkController
$data['accounts'] = json_decode($data['accounts'], true) ?: [];
$this->assign('data', $data);
}
} else {
$data['reward_time'] = strtotime(date('Y-m-01'));
$this->assign('data', $data);
}
$this->display();
}
@ -331,4 +346,103 @@ class StatementMangementController extends ThinkController
return $this->success($data, '', true);
}
public function PersonOrderList() {
$map = [];
$data = M('withdraw','tab_')
->field("tab_withdraw.id,pc.company_name,pc.id as cid,tab_withdraw.promote_id,tab_withdraw.promote_account,username,'个人' as type,game_ratio
,mobile_phone,real_name,tab_promote.bank_card,account_openin,tab_promote.address,bank_account")
->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id')
->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field")
->join("left join tab_promote on tab_promote.id=tab_promote_belong.promote_id")
->join("left join tab_promote_company as pc on pc.id = tab_promote.company_id")
->join("left join sys_ucenter_member on sys_ucenter_member.id=tab_promote.admin_id")
->where("ext_field is null and tab_promote_belong.company_type=2")
->where($map)
->select();
$gameStr = [];
$game_ratio = [];
foreach($data as $dkey => &$dval) {
$dval['game_ratio'] = json_decode($dval['game_ratio'],true);
if (is_array($dval['game_ratio'])) {
foreach ($dval['game_ratio'] as $key => &$value) {
foreach ($value as $k => &$v) {
// $v['game_id'] = $key;
$v['game_name'] = substr(get_gamename($key),0,strpos(get_gamename($key), '('));
if (!in_array($v['game_name'],$gameStr)) {
array_push($gameStr,$v['game_name']);
} else {
// var_dump($key);
if (!$game_ratio[$v['game_name']]) {
$game_ratio[$v['game_name']] = $v;
}
else {
$game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount'];
}
unset($value[$k]);
}
//
}
if (!$value) {
unset($dval['game_ratio'][$key]);
}
}
foreach ($dval['game_ratio'] as $key => $val) {
$startTime = strtotime($val[0]['begin_time']);
$endTime = strtotime($val[0]['end_time']);
$rewardData = M('reward_record','tab_')
->field("sum(tab_reward_record.money) as money,reward_type,relation_game_name")
->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id")
->where(['company_type'=>2,'relation_game_name'=>['like',"%{$val[0]['game_name']}%"],'reward_time'=>['between',[$startTime,$endTime]]])
->group('reward_type')
->select();
foreach ($rewardData as $rk => $rv) {
if ($rv['reward_type'] == 1) {
$val[0]['reward'] = $rv['money'];
} else {
$val[0]['forfeit'] = $rv['money'];
}
}
foreach ($val as $k => &$v) {
if ($game_ratio[$v['game_name']]) {
$v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.','');
}
}
unset($dval['game_ratio'][$key]);
array_push($dval['game_ratio'],$val[0]);
}
}
}
dump($data);
$this->display();
}
}

@ -28,6 +28,13 @@ class ToolController extends ThinkController {
$map_['name']=array("in",'wei_xin,wei_xin_app,weixin');
M('tool','tab_')->where($map_)->setField('status','0');
}
if (!is_numeric($config['channel_rate'])) {
$this->error('请输入正确的渠道费率');
}
if ($config['channel_rate'] > 100) {
$this->error('渠道费率最大值为100%');
}
$config['channel_rate'] = round($config['channel_rate'], 2);
$flag = M('Tool','tab_')->where($map)->setField($data);
if($flag !== false){
$config['status']=$_POST['status'];

@ -26,6 +26,10 @@ class WithdrawModel extends Model{
const SETTLEMENT_TYPE_RECOUP = 3;
const SETTLEMENT_TYPE_OTHER = 9;
//审核模式
const REVIEW_TYPE_MANUAL = 1;
const REVIEW_TYPE_AUTO = 2;
/**
* 构造函数
* @param string $name 模型名称
@ -51,6 +55,11 @@ class WithdrawModel extends Model{
self::SETTLEMENT_TYPE_RECOUP => '补点',
self::SETTLEMENT_TYPE_OTHER => '其他',
];
public static $reviewTypeList = [
self::REVIEW_TYPE_MANUAL => '人工审核',
self::REVIEW_TYPE_AUTO => '自动审核',
];
/*
* 开发者提现未处理列表
@ -193,7 +202,13 @@ class WithdrawModel extends Model{
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
if ($promote['auto_review_withdraw_status'] == 1) {
$add['status'] = 1;
$add['review_type'] = 2;
} else {
$add['status'] = 0;
$add['review_type'] = 1;
}
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(1);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
@ -329,7 +344,13 @@ class WithdrawModel extends Model{
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
if ($promote['auto_review_withdraw_status'] == 1) {
$add['status'] = 1;
$add['review_type'] = 2;
} else {
$add['status'] = 0;
$add['review_type'] = 1;
}
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(2);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
@ -447,7 +468,13 @@ class WithdrawModel extends Model{
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
if ($promote['auto_review_withdraw_status'] == 1) {
$add['status'] = 1;
$add['review_type'] = 2;
} else {
$add['status'] = 0;
$add['review_type'] = 1;
}
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(3);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;

@ -44,6 +44,7 @@
<li data-tab="tab3" ><a href="javascript:void(0);">参数配置</a></li>
<li data-tab="tab4" ><a href="javascript:void(0);">H5分享页面</a></li>
<li data-tab="tab5" ><a href="javascript:void(0);">用户等级设置</a></li>
<li data-tab="tab6" ><a href="javascript:void(0);">推广配置</a></li>
</ul>
<h3 class="page_title">编辑游戏【{$data.relation_game_name}】</h3>
<p class="description_text">说明:查看和编辑游戏的基础信息、下载设置、参数信息等。</p>
@ -923,7 +924,92 @@
<tbody>
</table>
</div>
<!--推广配置-->
<div id="tab6" class="tab-pane tab6 ">
<input type="button" id="addpromote" onclick="addPromote()" style="background: #3E96C9;color:white;border:none;outline: none;width:90px;height:30px;border-radius: 3px;" value="添加" />
<div class="data_list data_game_list" id="addpromoteindex" style="margin-top:20px;">
<div class="">
<table>
<thead>
<tr>
<th>会长账号</th>
<th>添加时间</th>
<th>是否已进行推广</th>
<th style="width:10%;min-width:150px;">操作</th>
</tr>
</thead>
<tbody>
<if condition="$apply_auth eq 2">
<empty name ="sociatygames">
<td colspan="14" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="sociatygames" id="data">
<tr>
<td>{$data['promoteAccount']}</td>
<td>{$data['create_time']}</td>
<td>{$data['isPromote']}</td>
<td class="" style="color:red"><a href="javascript:void()" onclick="del({$data['id']})">移除</a></td>
</tr>
</volist>
</empty>
<else/>
<td colspan="14" class="text-center">该游戏未设置会长权限,现面对所有会长开放!</td>
</if>
</tbody>
</table>
</div>
</div>
<table border="0" cellspacing="0" cellpadding="0" id="promoteset" style="display:none">
<tbody >
<tr style="display:block;width:600px;" >
<td class="l">推广限制</td>
<td class="r" >
<input type="radio" class="inp_radio js-device js-devices{$key}" value="0" id="all" name="apply_auth" checked> 全部会长可申请
<input type="radio" class="inp_radio js-device js-devices{$key}" value="0" id="part" name="apply_auth" style="margin-left:20px"> 部分会长可申请
</td>
</tr>
<tr style="display:none;width:600px;" id="addtype">
<td class="l" >添加方式</td>
<td class="r" >
<input type="radio" class="inp_radio js-device js-devices{$key}" value="" id="excel" name="" checked> EXCEL导入
<input type="radio" class="inp_radio js-device js-devices{$key}" value="" id="partchoose" name="" style="margin-left:20px"> 批量选择
</td>
</tr>
<tr style="display:none" id="moban">
<td class="l">EXCEL模板</td>
<td class="r" >
<a href="{:U('downloadDemo',['game_id'=>$game_id])}">下载模板</a>
</td>
</tr>
<tr style="display:none" id="daoru">
<td class="l">导入模板</td>
<td class="r" >
<input type="file" name="upfile" id="file_excel" style="width:200px"/>
<input type="button" onclick="suba({$game_id})" style="background: #3E96C9;color:white;border:none;outline: none;width:70px;height:30px;border-radius: 3px;" value="导入" />
</td>
</tr>
</tbody>
</table>
<div class="data_list data_game_list" id="data_list"></div>
<link rel="stylesheet" type="text/css" href="__STATIC__/layui-v2.5.5/css/layui.css">
<input type="hidden" name="group_id" id="group_id" value="{$_GET['group_id']}">
<input type="hidden" name="promote_data" id="promote_data" value="[]">
<div id="transfer_promote" class="demo-transfer" style="margin-left: 100px;margin-top: 35px;display:none"></div>
</div>
<div class="form-item cf">
<input type="hidden" name='id' value="{$data['id']}" />
<input type="hidden" name='type' value="{$_GET['type']}" />
@ -952,7 +1038,198 @@
</block>
<block name="script">
<script src="__STATIC__/layui-v2.5.5/layui.all.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script>
var dataTransfer = '';
$.ajax({
url: "{:U('getRootPromote')}",
type: "post",
data: {group_id: 1},
dataType: 'json',
success: function (data) {
console.log(data,'datadadaa')
// datas = data;
layui.use(['transfer', 'layer', 'util'], function(){
var $ = layui.$
,transfer = layui.transfer
,layer = layui.layer
,util = layui.util;
var data1 =data;
if (JSON.parse(data1).data_president) {
var data2 = JSON.parse(data1).data_president.split(",");
}
// var dataTransfers = transfer.getData('key123');
// $('#promote_data').val(JSON.stringify(dataTransfers));
//显示搜索框
transfer.render({
elem: '#transfer_promote'
,data: JSON.parse(data1).list
,title: ['全部成员', '选中成员']
,showSearch: true,
value: data2,
id: 'key123',
onchange: function(data, index){
dataTransfer = transfer.getData('key123'); //获取右侧数据
// layer.alert(JSON.stringify(dataTransfer));
$('#promote_data').val(JSON.stringify(dataTransfer));
}
})
var dataTransfers = transfer.getData('key123');
$('#promote_data').val(JSON.stringify(dataTransfers));
transfets = transfer;
//批量办法定事件
util.event('lay-demoTransferActive', {
getData: function(othis){
var getData = transfer.getData('key123'); //获取右侧数据
layer.alert(JSON.stringify(getData));
}
});
});
}
});
</script>
<script type="text/javascript">
$("#part").click(function() {
var addtype = document.getElementById("addtype");
addtype.style.display = "block"
$("#part").attr('checked',true)
$("#all").attr('checked',false)
var moban = document.getElementById("moban");
moban.style.display = "block"
var daoru = document.getElementById("daoru");
daoru.style.display = "block"
document.getElementById('all').value = 1
document.getElementById('part').value = 2
})
$("#all").click(function() {
var addtype = document.getElementById("addtype");
addtype.style.display = "none"
$("#part").attr('checked',false)
$("#all").attr('checked',true)
$("#excel").attr('checked',true)
$("#partchoose").attr('checked',false)
var moban = document.getElementById("moban");
moban.style.display = "none"
var daoru = document.getElementById("daoru");
daoru.style.display = "none"
document.getElementById("transfer_promote").style.display = "none"
document.getElementById("data_list").style.display = "none"
document.getElementById('all').value = 1
document.getElementById('part').value = 2
})
$("#excel").click(function() {
var moban = document.getElementById("moban");
// addtype.style.display = "none"
$("#excel").attr('checked',true)
$("#partchoose").attr('checked',false)
moban.style.display = "block"
var daoru = document.getElementById("daoru");
daoru.style.display = "block"
document.getElementById('transfer_promote').style.display = "none"
document.getElementById("data_list").style.display = "block"
})
$("#partchoose").click(function() {
var moban = document.getElementById("moban");
// addtype.style.display = "none"
$("#excel").attr('checked',false)
$("#partchoose").attr('checked',true)
moban.style.display = "none"
var daoru = document.getElementById("daoru");
daoru.style.display = "none"
document.getElementById('transfer_promote').style.display = "block"
document.getElementById("data_list").style.display = "none"
})
function addPromote() {
var addpromoteindex = document.getElementById("addpromoteindex");
var addpromote = document.getElementById("addpromote");
var promoteset = document.getElementById("promoteset");
addpromoteindex.style.display = "none"
addpromote.style.display = "none"
promoteset.style.display = "block"
document.getElementById('all').value = 1
document.getElementById('part').value = 2
}
function del(id) {
var msg = "确认删除该项?"
if(confirm(msg) == true) {
$.ajax({
url:"{:U('Game/delSociatyGames')}",
dataType:'json',
type:'POST',
data:{'id':id},
success:function(res) {
console.log(res.code)
if(res.code == 10001) {
window.location.reload();
}
}
})
}
}
function suba(game_id) {
var file_excel = $('#file_excel')[0].files[0]
var formData = new FormData();
formData.append("file",file_excel);
formData.append("game_id",game_id)
$.ajax({
url:"{:U('Game/uploadExcel1')}",
dataType:'json',
type:'POST',
async:false,
data:formData,
processData : false, // 使数据不做处理
contentType : false, // 不要设置Content-Type请求头
success:function(res) {
document.getElementById('data_list').style.display = "block"
res = JSON.parse(res)
var datalist = res.datalist
var outPromote = res.outPromote
if(datalist.length > 0) {
html = '<div class="" style="width:500px"><table><thead><tr><th>录入成功会长账号</th></tr></thead><tbody>'
datalist.forEach(v=>{
html += '<tr><td>'+v['account']+'</td></tr>';
})
}else {
html = '<div class="" style="width:500px"><table><thead><tr><th>录入成功会长账号</th></tr></thead><tbody>'
+'<tr><td colspan="14" class="text-center">aOh! 暂无账号录入!</td></tr>'
}
html += '</tbody></table></div>'
if(outPromote.length > 0) {
html += '<div class="" style="width:500px"><table><thead><tr><th>录入失败会长账号</th></tr></thead><tbody>'
outPromote.forEach(p=>{
html += '<tr><td>'+p['promote_account']+'</td></tr>';
})
}else {
html += '<div class="" style="width:500px"><table><thead><tr><th>录入失败会长账号</th></tr></thead><tbody>'
+'<tr><td colspan="14" class="text-center">aOh! 暂无录入失败会长账号!</td></tr>>'
}
html += '</tbody></table></div>'
$("#data_list").html(html);
}
})
}
$('[name=shift_mode]').on({
click: function () {
if ($(this).val() == 2) {
$('#shift-transfer').show()
} else {
$('#shift-transfer').hide()
}
}
})
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Game/lists')}');
@ -2366,4 +2643,10 @@
});
</script>
<style>
.layui-transfer-box{
overflow: hidden;
height: 410px!important;
}
</style>
</block>

@ -81,6 +81,13 @@
<option value="1">只维护</option>
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="company_type">
<option value="">工会类型</option>
<option value="1">公司</option>
<option value="2">个人</option>
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="verify_status">
<option value="">审核状态</option>
@ -123,8 +130,10 @@
<th>身份状态</th>
<th>内外团</th>
<th>归属状态</th>
<th>工会类型</th>
<th>充值信息权限</th>
<th>申请时间</th>
<th>审核时间</th>
<th>备注</th>
<th>审核</th>
<th>申请人</th>
@ -200,6 +209,12 @@
<?php if(intval($data['company_belong']) == 1) {?>
<span>外团</span>
<?php }?>
<?php if(intval($data['company_belong']) == 2) {?>
<span>外团-分发联盟</span>
<?php }?>
<?php if(intval($data['company_belong']) == 3) {?>
<span></span>
<?php }?>
</td>
<td>
<?php if($data['company_relation'] == 0) {?>
@ -208,6 +223,17 @@
<?php if(intval($data['company_relation']) == 1) {?>
<span>只维护</span>
<?php }?>
<?php if(intval($data['company_relation']) == 2) {?>
<span></span>
<?php }?>
</td>
<td>
<?php if($data['company_type'] == 1) {?>
<span>公司</span>
<?php }?>
<?php if(intval($data['company_type']) == 2) {?>
<span>个人</span>
<?php }?>
</td>
<td>
<?php if($data['can_view_recharge'] == 0) {?>
@ -218,6 +244,7 @@
<?php }?>
</td>
<td>{:set_show_time($data['applicant_time'])}</td>
<td>{:set_show_time($data['verify_time'])}</td>
<td>{$data['remark']}</td>
<td>
<?php if($data['verify_status'] == 0) {?>

@ -63,33 +63,57 @@
<tr>
<td class="l">工会归属:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<span class="form_radio">
<label >
<input type="radio" value="3" name="company_belong" checked="checked" class="company_belong">
</label >
<label >
<input type="radio" value="0" name="company_belong" checked="checked" class="company_belong"> 内团
<input type="radio" value="0" name="company_belong" class="company_belong"> 内团
</label >
<label >
<input type="radio" value="1" name="company_belong" class="company_belong"> 外团
</label>
</span>
<!-- <span class="notice-text"></span>-->
</td>
</tr>
<tr id="company_relation">
<td class="l">工会关系:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label >
<input type="radio" value="0" name="company_relation" checked="checked"> 自主开发及维护
<input type="radio" value="2" name="company_belong" class="company_belong"> 外团-分发联盟
</label >
<label >
<input type="radio" value="1" name="company_relation" > 只维护
</label>
</span>
<!-- <span class="notice-text"></span>-->
</td>
</tr>
<tr id="company_relation">
<td class="l">工会关系:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label >
<input type="radio" value="2" name="company_relation" checked="checked">
</label >
<label >
<input type="radio" value="0" name="company_relation"> 自主开发及维护
</label >
<label >
<input type="radio" value="1" name="company_relation" > 只维护
</label>
</span>
<!-- <span class="notice-text"></span>-->
</td>
</tr>
<tr id="company_type">
<td class="l">工会类型:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label >
<input type="radio" value="1" name="company_type" checked="checked"> 公司
</label >
<label >
<input type="radio" value="2" name="company_type" > 个人
</label >
</span>
<!-- <span class="notice-text"></span>-->
</td>
</tr>
<tr id="can_view_recharge">
<td class="l">充值信息查看权限:</td>
<td class="r table_radio">

@ -64,7 +64,12 @@
<tr>
<td class="l">工会归属:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<span class="form_radio ">
<label >
<input type="radio" value="3" name="company_belong" <?php if($data['company_belong'] ==3):?>
checked="checked"
<?php endif?> class="company_belong"> 无
</label>
<label >
<input type="radio" value="0" name="company_belong" <?php if($data['company_belong'] ==0):?>
checked="checked"
@ -75,6 +80,11 @@
checked="checked"
<?php endif?> class="company_belong"> 外团
</label>
<label >
<input type="radio" value="2" name="company_belong" <?php if($data['company_belong'] ==2):?>
checked="checked"
<?php endif?> class="company_belong"> 外团-分发联盟
</label>
</span>
<!-- <span class="notice-text"></span>-->
</td>
@ -84,6 +94,11 @@
<td class="l">工会关系:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label >
<input type="radio" value="2" name="company_relation" <?php if($data['company_relation'] ==2):?>
checked="checked"
<?php endif?>> 无
</label>
<label >
<input type="radio" value="0" name="company_relation" <?php if($data['company_relation'] ==0):?>
checked="checked"
@ -100,6 +115,26 @@
</td>
</tr>
<tr id="company_type">
<td class="l">工会类型:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label >
<input type="radio" value="1" name="company_type" <?php if($data['company_type'] ==1):?>
checked="checked"
<?php endif?>> 公司
</label>
<label >
<input type="radio" value="2" name="company_type" <?php if($data['company_type'] ==2):?>
checked="checked"
<?php endif?>
> 个人
</label >
</span>
<!-- <span class="notice-text"></span>-->
</td>
</tr>
<tr id="can_view_recharge">
<td class="l">充值信息查看权限:</td>
<td class="r table_radio">

@ -0,0 +1,916 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/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">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<style>
.tabcon1711 input.time {
width: 150px;
}
#form .txt_area1 {
width: 300px;
height: 150px;
}
.tabcon1711 .form_unit {
margin-left: 2px;
}
.tabcon1711 .mustmark {
margin-left:-7px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #000;
line-height: 30px;
}
.select2-container--default .select2-selection--single {
border-radius: 4px;
height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 30px;
}
.tabcon1711 input[type=text]:read-only {
background: #CCCCCC;
}
.tabcon1711 .span-btn {
float: left;
margin-left: 30px;
height: 30px;
line-height: 30px;
color: #fff;
background-color: #3d96c8;
border: 0;
border-radius: 3px;
cursor: pointer;
align-content: center;
padding-left: 10px;
padding-right: 10px;
}
.tabcon1711 .edit-btn {
background-color: #3d96c8;
}
.tabcon1711 .cancel-btn {
background-color: #999;
display: none;
}
.tabcon1711 .edit-btn:hover {
background-color: #589dc8;
}
.tabcon1711 .cancel-btn {
background-color: #ababab;
}
</style>
<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="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('certification?model='.$model['id'])}" method="post" class="form-horizontal">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">会长账号:</td>
<td class="r">
<input type="text" class="txt" disabled="disabled" style="background: #CCCCCC;" value="{$records['account']|default=''}">
<span class="notice-text">通过推广员后台注册申请或者管理后台创建的账号</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>真实姓名:</td>
<td class="r">
<empty name="records['real_name']">
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}">
<else/>
<input type="text" class="txt" name="real_name" value="{$records['real_name']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>身份证号码:</td>
<td class="r">
<empty name="records['real_name']">
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}">
<else/>
<input type="text" class="txt" name="idcard" value="{$records['idcard']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo"><i class="mustmark">*</i>身份证照:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="idcarpic" value="{$records['idcarpic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="idcarpic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="idcarpic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">请上传身份证正反面图片为jpg、png格式(不超过2M)</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">营业执照:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="businesspic" value="{$records['businesspic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="businesspic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="businesspic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">如果是公司请上传营业执照</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">合作合同:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="agreementpic" value="{$records['agreementpic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="agreementpic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="agreementpic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">须上传平台与贵公司(工作室)签署的合作合同</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">补充认证:</td>
<td class="r">
<span class="table_btn table_upload" style="float: none;">
<input type="hidden" name="anothpic" value="{$records['anothpic']}" />
<div id="uploadImg" class="wu-example">
<div class="btns">
<div id="anothpic">上传图片</div>
</div>
<!--用来存放文件信息-->
<div id="anothpic_thelist" class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>电话:</td>
<td class="r">
<empty name="records['real_name']">
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}">
<else/>
<input type="text" class="txt" name="mobile_phone" value="{$records['mobile_phone']|default=''}" readonly="readonly">
<span class="span-btn edit-btn">修改</span>
<span class="span-btn cancel-btn">取消</span>
</empty>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>联系地址</td>
<td class="r1 table_select3">
<div class="info">
<div style="display: flex;">
<select id="s_province" name="s_province" class="select_gallery"></select>  
<select id="s_city" name="s_city" class="select_gallery" style="margin-left: 10px;"></select>  
<select id="s_county" name="s_county" class="select_gallery" style="margin-left: 10px;"></select>
<input type="text" class="txt" name="s_address" style="margin-left: 10px;width: 300px;" value="{$records['address'][1][0]|default=''}" placeholder="详细地址">
<script class="resources library" src="__STATIC__/provincecityarea/area1.js" type="text/javascript"></script>
<script type="text/javascript">
var pro ="{$records['address'][0]['0']|default=''}";
var city ="{$records['address'][0]['1']|default=''}";
var are ="{$records['address'][0]['2']|default=''}";
_init_area(pro, city, are);
</script>
</div>
<div id="show"></div>
</div>
<script type="text/javascript">
var showArea = function() {
$('#show').innerHTML = "<h3>省" + $('#s_province').value + " - 市" +
$('#s_city').value + " - 县/区" +
$('#s_county').value + "</h3>"
}
$('#s_county').attr('onchange', 'showArea()');
</script>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>邮箱:</td>
<td class="r">
<input type="text" class="txt" name="email" value="{$records['email']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>账户类型:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" value="1" name="account_type" <eq name="records['account_type']" value="1">checked="checked"</eq>>公司
</label >
<label>
<input type="radio" value="2" name="account_type" <eq name="records['account_type']" value="2">checked="checked"</eq>>个人
</label>
</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>开户银行:</td>
<td class="r">
<input type="text" class="txt" name="bank_name" value="{$records['bank_name']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>银行户名:</td>
<td class="r">
<input type="text" class="txt" name="bank_account" value="{$records['bank_account']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>银行账号:</td>
<td class="r">
<input type="text" class="txt" name="bank_card" value="{$records['bank_card']|default=''}">
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
</div>
<input type="hidden" name="id" id="id" value="{$records['id']|default=''}" />
<div class="form-item cf">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
审核
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</form>
</div>
</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/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 type="text/javascript">
//导航高亮
highlight_subnav("{:U('Promote/lists')}");
$(".select_gallery").select2();
$(function() {
showTab();
$('.edit-btn').click(function () {
var thisInput = $(this).prev();
thisInput.val('');
thisInput.removeAttr('readonly');
thisInput.focus();
$(this).hide();
$(this).next().show();
});
$('.cancel-btn').click(function () {
var thisInput = $(this).parent().children('input');
switch (thisInput.attr('name')) {
case 'real_name':
thisInput.val("{$records['real_name']}");
break;
case 'idcard':
thisInput.val("{$records['idcard']}");
break;
case 'mobile_phone':
thisInput.val("{$records['mobile_phone']}");
break;
}
thisInput.attr('readonly', 'readonly');
$(this).hide();
$(this).prev().show();
});
});
var userInfo = {userId:"kazaff", md5:"",icon:1}; //用户会话信息
</script>
<script>
var uploaderIdCarPic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPictureNotLimit', array('session_id'=>session_id(), 'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#idcarpic',
multiple:true
},
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:2,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgIdCarPicData = [];
var imgIdCarPicList = $("#idcarpic_thelist");
uploaderIdCarPic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imgIdCarPicList.append(html);
imgIdCarPicList.css('margin-top','10px');
var img2 = imgIdCarPicList.children('#'+file.id).find('img');
uploaderIdCarPic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img2.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderIdCarPic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderIdCarPic.on( 'uploadSuccess', function( file , response) {
imgIdCarPicData.push(Number(response.id));
setIconVal();
console.log(response)
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderIdCarPic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgIdCarPicData,function(index, item) {
if (response.id == item) {
imgIdCarPicData.splice(index,1);
return false;
}
});
setIconVal();
return false;
});
if (response.status == 1001) {
return false;
alert('图片大小不得超过2M');
$('#idcarpic_thelist').children().last().remove();
location.reload()
}
});
function setIconVal()
{
var icon = '';
$.each(imgIdCarPicData,function(index, item) {
icon += item + ',';
});
icon = icon.substring(0, icon.length - 1);
$('input[name=idcarpic]').val(icon);
}
<?php if (!empty($records['idcarpic_array'])) :?>
var html = '';
$('#idcarpic_thelist').css('margin-top','10px');
<?php foreach ($records['idcarpic_array'] as $value3) { ?>
<?php $value3 = (int)$value3; ?>
imgIdCarPicData.push(<?=$value3?>);
html += '<div id="' + <?=$value3?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value3,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value3?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#idcarpic_thelist').html(html);
$('#idcarpic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgIdCarPicData,function(index, item) {
if (thisId == item) {
imgIdCarPicData.splice(index,1);
return false;
}
});
setIconVal();
});
<?php endif ;?>
</script>
<script>
var uploaderImgbusinesspic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#businesspic',
multiple:true
},
// dnd: false,
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:5,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgListbusinesspicData = [];
var thisIndex1 = 0;
var imgbusinesspicList = $("#businesspic_thelist");
uploaderImgbusinesspic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imgbusinesspicList.append(html);
imgbusinesspicList.css('margin-top','10px');
var img1 = imgbusinesspicList.children('#'+file.id).find('img');
uploaderImgbusinesspic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img1.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderImgbusinesspic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderImgbusinesspic.on( 'uploadSuccess', function( file , response) {
imgListbusinesspicData.push(Number(response.id));
setbusinesspicVal();
console.log(response)
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderImgbusinesspic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgListbusinesspicData,function(index, item) {
if (response.id == item) {
imgListbusinesspicData.splice(index,1);
return false;
}
});
setbusinesspicVal();
return false;
});
});
function setbusinesspicVal()
{
var businesspic = '';
$.each(imgListbusinesspicData,function(index, item) {
businesspic += item + ',';
});
businesspic = businesspic.substring(0, businesspic.length - 1);
$('input[name=businesspic]').val(businesspic);
}
<?php if (!empty($records['businesspic_array'])) :?>
var html = '';
$('#businesspic_thelist').css('margin-top','10px');
<?php foreach ($records['businesspic_array'] as $value1) { ?>
<?php $value1 = (int)$value1; ?>
imgListbusinesspicData.push(<?=$value1?>);
html += '<div id="' + <?=$value1?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value1,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value1?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#businesspic_thelist').html(html);
$('#businesspic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgListbusinesspicData,function(index, item) {
if (thisId == item) {
imgListbusinesspicData.splice(index,1);
return false;
}
});
setbusinesspicVal();
});
<?php endif ;?>
</script>
<script>
var uploaderImgagreementpic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#agreementpic',
multiple:true
},
// dnd: false,
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:5,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgListagreementpicData = [];
var thisIndex1 = 0;
var imgagreementpicList = $("#agreementpic_thelist");
uploaderImgagreementpic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imgagreementpicList.append(html);
imgagreementpicList.css('margin-top','10px');
var img1 = imgagreementpicList.children('#'+file.id).find('img');
uploaderImgagreementpic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img1.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderImgagreementpic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderImgagreementpic.on( 'uploadSuccess', function( file , response) {
imgListagreementpicData.push(Number(response.id));
setagreementpicVal();
console.log(response);
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderImgagreementpic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgListagreementpicData,function(index, item) {
if (response.id == item) {
imgListagreementpicData.splice(index,1);
return false;
}
});
setagreementpicVal();
return false;
});
});
function setagreementpicVal()
{
var agreementpic = '';
$.each(imgListagreementpicData,function(index, item) {
agreementpic += item + ',';
});
agreementpic = agreementpic.substring(0, agreementpic.length - 1);
$('input[name=agreementpic]').val(agreementpic);
}
<?php if (!empty($records['agreementpic_array'])) :?>
var html = '';
$('#agreementpic_thelist').css('margin-top','10px');
<?php foreach ($records['agreementpic_array'] as $value1) { ?>
<?php $value1 = (int)$value1; ?>
imgListagreementpicData.push(<?=$value1?>);
html += '<div id="' + <?=$value1?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value1,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value1?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#agreementpic_thelist').html(html);
$('#agreementpic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgListagreementpicData,function(index, item) {
if (thisId == item) {
imgListagreementpicData.splice(index,1);
return false;
}
});
setagreementpicVal();
});
<?php endif ;?>
</script>
<script>
var uploaderImganothpic = WebUploader.create({
// 选完文件后,是否自动上传。
auto: true,
// swf文件路径
swf: '__STATIC__/webuploader/Uploader.swf',
// 文件接收服务端。
server: "{:U('File/uploadPicture',array('session_id'=>session_id(),'flag'=>true))}",
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id:'#anothpic',
multiple:true
},
// dnd: false,
paste: document.body,
accept: {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
disableGlobalDnd: true,
fileNumLimit:5,
threads:5,
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, userInfo);},
chunked:false,
duplicate: true
});
var imgListanothpicData = [];
var thisIndex1 = 0;
var imganothpicList = $("#anothpic_thelist");
uploaderImganothpic.on( 'fileQueued', function( file ) {
var html = '';
html += '<div id="' + file.id + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
imganothpicList.append(html);
imganothpicList.css('margin-top','10px');
var img1 = imganothpicList.children('#'+file.id).find('img');
uploaderImganothpic.makeThumb(file, function (error, src) {
if (error) {
return;
}
img1.attr('src', src);
}, 300, 300);
});
// 文件上传过程中创建进度条实时显示。
uploaderImganothpic.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css( 'width', percentage * 100 + '%' );
$percent.text( (percentage * 100).toFixed(0) + '%' );
});
uploaderImganothpic.on( 'uploadSuccess', function( file , response) {
imgListanothpicData.push(Number(response.id));
setanothpicVal();
console.log(response);
$( '#'+file.id ).find('p.state').text('已上传').fadeOut(800);
//alert(JSON.stringify(response));
$('#'+file.id).find('h4.info').append('<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
$('#'+file.id).find('.jsdelzip').on('click',function() {
uploaderImganothpic.removeFile( file.id );
$('#'+file.id).remove();
$.each(imgListanothpicData,function(index, item) {
if (response.id == item) {
imgListanothpicData.splice(index,1);
return false;
}
});
setanothpicVal();
return false;
});
});
function setanothpicVal()
{
var anothpic = '';
$.each(imgListanothpicData,function(index, item) {
anothpic += item + ',';
});
anothpic = anothpic.substring(0, anothpic.length - 1);
$('input[name=anothpic]').val(anothpic);
}
<?php if (!empty($records['anothpic_array'])) :?>
var html = '';
$('#anothpic_thelist').css('margin-top','10px');
<?php foreach ($records['anothpic_array'] as $value1) { ?>
<?php $value1 = (int)$value1; ?>
imgListanothpicData.push(<?=$value1?>);
html += '<div id="' + <?=$value1?> + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="<?=get_cover($value1,"path")?>" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info" style="text-align: center;">';
html += '<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;" img-id="' + <?=$value1?> + '">删除</a>';
html += '</h4>';
html += '<div class="progress progress-striped active" style="display: none;">';
html += '<div class="progress-bar" role="progressbar" style="width: 100%;">100%</div>';
html += '</div>';
html += '</div>';
<?php }?>
$('#anothpic_thelist').html(html);
$('#anothpic_thelist').children().children('h4').children('.jsdelzip').on('click', function() {
var thisId = $(this).attr('img-id');
$(this).parent().parent().remove();
$.each(imgListanothpicData,function(index, item) {
if (thisId == item) {
imgListanothpicData.splice(index,1);
return false;
}
});
setanothpicVal();
});
<?php endif ;?>
</script>
</block>

@ -219,9 +219,7 @@
<td>{$record.status_text}</td>
<td>{$record.respond}</td>
<td>
<if condition="$record['status'] eq 2">
<a href="{:U('downloadProve', ['id'=>$record['id']])}">汇款证明</a>
<elseif condition="$record['status'] eq -1"/>
<if condition="$record['status'] eq -1">
<span class="renew-review" data-id="{$record['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>
</if>
<if condition="$record['status'] eq -1 or $record['status'] eq 0">

@ -59,6 +59,7 @@
<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>
<a class="ajax-post" target-form="ids" url="{:U('set_withdraw_status', array('status' => 2))}" style="border: 1px solid #3C95C8;background-color: #3C95C8;background-image: initial"><span style="margin-left: 10px;float: initial;color: #fff;">确认汇款</span></a>
</div>
</div>
</empty>
@ -110,6 +111,14 @@
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<select name="review_type" class="select_gallery">
<option value="">审核模式</option>
<?php foreach ($reviewTypeList as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Query/withdraw','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
@ -138,6 +147,7 @@
<th>操作人类型</th>
<th>最后操作人</th>
<th>最后操作人类型</th>
<th>审核模式</th>
<th>提现模式</th>
<th>结算开始时间</th>
<th>结算截止时间</th>
@ -160,11 +170,11 @@
</php>
<tr>
<td>
<eq name="data.status" value="0">
<if condition="$data['status'] eq 0 or $data['status'] eq 1">
<input class="ids" type="checkbox" value="{$data['id']}" name="ids[]">
<else />
<else/>
<input class="ids disabled" disabled="disabled" type="checkbox" value="{$data['id']}" name="ids[]">
</eq>
</if>
</td>
<td>{$data.widthdraw_number}</td>
<td onclick="details('{$data["id"]}')"><span class="money_color">{$data.sum_money}</span></td>
@ -174,6 +184,7 @@
<td>{$data.op_type_text}</td>
<td>{$data.last_op_id_text}</td>
<td>{$data.last_op_type_text}</td>
<td>{$data.review_type_text}</td>
<td>{$data.settlement_type_text}</td>
<td>{$data.settlement_begin_time}</td>
<td>{$data.settlement_end_time}</td>
@ -187,7 +198,7 @@
<a class="ajax-get" url="{:U('set_withdraw_status',array('ids'=>$data['id']))}">通过</a>
<a class="agree" data-id="{$data['id']}">驳回</a>
<elseif condition="$data.status eq 1"/>
<a class="upload-transfer-proof" data-id="{$data['id']}">上传汇款证明</a>
<a class="ajax-get" url="{:U('set_withdraw_status',array('ids'=>$data['id'], 'status' => 2))}">确认汇款</a>
</if>
</div>
</td>

@ -89,16 +89,24 @@
<div class="tab-content tabcon1711" id="firstPartBaseInfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">公司类型:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_type" name="first_partner_type" class="select_gallery">
<option value="">请选择甲方公司类型</option>
<option value="0">CP上游公司</option>
<option value="1">平台归属公司</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l">甲方:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_id" name="partner_id" class="select_gallery">
<option value="">请选择合作公司</option>
<option value="0" selected>海南万盟天下科技有限公司</option>
<volist name=":getPartner()" id="vo">
<option partner-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</select>
</div>
</td>
@ -107,25 +115,25 @@
<tr>
<td class="l">联系人:</td>
<td class="r">
<input type="text" class="txt" name="link_man" value="" placeholder="请输入联系人">
<input type="text" class="txt" name="link_man" value="" disabled="disabled" placeholder="请先选择甲方公司">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="r">
<input type="text" class="txt" name="link_phone" value="" placeholder="请输入联系电话">
<input type="text" class="txt" name="link_phone" value="" disabled="disabled" placeholder="请先选择甲方公司">
</td>
</tr>
<tr>
<td class="l">邮寄地址:</td>
<td class="r">
<input type="text" class="txt" name="address" value="" placeholder="请输入地址">
<input type="text" class="txt" name="address" value="" disabled="disabled" placeholder="请先选择甲方公司">
</td>
</tr>
<tr>
<td class="l">公司税号:</td>
<td class="r">
<input type="text" class="txt" name="company_tax_no" value="" placeholder="请输入公司税号">
<input type="text" class="txt" name="company_tax_no" disabled="disabled" value="" placeholder="请先选择甲方公司">
</td>
</tr>
</tbody>
@ -135,16 +143,16 @@
<div class="tab-content tabcon1711" id="secondPartBaseInfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"></td>
<td class="r"></td>
</tr>
<tr>
<td class="l">乙方:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="second_partner_id" name="partner_id" class="select_gallery">
<option value="">请选择合作公司</option>
<option value="0">海南万盟天下科技有限公司</option>
<volist name=":getPartner()" id="vo">
<option partner-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</select>
</div>
</td>
@ -381,26 +389,26 @@
<script type="text/html" id="statementTpl">
{@each list as it,index}
<tr>
<td>${it.statement_begin_time}-${it.statement_end_time}</td>
<td>${it.statement_begin_time}~${it.statement_end_time}</td>
<td>${it.game_name}</td>
<td>${it.pay_amount}元</td>
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 30px;">%</td>
<td><input type="text" class="txt statementchange" name="second_ratio" data-index ="${index}" data-change="statement_info[${index}]['second_ratio']" value="${it.second_ratio}" style="width: 30px;">%</td>
<td><input type="text" class="txt statementchange" name="promote_ratio" data-index ="${index}" data-change="statement_info[${index}]['promote_ratio']" value="${it.promote_ratio}" style="width: 30px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="statement_info[${index}]['fax_ratio']" value="${it.fax_ratio}" style="width: 30px;">%</td>
{@if it.statement_type==0}
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="second_ratio" data-index ="${index}" data-change="statement_info[${index}]['second_ratio']" value="${it.second_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="promote_ratio" data-index ="${index}" data-change="statement_info[${index}]['promote_ratio']" value="${it.promote_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="statement_info[${index}]['fax_ratio']" value="${it.fax_ratio}" style="width: 40px;">%</td>
{@else}
<td></td>
<td></td>
<td></td>
<td></td>
{@/if}
<td>${it.sum_money}元</td>
</tr>
{@/each}
<tr>
<td></td>
<td>罚款</td>
<td><input type="text" class="txt statementchange" name="fine" data-change="fine" value="${fine}" style="width: 50px;"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>${fine}元</td>
</tr>
<tr>
<td>合计</td>
<td></td>
@ -438,7 +446,7 @@
})
EVENT.changeCompany();
EVENT.createStatement();
$("#first_partner_id").change();//默认甲方只能是我们公司
// $("#first_partner_id").change();//默认甲方只能是我们公司
});
//基础类
@ -512,6 +520,7 @@
}
//数据类
var DATAOBJ = {
first_partner_type:false,
first_part_company:false,
second_part_company:false,
@ -527,13 +536,51 @@
//事件类
var EVENT = {
changeCompany(){
$("#first_partner_type").on("change",function(){
var type = $(this).find("option:selected").val();
if(type == ''){
type=false;
}
DATAOBJ.first_partner_type = type;
//获取cp和内部公司
var url = "{:U('getCompanyList')}";
PUBLIC.postData(url,{},function(data){
var ptCompany = data.success.ptCompany;
var cpCompany = data.success.cpCompany;
var ptstr = '<option value="">请选择平台归属公司</option>';
for (var i in ptCompany) {
ptstr += "<option value='" + ptCompany[i].id + "'>" + ptCompany[i].partner + "</option>"
}
var cpstr = '<option value="">请选择合作公司</option>';
for (var i in cpCompany) {
cpstr += "<option value='" + cpCompany[i].id + "'>" + cpCompany[i].partner + "</option>"
}
//
if(type == 0){
$("#first_partner_id").html(cpstr);
$("#second_partner_id").html(ptstr);
}else{
$("#first_partner_id").html(ptstr);
$("#second_partner_id").html(cpstr);
}
$("#first_partner_id").select2();
$("#second_partner_id").select2();
})
})
$("#first_partner_id").on("change",function(){
//获取数据
var comid = $(this).find("option:selected").val();
//获取基础数据
var url = "{:U('getCpCompanyInfo')}";
PUBLIC.postData(url,{company_id:comid},function(data){
console.log(data);
var company_type;
if(DATAOBJ.first_partner_type == 0){
//CP上游公司
company_type = "cp";
}else{
company_type = "pt";
}
PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
DATAOBJ.first_part_company = data.success.partner;
DATAOBJ.first_party_info = data.success;
data.success.type = "first_party_info";
@ -545,7 +592,14 @@
var comid = $(this).find("option:selected").val();
//获取基础数据
var url = "{:U('getCpCompanyInfo')}";
PUBLIC.postData(url,{company_id:comid},function(data){
var company_type;
if(DATAOBJ.first_partner_type == 0){
//CP上游公司
company_type = "pt";
}else{
company_type = "cp";
}
PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
DATAOBJ.second_part_company = data.success.partner;
DATAOBJ.second_party_info = data.success;
data.success.type = "second_party_info";
@ -565,15 +619,24 @@
layer.msg('开始时间必须小于等于结束时间');
return false;
}
var company_id;
if(DATAOBJ.first_partner_type == 0){
//CP上游公司
company_id = $("#first_partner_id").find("option:selected").val();
}else{
company_type = $("#second_partner_id").find("option:selected").val();
}
//发起查询
var selectData = {
"time_start":time_start,
"time_end":time_end,
"statement_type":DATAOBJ.statement_type,
"company_id": $("#second_partner_id").find("option:selected").val()
"first_partner_type":DATAOBJ.first_partner_type,
"company_id": company_id
}
var url = "{:U('getSpendStatement')}";
PUBLIC.postData(url,selectData,function(data){
console.log(data);
if(data.code > 0){
layer.alert(data.error);
return false;

@ -106,7 +106,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_id" name="partner_id" class="select_gallery">
<option value="0" selected>海南万盟天下科技有限公司</option>
<option value="{$data['first_party_info']['id']}" selected>{$data['first_part_company']}</option>
</select>
</div>
</td>
@ -148,7 +148,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="second_partner_id" name="partner_id" class="select_gallery">
<option value="{$company_id}" selected>{$company_name}</option>
<option value="{$data['second_party_info']['id']}" selected>{$data['second_part_company']}</option>
</select>
</div>
</td>
@ -381,29 +381,29 @@
</table>
</div>
</script>
<script type="text/html" id="statementTpl">
<script type="text/html" id="statementTpl">
{@each list as it,index}
<tr>
<td>${it.statement_begin_time}-${it.statement_end_time}</td>
<td>${it.statement_begin_time}~${it.statement_end_time}</td>
<td>${it.game_name}</td>
<td>${it.pay_amount}元</td>
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 30px;">%</td>
<td><input type="text" class="txt statementchange" name="second_ratio" data-index ="${index}" data-change="statement_info[${index}]['second_ratio']" value="${it.second_ratio}" style="width: 30px;">%</td>
<td><input type="text" class="txt statementchange" name="promote_ratio" data-index ="${index}" data-change="statement_info[${index}]['promote_ratio']" value="${it.promote_ratio}" style="width: 30px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="statement_info[${index}]['fax_ratio']" value="${it.fax_ratio}" style="width: 30px;">%</td>
{@if it.statement_type==0}
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="second_ratio" data-index ="${index}" data-change="statement_info[${index}]['second_ratio']" value="${it.second_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="promote_ratio" data-index ="${index}" data-change="statement_info[${index}]['promote_ratio']" value="${it.promote_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="statement_info[${index}]['fax_ratio']" value="${it.fax_ratio}" style="width: 40px;">%</td>
{@else}
<td></td>
<td></td>
<td></td>
<td></td>
{@/if}
<td>${it.sum_money}元</td>
</tr>
{@/each}
<tr>
<td></td>
<td>罚款</td>
<td><input type="text" class="txt statementchange" name="fine" data-change="fine" value="${fine}" style="width: 50px;"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>${fine}元</td>
</tr>
<tr>
<td>合计</td>
<td></td>

@ -315,10 +315,16 @@
}
str+="<tr class=''><td>-</td><td>罚款</td>" +
"<td><input value='0' style='width: 30px' class='forfeit'/></td>" +
"<td class = 'forfeit'>"+data.data.forfeit+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>0</td>" +
"<td>"+data.data.forfeit+"</td>" +
"</tr>" +
"<tr class=''><td>-</td><td>奖励</td>" +
"<td class = 'reward'>"+data.data.reward+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>"+data.data.reward+"</td>" +
"</tr>" +
"<tr><td>合计</td>" +
"<td>---</td>" +
@ -333,8 +339,20 @@
"<td>-</td>" +
"<td data-value='"+sum+"'>"+number_chinese(sum)+"</td>" +
"</tr>";
$("tbody").empty();
$("tbody").append(str);
console.log(parseFloat($(".reward").text()))
$('.sumAmount').text((parseFloat($('.sumAmount').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
$('.sumAmount').attr('data-value',(parseFloat($('.sumAmount').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
$('.sumAll').text((parseFloat($('.sumAll').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
$('.sumAll').attr('data-value',(parseFloat($('.sumAll').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
eventnew();
}
})
@ -442,10 +460,16 @@
}
str+="<tr class=''><td>-</td><td>罚款</td>" +
"<td><input value='0' style='width: 30px' class='forfeit'/></td>" +
"<td class = 'forfeit'>"+data.data.forfeit+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>"+data.data.forfeit+"</td>" +
"</tr>" +
"<tr class=''><td>-</td><td>奖励</td>" +
"<td class = 'reward'>"+data.data.reward+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>0</td>" +
"<td>"+data.data.reward+"</td>" +
"</tr>" +
"<tr><td>合计</td>" +
"<td>---</td>" +
@ -462,6 +486,15 @@
"</tr>";
$("tbody").empty();
$("tbody").append(str);
$('.sumAmount').text((parseFloat($('.sumAmount').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
$('.sumAmount').attr('data-value',(parseFloat($('.sumAmount').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
$('.sumAll').text((parseFloat($('.sumAll').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
$('.sumAll').attr('data-value',(parseFloat($('.sumAll').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
eventnew();
}
})
@ -568,10 +601,19 @@
var forfeit = {};
forfeit['type_name'] = '罚款';
forfeit['sum_money'] = $('.forfeit').val();
forfeit['sum_money'] = $('.forfeit').text();
forfeit['statement_type'] = 1;
pushStatement.push(forfeit);
var reward = {};
reward['type_name'] = '奖励';
reward['sum_money'] = $('.reward').text();
reward['statement_type'] = 2;
pushStatement.push(reward);
// console.log(pushStatement);
sumData['statement_money'] = $(".sumAll").text();

@ -262,11 +262,17 @@
}
str+="<tr class=''><td>-</td><td>罚款</td>" +
"<td><input value='"+data.data.forfeit+"' style='width: 30px' class='forfeit'/></td>" +
"<td class = 'forfeit'>"+data.data.forfeit+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>"+data.data.forfeit+"</td>" +
"</tr>" +
"<tr class=''><td>-</td><td>奖励</td>" +
"<td class = 'reward'>"+data.data.reward+"</td>" +
"<td>-</td>" +
"<td>-</td>" +
"<td>"+data.data.reward+"</td>" +
"</tr>" +
"<tr><td>合计</td>" +
"<td>---</td>" +
"<td class='sumAmount' data-value='"+sumAmount+"'>"+data.data.pay_amount+"</td>" +
@ -282,6 +288,14 @@
"</tr>";
$("tbody").empty();
$("tbody").append(str);
// $('.sumAmount').text((parseFloat($('.sumAmount').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
// $('.sumAmount').attr('data-value',(parseFloat($('.sumAmount').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
//
//
// $('.sumAll').text((parseFloat($('.sumAll').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
// $('.sumAll').attr('data-value',(parseFloat($('.sumAll').text())+parseFloat($(".reward").text())-parseFloat($(".forfeit").text())).toFixed(2));
eventnew();
}
})

@ -52,12 +52,54 @@
<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="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<div class="input-list input-list-server search_label_rehab">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作公司</option>
<volist name=":getPartner()" id="vo">
<option partner-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">请选择游戏</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <if condition="$vo.game_name eq I('game_name')">selected</if>
>{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" name="account" placeholder="账号" class="" value="{:I('account')}"/>&nbsp;
</div>
<input type="hidden" name="from" value="{$_GET['from']}"/>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('StatementMangement/rewardManageList','model='.$model['name'].'&row='.I('row'),false)}"
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>
<!-- <a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>-->
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
@ -150,5 +192,54 @@
</volist>
$(".select_gallery").select2();
highlight_subnav("{:U('StatementMangement/rewardManageList')}");
function get_game_list()
{
var game_name = $('#game_name').val();
var partner_id = $("#partner_id option:selected").val();
var sdk_type = $("#sdk_version1 option:selected").val();
$.ajax({
url:"{:U('Finance/getGameList')}",
type:"post",
data:{
partner_id:partner_id,
sdk_type:sdk_type
},
dataType:'json',
success:function(data){
var str = "<option value=''>请选择游戏</option>";
for (var i in data){
str += "<option value='"+data[i].game_name+"'"+(game_name && data[i].game_name == game_name?'selected':'')+">"+data[i].game_name+"</option>"
}
// console.log(str);
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
}
})
}
$(function(){
$("#partner_id").change(function(){
get_game_list();
});
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
console.log(url);
query += "&" + $('.jssearch').find('select').serialize();
console.log(query);
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.replace(url);
});
});
</script>
</block>

@ -62,7 +62,7 @@
charset="UTF-8"></script>
<form action="{:U('StatementMangement/rewardManageSave')}" enctype="application/x-www-form-urlencoded" method="POST"
class="form-horizontal form_info_ml">
class="form-horizontal form_info_ml" id="form">
<div class="formtitle"><span>奖惩编辑</span></div>
<ul class="form_info ">
<input type="hidden" name="id" value="{$data.id}" />
@ -145,7 +145,10 @@
<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">
<label>&nbsp;</label>
<button class="submit_btn ajax-post" id="submit" type="submit" target-form="form-horizontal">
确认保存
</button>
<input type="button" value="返 回" target-form="form-horizontal" class="form_btn ajax-post" onclick="javascript:void(window.history.go(-1))">
</li>
</ul>
@ -171,18 +174,29 @@
$(document).on('click', '.bnt_remove', function(){
$(this).parents('li').remove();
});
// $('#reward_time').datetimepicker({
// format: 'yyyy-mm-dd',
// language: "zh-CN",
// minView: 2,
// autoclose: true
// });
$('#reward_time').datetimepicker({
language:"zh-CN",
hour: 13,
minute: 15
var date = new Date();
var monthStart = date.getFullYear()+'-0'+(date.getMonth()+1)+'-01';
$("#reward_time").datetimepicker({
format : "yyyy-mm-dd hh:ii",
autoclose : true,
todayBtn : true,
todayHighlight : true,
startDate : monthStart,
language : 'zh-CN',
startView : 2,//月视图
showMeridian : true,
pickerPosition : "bottom-left",
minuteStep : 5
});
/* $('#reward_time').datetimepicker({
language:"zh-CN",
hour: 13,
minute: 15,
setStartDate:'2020-02-01',
todayHighlight : true,
todayBtn:true
});*/
var company_id = '{$data["company_id"]}';
function companyTypeChange()
{

@ -216,7 +216,6 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">启用状态</td>
@ -237,7 +236,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$alipay['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
@ -329,8 +340,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$wei_xin['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
@ -423,7 +445,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$wei_xin_app['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
@ -690,7 +724,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$weixin_gf['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
@ -809,7 +855,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$jft['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
@ -927,7 +985,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$jft_wap['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
@ -1078,7 +1148,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$goldpig_data['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
@ -1275,7 +1357,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$sqpay['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
</table>
@ -1365,7 +1459,19 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$heepay['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
</table>

@ -104,7 +104,7 @@
</if>
<notemtpy name = "data">
<volist name="data.statement_info" id="item">
<if condition="$item.statement_type eq 1">
<if condition="$item.statement_type eq 1 or $item.statement_type eq 2">
<tr>
<td >-</td>

@ -101,7 +101,7 @@
</if>
<notemtpy name = "data">
<volist name="data.statement_info" id="item">
<if condition="$item.statement_type eq 1">
<if condition="$item.statement_type eq 1 or $item.statement_type eq 2">
<tr>
<td >-</td>
@ -113,6 +113,7 @@
<td >-</td>
<td >{$item.sum_money}元</td>
</tr>
<else/>

@ -45,7 +45,10 @@ class PromoteRepository {
if (isset($params['sdk_version'])) {
$map['sdk_version'] = $params['sdk_version'];
}
if (isset($params['begin_time']) && isset($params['begin_time']) && isset($params['time_column'])) {
if (isset($params['role_level'])) {
$map['role_level'] = $params['role_level'];
}
if (isset($params['begin_time']) && isset($params['end_time']) && isset($params['time_column'])) {
$map[$params['time_column']] = ['between', [$params['begin_time'], $params['end_time']]];
}
if (isset($params['lock_status'])) {

@ -197,4 +197,30 @@ class ApplyService {
parse_str($items['query'], $params);
return $params;
}
public function checkSociatyPerm($promote, $game)
{
if ($game['apply_auth'] == 1) {
return true;
}
$promoteService = new PromoteService();
$topPromote = $promoteService->getTopPromote($promote);
$record = M('sociaty_games', 'tab_')->where(['game_id' => $game['id'], 'promote_id' => $topPromote['id']])->find();
if ($record['status'] == 1) {
return true;
} else {
return false;
}
}
public function getSociatyGameIds($promote)
{
$promoteService = new PromoteService();
$topPromote = $promoteService->getTopPromote($promote);
$tempIds = M('sociaty_games', 'tab_')->where(['promote_id' => $topPromote['id']])->getField('game_id', true);
$tempIds = $tempIds ?? [];
$ids = M('game', 'tab_')->where(['apply_auth' => 1])->getField('id', true);
$ids = $ids ?? [];
return array_merge($tempIds, $ids);
}
}

@ -1212,4 +1212,78 @@ function gameSearch($relationGameId, $sdkVersion)
$gameIds = $gameIds ?? [-1];
return $gameIds;
}
function convertAmountToCn($num) {
//判断$num是否存在
if(!$num) return '零圆';
//保留小数点后两位
$num = round($num, 2);
//将浮点转换为整数
$tem_num = $num * 100;
//判断数字长度
$tem_num_len = strlen($tem_num);
if($tem_num_len > 14) {
return '数值过大';
}
//大写数字
$dint = array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
//大写金额单位
$danwei = array('仟', '佰', '拾', '亿', '仟', '佰', '拾', '万', '仟', '佰', '拾', '圆');
$danwei1 = array('角', '分');
//空的变量用来保存转换字符串
$daxie = '';
//分割数字,区分圆角分
list($left_num, $right_num) = explode('.', $num);
//计算单位长度
$danwei_len = count($danwei);
//计算分割后的字符串长度
$left_num_len = strlen($left_num);
$right_num_len = strlen($right_num);
//循环计算亿万元等
for($i = 0; $i < $left_num_len; $i++) {
//循环单个文字
$key_ = substr($left_num, $i, 1);
//判断数字不等于0或数字等于0与金额单位为亿、万、圆就返回完整单位的字符串
if($key_ !== '0' || ($key_ == '0' && ($danwei[$danwei_len - $left_num_len + $i] == '亿' || $danwei[$danwei_len - $left_num_len + $i] == '万' || $danwei[$danwei_len - $left_num_len + $i] == '圆'))) {
$daxie = $daxie . $dint[$key_] . $danwei[$danwei_len - $left_num_len + $i];
} else {
//否则就不含单位
$daxie = $daxie . $dint[$key_];
}
}
//循环计算角分
for($i = 0; $i < $right_num_len; $i++) {
$key_ = substr($right_num, $i, 1);
if($key_ > 0) {
$daxie = $daxie . $dint[$key_] . $danwei1[$i];
}
}
//计算转换后的长度
$daxie_len = strlen($daxie);
//设置文字切片从0开始utf-8汉字占3个字符
$j = 0;
while($daxie_len > 0) {
//每次切片两个汉字
$str = substr($daxie, $j, 6);
//判断切片后的文字不等于零万、零圆、零亿、零零
if($str == '零万' || $str == '零圆' || $str == '零亿' || $str == '零零') {
//重新切片
$left = substr($daxie, 0, $j);
$right = substr($daxie, $j + 3);
$daxie = $left . $right;
}
$j += 3;
$daxie_len -= 3;
}
return $daxie . '整';
}

@ -66,11 +66,11 @@ class ApplyController extends BaseController
{
$loginPromote = $this->getLoginPromote();
$promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id');//搜索的渠道ID
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色
$parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID
$grandPromoteId = getGrandPromoteId($promoteId);//本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限
$promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id'); //搜索的渠道ID
$promoteRole = empty(I('promote_role')) ? 1 : I('promote_role'); //渠道角色
$parentPromoteId = getParentPromoteId($promoteId); //上级渠道ID
$grandPromoteId = getGrandPromoteId($promoteId); //本账号会长渠道ID
$childGameAddPermission = getChildGameAddPermission($grandPromoteId); //游戏添加权限
$map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
@ -92,6 +92,10 @@ class ApplyController extends BaseController
$map['tab_game.sdk_version'] = $type;
$applyService = new ApplyService();
$tempIds = $applyService->getSociatyGameIds($loginPromote);
$gameIdList = array_intersect($gameIdList, $tempIds);
if (count($gameIdList) > 0) {
$gameIds = implode(',', $gameIdList);
@ -115,9 +119,12 @@ class ApplyController extends BaseController
} else {
$gameIdList = M('Game', 'tab_')->group('relation_game_id')->having('count(id) = 2')->getField('id', true);
$applyService = new ApplyService();
$tempIds = $applyService->getSociatyGameIds($loginPromote);
$gameIdList = array_intersect($gameIdList, $tempIds);
if (count($gameIdList) > 0) {
$gameIds = implode(',', $gameIdList);
$map['tab_game.id'] = ['in', $gameIds];
} else {
$map = '1 = 2';

@ -1304,7 +1304,7 @@ class DownloadController extends BaseController {
empty(I('user_account')) || $map['tab_spend.user_account'] = ['like', '%' . I('user_account') . '%'];
empty(I('pay_order_number')) || $map['tab_spend.pay_order_number'] = I('pay_order_number');
// $map['tab_spend.pay_status'] = 1;
$map['tab_spend.is_check'] = ['neq', 2];
// $map['tab_spend.is_check'] = ['neq', 2];
if (isset($_REQUEST['pay_status']) && $_REQUEST['pay_status'] !== '') {
$payStatus = intval(I('pay_status'));
@ -1446,6 +1446,183 @@ class DownloadController extends BaseController {
$this->success('添加下载成功',U('listsIndex'));
}
/*推广员指标查看详情 */
public function quotaDtl_data_export() {
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
$relationGameId = I('relation_game_id', 0);
$sdkVersion = I('sdk_version', 0);
$serverId = I('server_id', 0);
$roleLevelBegin = intval(I('level_begin', 0));
$roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0);
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
$map['role_level'] = ['elt', $roleLevelEnd];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) {
$map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]];
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['create_time'] = ['between', [$beginTime, $endTime]];
if ($promoteId) {
if ($isSelf) {
$map['promote_id'] = $promoteId;
} else {
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find();
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
} else {
$map = '1 = 2';
}
// $data = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
$conditions = json_encode($map,TRUE);
$addtime = time();
$data1 = [
'logid' => 'quotadtl_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/promoteQuota',
'dataname' => '推广员详情',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data1);
if (!$res) {
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
/*推广指标首页导出*/
public function promoteQuota_data_export() {
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
if (!empty($time)) {
$defaultTime = $time;
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$levelBegin = I('level_begin', '');
$levelEnd = I('level_end', '');
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$data = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map)->select();
$ids = array_column($data, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$map = [
'isContainSubs' => true,
'basicPromotes' => json_encode($basicPromotes,FALSE),
];
$map['promotes'] = json_encode($data,FALSE);
$map['parentsinfo'] = json_encode($parent,FALSE);;
$map['currentDisplay'] = $currentDisplay;
$map['ids'] = $ids;
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$map['server_id'] = $serverId;
}
$where = $map;
if ($sdkVersion != 0) {
$map['sdk_version'] = $sdkVersion;
}
if ($levelBegin !== '' || $levelEnd !== '') {
if ($levelBegin !== '' && $levelEnd !== '') {
$levelBegin = intval($levelBegin);
$levelEnd = intval($levelEnd);
if ($levelBegin > $levelEnd) {
$this->error('角色等级范围错误');
}
$map['role_level'] = ['between', [$levelBegin, $levelEnd]];
} elseif ($levelBegin !== '' && $levelEnd === '') {
$levelBegin = intval($levelBegin);
$map['role_level'] = ['egt', $levelBegin];
} elseif ($levelBegin === '' && $levelEnd !== '') {
$levelEnd = intval($levelEnd);
$map['role_level'] = ['elt', $levelEnd];
}
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['begin_time'] = $beginTime;
$map['end_time'] = $endTime;
$conditions = json_encode($map,TRUE);
$addtime = time();
$data1 = [
'logid' => 'quota_'.time(),
'promote_id' => PID,
'type' => '/Home/Query/promoteQuota',
'dataname' => '推广员指标',
'status' => 0,
'addtime' => $addtime,
'begintime' => 0,
'content' => '',
'conditions' =>$conditions
];
$res = M('downloadlog','tab_')->add($data1);
if (!$res) {
// $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res));
$this->error('添加下载失败');
}
$this->success('添加下载成功',U('listsIndex'));
}
public function achievement_data_export() {
$time = I('time', date('Y-m-d'));
@ -1863,15 +2040,142 @@ class DownloadController extends BaseController {
case "平台币充值":
$this->orderlistExcelInfo($id,$map);
break;
case "玩家行为日志";
case "玩家行为日志":
$this->playactionExcelInfo($id,$map);
break;
case "推广员指标":
$this->promotequotaExcelInfo($id,$map);
break;
case "推广员详情":
$this->promotequotaDtlExcelInfo($id,$map);
break;
default:
break;
}
}
public function promotequotaDtlExcelInfo($id,$map) {
$xlsName = "推广员详情";
$xlsCell = array(
array('user_account','玩家账号'),
array('promote_account','推广账号'),
array('game_name','游戏名称'),
array('sdk_version','平台'),
array('server_name','游戏区服'),
array('role_name','角色名'),
array('role_level','等级'),
array('create_time','创建时间'),
);
$records = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select();
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) { $strLen = 2;}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
if($value1['sdk_version'] == 1) {
$value1['sdk_version'] = "安卓版";
}
if($value1['sdk_version'] == 2) {
$value1['sdk_version'] = "苹果版";
}
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
}
public function promotequotaExcelInfo($tid,$map) {
$xlsName = "推广员指标";
$xlsCell = array(
array('account','账号'),
array('real_name','姓名'),
array('game_name','游戏名称'),
array('sdk_version_text','平台'),
array('server_name','游戏区服'),
array('role_num','角色数量'),
);
$params['isContainSubs'] = $map['isContainSubs'];
$params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE);
$ids = $map['ids'];
$promotes = json_decode($map["promotes"],TRUE);
if(!empty($map['game_id'])) {
$params['game_id'] = $map["game_id"];
}
if(!empty($map['server_id'])) {
$params['server_id'] = $map["server_id"];
}
if(!empty($map['sdk_version'])) {
$params['sdk_version'] = $map["sdk_version"];
}
if(!empty($map['role_level'])) {
$params['role_level'] = $map['role_level'];
unset($map['role_level']);
}
if(!empty($map['parentsinfo'])) {
$parent = json_decode($map['parentsinfo'],TRUE);
unset($map['parentsinfo']);
}
// if(!empty($map['currentDisplay'])) {
// $currentDisplay = $map['currentDisplay'];
// unset($map['currentDisplay']);
// }
$params['begin_time'] = $map['begin_time'];
$params['end_time'] = $map['end_time'];
//var_dump($params);
$records = [];
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$game = $this->getgame($map);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
'level' => $parent['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $selfCreateRoleCountList[$parent['id']],
'current_display' => $currentDisplay,
];
$records[] = $record;
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
'level' => $promote['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $createRoleCountList[$id],
'current_display' => '',
];
$records[] = $record;
}
$xlsData = [];
foreach ($records as $key1 => $value1) {
$value1['account'] = $this->encryption($value1['account']);
$xlsData[] = $value1;
}
$this->exportExcel($xlsName, $xlsCell, $xlsData,$tid);
}
public function playactionExcelInfo($id,$map) {
$xlsName = "玩家行为日志";
$xlsCell = array(
@ -3716,6 +4020,55 @@ class DownloadController extends BaseController {
return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen-$strLen);
}
private function getGame($map = [])
{
$gameName = '全部游戏';
$sdkVersionText = getSDKTypeName(0, true);
$serverName = '--';
if (isset($map['game_id']) || isset($map['sdk_version'])) {
$where = [];
if (!isset($map['game_id'])) {
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
} elseif (!isset($map['sdk_version'])) {
$where['id'] = $map['game_id'];
$gameName = M('game', 'tab_')->where($where)->getField('relation_game_name');
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], 0, $map['server_id']);
}
} else {
$where['id'] = $map['game_id'];
$where['sdk_version'] = $map['sdk_version'];
$gameName = M('game', 'tab_')->where($where)->getField('game_name');
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']);
}
}
}
$game = [
'game_name' => $gameName,
'sdk_version_text' => $sdkVersionText,
'server_name' => $serverName,
];
return $game;
}
private function getServerName($gameIds, $serverVersion, $serverId)
{
$map['_string'] = '1 = 1';
if ($gameIds) {
$map['game_id'] = $gameIds;
}
if ($serverVersion) {
$map['server_version'] = $serverVersion;
}
if ($serverId) {
$map['server_id'] = $serverId;
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
}

@ -119,7 +119,8 @@ class FinanceController extends BaseController
$income = $model->field("sum(if(pay_time < $thisDay, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as history_income,
sum(if(pay_time >= $thisMonth, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as this_month_income,
sum(if((pay_time >= $yesterday and pay_time < $thisDay), if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as yesterday_income,
sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance")
sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance,
sum(if(selle_status = 0, pay_amount, 0)) as not_withdrawn_amount")
->where($map)
->find();
@ -127,10 +128,41 @@ class FinanceController extends BaseController
$value = bcdiv($value, 100, 2);
}
$withdrawMap['promote_id'] = $this->loginPromote['id'];
$withdrawMap['status'] = ['neq', 2];
//已提现总额
$income['withdrawn_amount'] = M('withdraw', 'tab_')->field('sum(sum_money) as withdrawn_amount')->where($withdrawMap)->find()['withdrawn_amount'];
$withdrawns = M('withdraw', 'tab_')->field('settlement_begin_time, settlement_end_time')
->where($withdrawMap)
->select();
$days = [];
if (!empty($withdrawns)) {
foreach ($withdrawns as $withdrawn) {
$thisDays = [];
if (empty($withdrawn['settlement_begin_time'])) {
if ($begTime < $withdrawn['settlement_end_time']) {
if ($endTime <= $withdrawn['settlement_end_time']) {
$thisEndTime = $endTime;
} else {
$thisEndTime = $withdrawn['settlement_end_time'];
}
$thisDays = $this->getDayList($begTime, $thisEndTime);
}
} else {
$thisDays = $this->getDayList($withdrawn['settlement_begin_time'], $withdrawn['settlement_end_time']);
}
$days = array_merge($days, $thisDays);
}
}
$days = array_unique($days);
$map['pay_time'] = ['between', [$begTime, $endTime]];
$dayList = $this->getDayList($begTime, $endTime);
$data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,
sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income')
sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income, selle_status')
->where($map)
->group('day')
->select();
@ -140,13 +172,16 @@ class FinanceController extends BaseController
$records[] = [
'day' => $date,
'income' => bcdiv($data[$day], 100, 2),
'selle_status_text' => (in_array($day, $days) ? '已提现' : '未提现'),
'url' => U('settlementDtl', array('begtime' => $day, 'endtime' => $day))
];
}
}
$settlementCycle = ($this->loginPromote['settlement_type'] == 1 ? '周结' : '月结');
$this->assign('income', $income);
$this->assign('listData', $records);
$this->assign('settlementCycle', $settlementCycle);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('yesterday', date('Y-m-d', $yesterday));
@ -625,45 +660,25 @@ class FinanceController extends BaseController
$this->error('参数异常');
}
$settlementBeginTime = $withdraw['settlement_begin_time'];
$settlementEndTime = $withdraw['settlement_end_time'];
$withdraw['create_time'] = date('Y-m-d H:i:s', $withdraw['create_time']);
$withdraw['settlement_end_time'] = date('Y-m-d H:i:s', $withdraw['settlement_end_time']);
$withdraw['status'] = FinanceController::$withdrawStatus[$withdraw['status']];
if (empty($withdraw['game_ratio'])) {
$map['_string'] = '1 = 2';
} else {
$gameRatios = json_decode($withdraw['game_ratio'], true);
$gameIds = array_keys($gameRatios);
$map['game_id'] = ['in', $gameIds];
$map['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
}
if ($withdraw['settlement_type'] != 3) {
$map['withdraw_id'] = $withdrawId;
}
$data = M('spend', 'tab_')
->field('game_id,game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income')
->where($map)
->group('game_id')
->order('game_id')
->select();
if (!empty($data)) {
foreach ($data as &$list) {
$list['income'] = '0.00';
if (isset($gameRatios[$list['game_id']])) {
foreach ($gameRatios[$list['game_id']] as $gameIncome) {
$income = bcdiv(bcmul($gameIncome['sum_amount'], $gameIncome['selle_ratio'], 2), 100, 2);
$list['income'] = bcadd($list['income'], $income, 2);
}
}
}
}
$this->assign('withdraw', $withdraw);
$this->assign('listData', $data);
$this->assign('promoteData', $this->loginPromote);
$statementMap['ext_field'] = $withdraw['widthdraw_number'];
$statementMap['statement_type'] = 1;
$statement = M('statement', 'tab_')->where($statementMap)->find();
if (empty($statement)) {
$this->error('未生成下游结算单');
}
$statement['first_party_info'] = json_decode($statement['first_party_info'], 1);//甲方
$statement['second_party_info'] = json_decode($statement['second_party_info'], 1);//乙方
$statement['statement_info'] = json_decode($statement['statement_info'], 1);//结算记录
//收款方
$statement['receive_company'] = ($statement['pay_type'] ? $statement['first_party_info']['partner'] : $statement['second_party_info']['partner']);
$all_sum_money = array_sum(array_column($statement['statement_info'], 'sum_money'));//合计平台总额
$all_pay_amount = array_sum(array_column($statement['statement_info'], 'pay_amount'));//合计结算金额
$big_all_sum_money = convertAmountToCn($statement['statement_money']);//大写
$this->assign('big_all_sum_money', $big_all_sum_money);
$this->assign('all_sum_money', $all_sum_money);
$this->assign('all_pay_amount', $all_pay_amount);
$this->assign('data', $statement);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();

@ -154,8 +154,8 @@ class HomeController extends Controller
$this->error('该链接已被禁');
}
$applyService = new ApplyService();
if ($code != '') {
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE);
if (!$result['status']) {
@ -173,6 +173,7 @@ class HomeController extends Controller
$columns = [
'id',
'sdk_version',
'apply_auth',
'icon',
'screenshot',
'relation_game_id',
@ -193,6 +194,11 @@ class HomeController extends Controller
$map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find();
$promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find();
if (!$applyService->checkSociatyPerm($promote, $game)) {
$this->error('该链接已经停止使用');
}
if ($game['sdk_version'] == 1 && $isIOS) {
$map = [];
$map['relation_game_id'] = $game['relation_game_id'];
@ -207,6 +213,9 @@ class HomeController extends Controller
$apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id'])
->where(['promote_id' => $promoteId, 'game_id' => $game['id']])
->find();
if (!$apply) {
$this->error('该链接已经停止使用');
}
$game['icon'] = get_cover($game['icon'], 'path');
$gameSource = M('GameSource', 'tab_')->field(['create_time', 'org_plist_url', 'is_new_sdk'])->where(array('game_id' => $game['id']))->find();

@ -40,8 +40,9 @@ class PackageController extends Controller
if ($isBlack) {
$this->redirect("package/downloadError", ['message' => '该链接已被禁']);
}
$applyService = new ApplyService();
if ($code != '') {
$applyService = new ApplyService();
$data = $applyService->decodeApplyCode($code);
$result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD);
if (!$result['status']) {
@ -59,7 +60,16 @@ class PackageController extends Controller
$map['promote_id'] = $promoteId;
$columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status'];
$apply = M('apply','tab_')->field($columns)->where($map)->find();
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version'])->where(['id' => $apply['game_id']])->find();
if (!$apply) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
}
$promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find();
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
if (!$applyService->checkSociatyPerm($promote, $game)) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
}
if (Request::isMobile()) {
if (!Request::isAndroid() && $game['sdk_version'] == 1) {

@ -100,7 +100,6 @@ class QueryController extends BaseController
}
}
$map['tab_spend.pay_time'] = ['between', [$begTime, $endTime - 1]];
$map['tab_spend.is_check'] = ['neq', 2];
$data = [];
$count = 0;
@ -2210,4 +2209,272 @@ class QueryController extends BaseController
$this->ajaxReturn($data);
}
//推广员指标管理
public function promoteQuota()
{
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
if (!empty($time)) {
$defaultTime = $time;
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$levelBegin = I('level_begin', '');
$levelEnd = I('level_end', '');
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$searchLevel = $parent['level'] + 1;
$searchLevelName = $promoteService->getLevelName($searchLevel);
$games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select();
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$params = [
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$params['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
$where = $params;
if ($sdkVersion != 0) {
$where['sdk_version'] = $sdkVersion;
}
$game = $this->getGame($where);
if ($levelBegin !== '' || $levelEnd !== '') {
if ($levelBegin !== '' && $levelEnd !== '') {
$levelBegin = intval($levelBegin);
$levelEnd = intval($levelEnd);
if ($levelBegin > $levelEnd) {
$this->error('角色等级范围错误');
}
$params['role_level'] = ['between', [$levelBegin, $levelEnd]];
} elseif ($levelBegin !== '' && $levelEnd === '') {
$levelBegin = intval($levelBegin);
$params['role_level'] = ['egt', $levelBegin];
} elseif ($levelBegin === '' && $levelEnd !== '') {
$levelEnd = intval($levelEnd);
$params['role_level'] = ['elt', $levelEnd];
}
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime;
$params['end_time'] = $endTime;
$records = [];
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
if (I('p', 1) == 1) {
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**',
'level' => $parent['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $selfCreateRoleCountList[$parent['id']],
'current_display' => $currentDisplay,
];
$records[] = $record;
}
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**',
'level' => $promote['level'],
'game_name' => $game['game_name'],
'sdk_version_text' => $game['sdk_version_text'],
'server_name' => $game['server_name'],
'role_num' => $createRoleCountList[$id],
'current_display' => '',
];
$records[] = $record;
}
$this->assign('prevParentId', $prevParentId);
$this->assign('searchLevelName', $searchLevelName);
$this->assign('games', $games);
$this->assign('parent', $parent);
$this->assign('subPromotes', $subPromotes);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('parentId', $parentId);
$this->assign('count', $count);
$this->assign('time', $defaultTime);
$this->assign('meta_title', '推广员指标');
$this->display();
}
public function quotaDtl()
{
$nowTime = date('Y-m-d', time());
$defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime;
$time = I('time', $defaultTime);
$relationGameId = I('relation_game_id', 0);
$sdkVersion = I('sdk_version', 0);
$serverId = I('server_id', 0);
$roleLevelBegin = intval(I('level_begin', 0));
$roleLevelEnd = intval(I('level_end', 0));
$promoteId = I('promote_id', 0);
$isSelf = I('is_self', 0);
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$map['game_id'] = ['in', $gameIds];
}
if ($serverId != 0) {
$map['server_id'] = $serverId;
}
if ($roleLevelBegin != 0 && $roleLevelEnd == 0) {
$map['role_level'] = ['egt', $roleLevelBegin];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) {
$map['role_level'] = ['elt', $roleLevelEnd];
} elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) {
$map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]];
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$map['create_time'] = ['between', [$beginTime, $endTime]];
if ($promoteId) {
if ($isSelf) {
$map['promote_id'] = $promoteId;
} else {
$promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find();
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promoteId;
$map['promote_id'] = ['in', $promoteIds];
}
} else {
$map = '1 = 2';
}
$query = M('user_play_info', 'tab_')->where($map)->order('create_time desc');
list($records, $pagination, $count) = $this->paginate($query);
foreach ($records as $key => $value) {
//订单隐藏算法
$orderLen = strlen($value['user_account']);
$strLen = 3;
$hideChar = '';
if ($orderLen <= 8) {
$strLen = 2;
}
for ($i = 0; $i < $orderLen - $strLen * 2; $i++) {
$hideChar .= '*';
}
$records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen);
}
$this->assign('records', $records);
$this->assign('pagination', $pagination);
$this->assign('count', $count);
$this->display();
}
private function getGame($map = [])
{
$gameName = '全部游戏';
$sdkVersionText = getSDKTypeName(0, true);
$serverName = '--';
if (isset($map['game_id']) || isset($map['sdk_version'])) {
$where = [];
if (!isset($map['game_id'])) {
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
} elseif (!isset($map['sdk_version'])) {
$where['id'] = $map['game_id'];
$gameName = M('game', 'tab_')->where($where)->getField('relation_game_name');
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], 0, $map['server_id']);
}
} else {
$where['id'] = $map['game_id'];
$where['sdk_version'] = $map['sdk_version'];
$gameName = M('game', 'tab_')->where($where)->getField('game_name');
$sdkVersionText = getSDKTypeName($map['sdk_version'], true);
if (isset($map['server_id'])) {
$serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']);
}
}
}
$game = [
'game_name' => $gameName,
'sdk_version_text' => $sdkVersionText,
'server_name' => $serverName,
];
return $game;
}
private function getServerName($gameIds, $serverVersion, $serverId)
{
$map['_string'] = '1 = 1';
if ($gameIds) {
$map['game_id'] = $gameIds;
}
if ($serverVersion) {
$map['server_version'] = $serverVersion;
}
if ($serverId) {
$map['server_id'] = $serverId;
}
return M('server', 'tab_')->where($map)->getField('server_name');
}
}

@ -33,6 +33,11 @@
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>昨日收益</p><span>¥{$income.yesterday_income}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>账户余额</p><span>¥{$income.balance}</span></div> </li>
</ul>
<ul style="margin-top: 10px;">
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>已提现总金额</p><span>¥{$income.withdrawn_amount}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>未提现金额</p><span>¥{$income.not_withdrawn_amount}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>结算周期</p><span>{$settlementCycle}</span></div> </li>
</ul>
</div>
<div style="margin-top: 2.4vh;">
<!-- <button class="withdraw" id="withdraw">提现</button>-->
@ -61,6 +66,7 @@
<tr class="odd">
<th>时间</th>
<th>收益</th>
<th>提现状态</th>
<th>操作</th>
</tr>
<empty name="listData">
@ -70,6 +76,7 @@
<tr>
<td>{$data.day}</td>
<td>{$data.income}</td>
<td>{$data.selle_status_text}</td>
<td><a href="{$data.url}">明细</a></td>
</tr>
</volist>

@ -52,80 +52,68 @@
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: grid;">
<div class="tab detailed-box">
<label class="detailed-title detailed-label">提现订单号:</label>
<label class="detailed-title detailed-label">乙方:</label>
<div class="detailed-content-box">
<span>{$withdraw.widthdraw_number}</span>
<span>{$data['second_party_info']['partner']}</span>
</div>
<label class="detailed-title detailed-label">申请时间:</label>
<label class="detailed-title detailed-label">户名:</label>
<div class="detailed-content-box">
<span>{$withdraw.create_time}</span>
<span>{$data['second_party_info']['bank_account_name']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">会长账号:</label>
<label class="detailed-title detailed-label">提现单号:</label>
<div class="detailed-content-box">
<span>{$withdraw.promote_account}</span>
<span>{$data['ext_field']}</span>
</div>
<label class="detailed-title detailed-label">结算截止时间:</label>
<label class="detailed-title detailed-label">银行账号:</label>
<div class="detailed-content-box">
<span>{$withdraw.settlement_end_time}</span>
<span>{$data['second_party_info']['bank_account']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">状态:</label>
<label class="detailed-title detailed-label">订单类型:</label>
<div class="detailed-content-box">
<span>{$withdraw.status}</span>
<span>{$data['second_party_info']['settlement_type']}</span>
</div>
<label class="detailed-title detailed-label">收款人:</label>
<label class="detailed-title detailed-label">开户行:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_account}</span>
<span>{$data['second_party_info']['opening_bank']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">开户行:</label>
<label class="detailed-title detailed-label">联系人:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_name}</span>
<span>{$data['second_party_info']['link_man']}</span>
</div>
<label class="detailed-title detailed-label">银行账号:</label>
<label class="detailed-title detailed-label">邮寄地址:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_card}</span>
<span>{$data['second_party_info']['address']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">收益金额:</label>
<label class="detailed-title detailed-label">联系电话:</label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
</span>
<span>{$data['second_party_info']['link_phone']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">奖惩金额:</label>
<label class="detailed-title detailed-label">开票项目:</label>
<div class="detailed-content-box">
<span>0.00</span>
<span>{$data['second_party_info']['invoice_item']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">实际提现金额:</label>
<label class="detailed-title detailed-label"></label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
<span style="color: red;">(实际提现金额=收益金额+奖惩金额)</span>
</span>
<span></span>
</div>
<label class="detailed-title detailed-label">发票类型:</label>
<div class="detailed-content-box">
<span>{$data['second_party_info']['invoice_type']}</span>
</div>
</div>
</div>
@ -136,19 +124,20 @@
</div>
<div class="trunk-content article">
<div class="tabcon trunk-list">
<table class="table normal_table">
<table class="table normal_table" style="border: 1px solid #ddd;">
<tr class="odd">
<th>游戏名称</th>
<th>流水</th>
<th>现金分成基数</th>
<!-- <th>现金分成比例</th>-->
<th>平台币分成基数</th>
<!-- <th>平台币分成比例</th>-->
<th>绑定币分成基数</th>
<!-- <th>绑定币分成比例</th>-->
<th>合作方分成金额</th>
<th>结算时间</th>
<th >产品</th>
<th >平台总额</th>
<if condition = "$data.second_party_info.settlement_type eq '补点订单'">
<th >补点比例</th>
<else/>
<th >分成比例</th>
</if>
<th >税费费率</th>
<th >结算金额(元)</th>
</tr>
<if condition="true eq empty($listData) or $withdraw.status eq -1">
<if condition="true eq empty($data)">
<tr class="num2">
<td colspan="99" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
@ -156,36 +145,73 @@
</td>
</tr>
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.game_name}</td>
<td>{$vo.pay_amount_all}</td>
<if condition="$vo.pay_way neq -1 and $vo.pay_way neq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<!-- <td>{$vo.selle_ratio}%</td>-->
<td>{$vo.income}</td>
</tr>
<volist name="data.statement_info" id="item">
<if condition="$item.statement_type eq 1">
<tr>
<td >-</td>
<td >{$item.type_name}</td>
<td >{$item.sum_money}</td>
<td >-</td>
<td >-</td>
<td >{$item.sum_money}</td>
</tr>
<else/>
<tr>
<td >{$item.statement_begin_time}-{$item.statement_end_time}</td>
<td >{$item.game_name}</td>
<td >{$item.pay_amount}</td>
<td >{$item.second_ratio}%</td>
<td >{$item.fax_ratio}%</td>
<td >{$item.sum_money}</td>
</tr>
</if>
</volist>
<tr>
<td><span>总计</span></td>
<td><span>-</span></td>
<td ><span><if condition="$data.pay_amount neq ''">{$data.pay_amount}<else/>0</if></span></td>
<td>-</td>
<td>-</td>
<td><if condition="$data.statement_money neq ''">{$data.statement_money}<else/>0</if></td>
</tr>
<tr>
<td><span>本月分成总金额(人民币大写)</span></td>
<td>-</td>
<td >-</td>
<td>-</td>
<td>-</td>
<td><if condition="$big_all_sum_money neq ''">{$big_all_sum_money}<else/></if></td>
</tr>
</if>
</table>
</div>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: grid;">
<div class="tab detailed-box">
<label class="detailed-title detailed-label">甲方:</label>
<div class="detailed-content-box">
<span>{$data['first_party_info']['jfCompany']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">联系人:</label>
<div class="detailed-content-box">
<span>{$data['first_party_info']['jfPerson']}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">联系电话:</label>
<div class="detailed-content-box">
<span>{$data['first_party_info']['jfTel']}</span>
</div>
</div>
</div>
</div>
<div class="detailed-br"></div>
</div>
</block>

@ -197,7 +197,7 @@
<td>
<a href="{:U('withdrawDtl', array('id'=>$vo['id']))}">提现明细</a>
<if condition="$vo['status'] eq 2">
<a data-href="{:U('download/Remittancecer',['id'=>$vo['id']])}" class="ajax-get">汇款证明</a>
<!-- <a data-href="{:U('download/Remittancecer',['id'=>$vo['id']])}" class="ajax-get">汇款证明</a>-->
<elseif condition="$vo['status'] eq -1"/>
<!-- <span class="renew-review" data-id="{$vo['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>-->
</if>

@ -192,7 +192,6 @@
<th>游戏类型</th>
<th>平台</th>
<th>混服情况</th>
<th>玩家折扣</th>
<th>分成比例</th>
</tr>
<empty name="dataList">
@ -210,7 +209,6 @@
<td>{$vo.game_type_name}</td>
<td>{:getSDKTypeName($vo['sdk_version'])}</td>
<td><?=($vo['server_type']==1)?'专服':'混服'?></td>
<td><?=($vo['discount']==10)?'----':($vo['discount'].'折')?></td>
<td>{$vo.ratio}%</td>
</tr>
</volist>

@ -72,6 +72,7 @@
<a href="{:U('Query/userRecharges')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq userRecharges '>active</if> ">充值玩家</a>
<?php endif;?>
<a href="{:U('Query/achievement')}" class="<if condition='CONTROLLER_NAME eq Query and ACTION_NAME eq achievement '>active</if> ">团队/推广员业绩</a>
<a href="{:U('Query/promoteQuota')}" class="<if condition='CONTROLLER_NAME eq Query and (ACTION_NAME eq promoteQuota or ACTION_NAME eq quotaDtl) '>active</if> ">推广员指标</a>
</div>
<?php endif;?>

@ -0,0 +1,189 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
.btn-span {
color: #06c;
cursor: pointer;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>{$meta_title}</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">{$meta_title}</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Query/promoteQuota',['row'=>I('get.row')])}" method="post" enctype="multipart/form-data">
<input type="hidden" name="parent_id" value="{:I('parent_id', 0)}">
<div class="form-group normal_space">
<select name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择{$searchLevelName}</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}({$promote.real_name})</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="game-select" name="relation_game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.relation_game_id}" <if condition="I('relation_game_id') eq $game['relation_game_id']">selected</if>>{$game.relation_game_name}</option>
</volist>
</select>
</div>
<div class="form-group normal_space">
<select id="sdk_version" name="sdk_version" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择设备类型</option>
<option value="1" <if condition="I('sdk_version') === '1'">selected</if>>Andriod</option>
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<div class="form-group normal_space">
<select id="server-select" name="server_id" class="reselect select_gallery" style="width: 220px;" data-server="{:I('server_id', 0)}" >
<option value="0">请选择区服</option>
</select>
</div>
<div class="form-group normal_space fr">
<input type="text" class="txt range-date" name="time" placeholder="创角时间" value="{$time}" >
</div>
<div class="form-group normal_space fr">
<label>角色等级:</label>
<input type="text" class="txt float-input" name="level_begin" style="width: 50px" value="{:I('level_begin')}" >
<label> ~ </label>
<input type="text" class="txt float-input" name="level_end" style="width: 50px" value="{:I('level_end')}" >
</div>
<div class="form-group">
<input type="submit" class="submit normal_space" value="查询">
</div>
<?php if ($prevParentId > 0):?>
<div class="form-group">
<a class="submit normal_space" href="{:U('Query/promoteQuota', ['row'=>I('get.row'), 'parent_id' => $prevParentId,'time'=>$time])}" style="line-height: 36px; display: inline-block; text-align: center; background: #E5E5E5; color: #2bd8ed; cursor: pointer;">返回上级</a>
</div>
<?php endif;?>
</form>
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>推广员</th>
<th>游戏名称</th>
<th>平台</th>
<th>游戏区服</th>
<th>角色数量</th>
<th>操作</th>
</tr>
<empty name="records">
<tr><td colspan="14" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="record" mod="2">
<tr data-id="{$vo.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.account}({$record.real_name})
<?php if($record['current_display'] != ''):?>
<span style="color: #06C;">[{$record['current_display']}]</span>
<?php endif;?>
</td>
<td>{$record.game_name}</td>
<td>{$record.sdk_version_text}</td>
<td>{$record.server_name}</td>
<td>{$record.role_num}</td>
<td>
<?php if($record['current_display'] == '' && $record['level'] < 4):?>
<a href="{:U('Query/promoteQuota', ['parent_id' => $record['id'], 'time' => $time])}">查看下级</a>
<?php endif;?>
<?php if($record['current_display'] != ''):?>
<a href="{:U('Query/quotaDtl', ['parent_id' => I('parent_id', 0), 'time' => $time, 'promote_id' => $record['id'], 'relation_game_id' => I('relation_game_id', ''), 'sdk_version' => I('sdk_version', ''), 'server_id' => I('server_id', ''), 'level_begin' => I('level_begin', ''), 'level_end' => I('level_end', ''), 'is_self' => 1])}">查看详情</a>
<?php else :?>
<a href="{:U('Query/quotaDtl', ['parent_id' => I('parent_id', 0), 'time' => $time, 'promote_id' => $record['id'], 'relation_game_id' => I('relation_game_id', ''), 'sdk_version' => I('sdk_version', ''), 'server_id' => I('server_id', ''), 'level_begin' => I('level_begin', ''), 'level_end' => I('level_end', ''), 'is_self' => 0])}">查看详情</a>
<?php endif;?>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" href="{:U('download/promoteQuota_data_export',array_merge(['parent_id'=>$parentId,'time'=>$time],I('post.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<eq name='timeout' value='1'>
<script>
layer.msg('时间间隔不能超过7天');
</script>
</eq>
<script type="text/javascript">
$(function() {
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();
var defaultServerId = $('#server-select').attr('data-server');
getGameServers(gameId, sdkVersion, defaultServerId)
$('#game-select,#sdk_version').on({
change: function name() {
gameId = $('#game-select').val();
sdkVersion = $('#sdk_version').val();
getGameServers(gameId, sdkVersion, 0);
}
});
function getGameServers(gameId, sdkVersion, defaultServerId) {
$.ajax({
url: "{:U('Query/getGameServers')}",
dataType: 'json',
data: {game_id: gameId, sdk_version: sdkVersion},
success: function(response) {
var options = '<option value="0">请选择区服</option>'
for (var i in response.data.servers) {
var server = response.data.servers[i]
var selected = ''
if (defaultServerId > 0 && server.id==defaultServerId) {
selected = 'selected'
}
options += '<option value="' + server.server_id + '"' + selected + '>' + server.server_name + '</option>'
}
$('#server-select').html(options)
$("#server-select").val(defaultServerId).trigger("change")
}
})
}
})
</script>
</block>

@ -0,0 +1,100 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/account.css" rel="stylesheet" >
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
<style>
.form-group {
float: left;
margin-bottom: 10px;
}
.form-group label {
line-height: 34px;
height: 34px;
}
</style>
</block>
<block name="body">
<div class="page-list normal_list promote-mychlid-list">
<div style="position: absolute;margin-top: -25px;color: #6a7082;">
<span class="back-btn" style="cursor: pointer;"><i class="iconfont iconreply"></i> 返回</span>
</div>
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>推广员指标></span><span>查看详情</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_game.png">
<span class="title_main">查看详情</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
</div>
<div class="trunk-list list_normal">
<table class="table normal_table">
<tr class="odd">
<th>玩家帐号</th>
<th>推广账号</th>
<th>游戏名称</th>
<th>平台</th>
<th>游戏区服</th>
<th>角色名</th>
<th>等级</th>
<th>创建时间</th>
</tr>
<empty name="records">
<tr><td colspan="8" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
<else />
<volist name="records" id="record" mod="2">
<tr data-id="{$vo.id}" class="<eq name='mod' value='1'>odd</eq>">
<td>{$record.user_account}</td>
<td>{$record.promote_account}</td>
<td>{$record.game_name}</td>
<td>{:getSDKTypeName($record['sdk_version'])}</td>
<td>{$record.server_name}</td>
<td>{$record.role_name}</td>
<td>{$record.role_level}</td>
<td>
<?php if($record['create_time'] == 0):?>
{$record.play_time|date='Y-m-d H:i:s',###}
<?php else:?>
{$record.create_time|date='Y-m-d H:i:s',###}
<?php endif;?>
</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/quotaDtl_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
</div>
<div class="page-explain promote-mychlid-explain">
<div class="trunk-content article border_normal">
<!-- <table class="desccontent">
<tr><td class="title" style="width: 100px;display: inline-block;">二级渠道说明:</td><td class="det">推广员默认为一级渠道,一级渠道可通过推广员后台新增二级渠道;二级渠道由一级渠道管理开启权限,并由一级渠道给二级渠道结算,结算可到财务管理操作。</td></tr>
</table>-->
</div>
</div>
</div>
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
$('.back-btn').on('click', function () {
location.href = "{:U('Query/promoteQuota', ['parent_id' => I('parent_id'), 'time' => $time])}";
});
})
</script>
</block>

@ -1074,6 +1074,22 @@ CREATE TABLE `sys_document_pop_rules` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--广--
CREATE TABLE `tab_sociaty_games` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`promote_id` int(11) NOT NULL COMMENT '会长ID',
`game_id` int(11) NOT NULL COMMENT '游戏ID',
`status` tinyint(1) NOT null DEFAULT '0' COMMENT '状态 0 禁用 1 启用',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT '工会授权游戏';
----
ALTER TABLE `tab_game`
ADD COLUMN `apply_auth` INT(11) NULL DEFAULT '1' COMMENT '申请权限(1为全部可申请2为部分会长可申请)' AFTER `game_detail_cover`;
-- 2020-01-14
-- cxj
ALTER TABLE `tab_promote_game_ratio`
@ -1114,7 +1130,7 @@ ADD COLUMN `auto_review_withdraw_updated_time` int(10) NOT NULL DEFAULT 0 COMMEN
ALTER TABLE `tab_promote`
ADD INDEX `auto_review_withdraw_status`(`auto_review_withdraw_status`) USING BTREE;
-- 奖罚记录
-- 2020-02-10 yulingwei 奖罚记录
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惩罚',
@ -1148,6 +1164,8 @@ CREATE TABLE `tab_company_info` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='内部公司信息';
-- 2020-02-10 liaojinling 会长押金
CREATE TABLE `tab_president_deposit` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`promote_id` varchar(60) NOT NULL COMMENT '会长ID',
@ -1165,3 +1183,12 @@ CREATE TABLE `tab_president_deposit` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会长押金';
-- 2020-02-10 yulingwei 推广工会管理 新增属性类型
ALTER TABLE `tab_promote_belong`
MODIFY COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '工会归属0-内团1-外团 2-分发联盟 3 无' AFTER `verify_status`,
MODIFY COLUMN `company_relation` tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '工会关系0-自主开发及维护1-只维护 2 无' AFTER `company_belong`;
ADD COLUMN `company_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '工会类型 1公司 2个人' AFTER `can_view_recharge`;
-- 2020-02-10 cxj 推广提现--新增审核模式
ALTER TABLE `tab_withdraw`
ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式1-人工审核 2-自动审核';

Loading…
Cancel
Save