Merge branch 'master' of 47.111.118.107:wmtx/platform into hotfix/market_percentage

master
zhengyongxing 5 years ago
commit 114e51ebe2

@ -4,6 +4,16 @@ namespace Admin\Controller;
class CompanyRelationController extends AdminController
{
/**
* @var 默认甲方公司类型
*/
const COMPANY_TYPE_DEFAULT_A = '0';
/**
* @var 默认甲方公司类型
*/
const COMPANY_TYPE_DEFAULT_B = '2';
public $admininfo;
public $DBModel;
public $DBlogModel;
@ -26,6 +36,7 @@ class CompanyRelationController extends AdminController
"2"=>"月结"
];
public $InvoiceType=[
"0"=>"无",
"1"=>"专票",
"2"=>"普票"
];
@ -379,7 +390,9 @@ class CompanyRelationController extends AdminController
$this->ajaxReturn(["msg"=>"添加成功","code"=>1,"url"=>U("lists")]);
} else {
$this->assign('companyType',$this->CompanyType);
$this->assign('defaultCompanyTypeA', self::COMPANY_TYPE_DEFAULT_A);
$this->assign('defaultCompanyTypeB', self::COMPANY_TYPE_DEFAULT_B);
$this->assign('companyType', $this->CompanyType);
$this->display();
}
}

@ -383,9 +383,11 @@ class CompanyStatementController extends ThinkController
$data['receive_company'] = $data['first_party_info'];
$data['pay_company'] = $data['second_party_info'];
}
if($data['receive_company']['invoice_type'] == 1){
if($data['receive_company']['invoice_type'] == 0){
$data['receive_company']['invoice_type']="无";
} elseif($data['receive_company']['invoice_type'] == 1){
$data['receive_company']['invoice_type']="专票";
}else{
} else{
$data['receive_company']['invoice_type']="普票";
}
if ($data['company_belong'] == 9) {//上游

@ -157,8 +157,8 @@ class ExportController extends Controller
$adminList = getMarketAdminsByPromoteIds(array_column($xlsData, 'promote_id'));
foreach($xlsData as $value) {
$value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无';
($value['promote_account']=='官方渠道'||$value['promote_account']=='自然注册')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['market_admin_username'] = isset($adminList[$value['promote_id']]) && $adminList[$value['promote_id']]['admin'] ? $adminList[$value['promote_id']]['admin']['username'] : '无';
$value['create_time'] = date("Y-m-d H:i:s",$value['create_time']);
$value['play_time'] = date("Y-m-d H:i:s",$value['play_time']);
mb_convert_variables('GBK', 'UTF-8', $value);
@ -3582,14 +3582,10 @@ class ExportController extends Controller
}
private function promote_statistics_export($p=0){
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$arraypage=$page;
$row = 10;
$user=M('User','tab_');
if(isset($_REQUEST['timestart'])&&isset($_REQUEST['timeend'])){
$map['register_time'] =array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1));
unset($_REQUEST['timestart']);unset($_REQUEST['timeend']);
if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
$map['register_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
} elseif (!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) {
$map['register_time'] = ['between', array(strtotime($_REQUEST['timestart']), time())];
unset($_REQUEST['timestart']);
@ -3597,104 +3593,157 @@ class ExportController extends Controller
$map['register_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
unset($_REQUEST['timeend']);
}
// if(isset($_REQUEST['start'])&&isset($_REQUEST['end'])){
// $map['register_time'] =array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
// unset($_REQUEST['start']);unset($_REQUEST['end']);
// }
$play_info_map = '';
//TODO:应需求取消玩家表只要user表的fgame有就算注册无需在play表存在
$play_map = false;
if (isset($_REQUEST['game_name'])) {
$map['fgame_name'] = $_REQUEST['game_name'];
$play_info_map .= " and upi.game_name = '{$_REQUEST['game_name']}' ";
unset($_REQUEST['game_name']);
// $play_map = " and up.game_name = '{$_REQUEST['game_name']}' ";
}
$play_info_map = false;
if (isset($_REQUEST['server_id'])) {
$play_info_map .= " and upi.server_name = '{$_REQUEST['server_id']}' ";
$play_map = false; //有区服就不检索玩家表,有区服一定已经选择游戏了
$play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name = '{$_REQUEST['game_name']}'";
}
$today=total(1);
$week=total(2);
$mounth=total(3);
$today = total(1);
$week = total(2);
$mounth = total(3);
if (isset($_REQUEST['promote_id'])) {
$map['tp1.id'] = $_REQUEST['promote_id'];
} else {
$map['tp1.chain'] = '/';
$promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select();
if ($promoter_ids) {
$map['u.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
}
}
if (!empty($_REQUEST['admin_id'])) {
$map['promote.admin_id'] = $_REQUEST['admin_id'];
}
//为数据权限添加
setPowerPromoteIds($map, 'u.promote_id');
$data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_user as u on tp2.id = u.promote_id", 'left')
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->where($map)
->group('tp1.id')
->order('count desc, register_time')
->select();
unset($map['tp1.id']);
unset($map['tp1.chain']);
$map['promote_id'] = 0;
//如果有官方渠道权限
$user_auth_promote_ids = session('user_auth_promote_ids');
if ($user_auth_promote_ids == 'all' || in_array('0', explode(",", $user_auth_promote_ids))) {
//官方渠道数据添加
$authorityData = M('user', 'tab_')->alias('u')
->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time,
count(id) as count,
count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth')
// 如果是市场专员那么只能看自己的
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$map['promote.admin_id'] = is_login();
}
$data = M("User u","tab_")
->field("count(u.id) as count,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->join("tab_promote promote ON u.promote_id = promote.id","left")
->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false)
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->join('tab_game on u.fgame_id = tab_game.id')
->where($map)
->find();
->group('id')
->order('count desc, register_time')
->select();
//今日/本周/本月不变
$tmap = $map;
if(isset($tmap['register_time'])){
//获取最大最小
$tweek = total(2,false);
$tmonth = total(3,false);
//获取最小
$tmin = 0;
if($tweek[1][0] < $tmonth[1][0]){
$tmin = $tweek[1][0];
}else{
$tmin = $tmonth[1][0];
}
$tmap['register_time'] = ['between', array($tmin,$tmonth[1][1])];
}
$tdata = M("User u","tab_")
->field("count(IF(register_time {$today},1,null)) as today,
count(IF(register_time {$week},1,null)) as week,
count(IF(register_time {$mounth},1,null)) as mounth,
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->join("tab_promote promote ON u.promote_id = promote.id","left")
->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false)
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->where($tmap)
->group('id')
->order('register_time')
->select();
$tmdata = [];
foreach($data as $k=>$v){
$v['today'] = 0;
$v['week'] = 0;
$v['mounth'] = 0;
$tmdata[$v['id']] = $v;
}
if(!empty($tdata)){
foreach ($tdata as $k => $v) {
$tmdata[$v['id']]['today'] = $v['today'];
$tmdata[$v['id']]['week'] = $v['week'];
$tmdata[$v['id']]['mounth'] = $v['mounth'];
$tmdata[$v['id']]['id'] = $v['id'];
}
}
$authorityData['promote_account'] = C('OFFICIEL_CHANNEL');
$authorityData['id'] = "1";
if (isset($_REQUEST['promote_id'])||$authorityData['count']==0) {
$authorityData = [];
} else {
array_push($data, $authorityData);
if(count($tmdata) >0){
//获取推广员
$idstr = implode(",",array_keys($tmdata));
$promoteRes = M("Promote","tab_")->field("id,account promote_account")->where("id in ({$idstr})")->select();
foreach($promoteRes as $k=>$v){
$tmdata[$v['id']]['promote_account'] = $v['promote_account'];
}
}
//数据排序
$data = [];
foreach($tmdata as $k => $v){
if($v['id'] == 0){
$v['promote_account'] = C('OFFICIEL_CHANNEL');
}
$data[] = $v;
}
unset($map['tp1.id']);
unset($map['tp1.chain']);
unset($tmap['tp1.id']);
unset($tmap['tp1.chain']);
$map['u.promote_id'] = 0;
$tmap['u.promote_id'] = 0;
$authorityData['count'] = 0;
//数据排序
$last_names = array_column($data,'count');
array_multisort($last_names,SORT_DESC,$data);
// var_dump($data);die();
$count=count($data);
$count = count($data);
foreach ($data as $key => $value) {
static $i=0;
$i++;
$data[$key]['rand']=$i;
static $i = 0;
$i++;
$data[$key]['rand'] = $i;
}
// foreach ($data as $key => $value) {
// if($data[$key]['promote_id']==0){
// unset($data[$key]);
// }
// }
$total=A('Platform')->data_total($data);
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);
}
if($count > $row){
$page = new \Think\Page($count, $row);
$page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$this->assign('_page', $page->show());
$total = $this->data_total($data);
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);
}
$data=my_sort($data,$data_order_type,(int)$data_order);
$size=$row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
$data = my_sort($data, $data_order_type, (int)$data_order);
//用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度)
// $data = array_slice($data, ($arraypage-1)*$size, $size);
$companys = !empty($data) ? M('promote', 'tab_')
->field('tab_promote.id, company_name, sys_member.nickname as admin_username')
->join("tab_promote_company on tab_promote.company_id = tab_promote_company.id", 'left')
->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left')
->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : [];
$companys = $companys ? array_column($companys, null, 'id') : [];
foreach ($data as &$item) {
$item['company_name'] = $companys[$item['id']]['company_name'] ?? '无';
$item['admin_username'] = $companys[$item['id']]['admin_username'] ?? '无';
}
$xlsName = $_REQUEST['xlsname']?$_REQUEST['xlsname']:'推广员注册统计';
$xlsCell = array(
array('promote_account', "推广员账号"),
array('company_name' , "公司"),
array('promote_account', "会长账号"),
array('admin_username' , "市场专员"),
//array('relation_game_name' , "游戏"),
array('count' , "累计注册"),
array('rand' , "排行榜"),
array('today' , "今日注册"),

@ -253,7 +253,7 @@ class FinancePromoteController extends AdminController
}
$adminId = 0;
$havingPids = [];
// $havingPids = [];
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
@ -263,10 +263,10 @@ class FinancePromoteController extends AdminController
$adminId = I('admin_id');
}
}
if ($adminId > 0) {
/* if ($adminId > 0) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
}
} */
if($type == "spend"){
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
@ -275,6 +275,9 @@ class FinancePromoteController extends AdminController
if($istimeselect){
$map['s.payed_time']=$istimeselect;
}
if ($adminId > 0) {
$map['s.market_admin_id'] = $adminId;
}
$map['s.pay_status']=1;
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
@ -288,16 +291,16 @@ class FinancePromoteController extends AdminController
->join("tab_promote promote ON s.promote_id = promote.id","left")
->join("tab_promote_company company ON promote.company_id = company.id","left")
->group('p_id');
if (count($havingPids) > 0) {
/* if (count($havingPids) > 0) {
$query->having('p_id in (' . implode(',', $havingPids) . ')');
}
} */
return $query->select();
}else{
if($istimeselect){
$map['s.create_time']=$istimeselect;
}
$adminId = 0;
$havingPids = [];
// $havingPids = [];
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
@ -308,8 +311,9 @@ class FinancePromoteController extends AdminController
}
}
if ($adminId > 0) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$map['promote.admin_id'] = $adminId;
// $havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
// $havingPids = count($havingPids) > 0 ? $havingPids : [0];
}
$map['s.status']=1;
$map['s.source_id']=0;
@ -322,9 +326,9 @@ class FinancePromoteController extends AdminController
->join("tab_promote promote ON s.promote_id = promote.id","left")
->join("tab_promote_company company ON promote.company_id = company.id","left")
->group('p_id');
if (count($havingPids) > 0) {
/* if (count($havingPids) > 0) {
$query->having('p_id in (' . implode(',', $havingPids) . ')');
}
} */
return $query->select();
}
@ -517,13 +521,6 @@ class FinancePromoteController extends AdminController
->join("tab_promote_company company ON promote.company_id = company.id", "left")
->group('promote_id');
$havingPids = [];
if ($adminId > 0) {
$topIds = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = getPromoteIdsByTopIds($topIds);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$query->having('promote_id in (' . implode(',', $havingPids) . ')');
}
return $query->select();
}else{
if($istimeselect){
@ -544,9 +541,12 @@ class FinancePromoteController extends AdminController
}
$isMarketLeader = isMarketLeader();
if ($isMarketLeader) {
if ($adminId > 0) {
$map['promote.admin_id'] = $adminId;
} elseif ($isMarketLeader) {
$map['promote.admin_id'] = ['gt', 0];
}
$field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount,
IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,IFNULL(promote.company_belong,0) company_belong";
$query = M("promote_coin s","tab_")
@ -556,13 +556,13 @@ class FinancePromoteController extends AdminController
->join("tab_promote_company company ON promote.company_id = company.id", "left")
->group('promote_id');
$havingPids = [];
/* $havingPids = [];
if ($adminId > 0) {
$topIds = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = getPromoteIdsByTopIds($topIds);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$query->having('promote_id in (' . implode(',', $havingPids) . ')');
}
} */
return $query->select();
}
}
@ -857,6 +857,21 @@ class FinancePromoteController extends AdminController
private function gameStatisticsData($map, $row = 0, $page = 1)
{
$adminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
if ($adminId > 0) {
$map['s.market_admin_id'] = $adminId;
}
$map['s.pay_status']=1;
$query = M("spend","tab_")->alias("s")
->field("s.game_id,s.game_name,s.sdk_version,p.partner as partner_name,
@ -875,6 +890,17 @@ class FinancePromoteController extends AdminController
if ($row != 0) {
$query = $query->page($page,$row);
}
$data = $query->select(false);
$data = M()
->table("(".$data.") a")
->field("a.*,IFNULL(promote.account,'官方渠道') account")
->join("tab_promote promote ON a.p_id = promote.id","left")
->select();
return $data;
}
private function totalGameStatisticsData($map, $join = true)
{
$adminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
@ -885,23 +911,11 @@ class FinancePromoteController extends AdminController
$adminId = I('admin_id');
}
}
$havingPids = [];
if ($adminId > 0) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$query->having('p_id in (' . implode(',', $havingPids) . ')');
$map['s.market_admin_id'] = $adminId;
}
$data = $query->select(false);
$data = M()
->table("(".$data.") a")
->field("a.*,IFNULL(promote.account,'官方渠道') account")
->join("tab_promote promote ON a.p_id = promote.id","left")
->select();
return $data;
}
private function totalGameStatisticsData($map, $join = true)
{
$query = M("spend","tab_")->alias("s")
->field("SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,

@ -135,6 +135,13 @@ class GiftbagController extends ThinkController {
// var_dump($data);die();
if($data){
$data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']);
$noviceList = explode(',', $data['novice']);
$noviceList = array_filter($noviceList, function ($value) {
return $value != '';
});
$data['novice'] = implode(',', $noviceList);
$data['server_name']=get_server_name($data['server_id']);
$data['novice_num'] = count(explode(',',$data['novice']));
$Model->add($data);
@ -194,6 +201,13 @@ class GiftbagController extends ThinkController {
if($data){
$data['novice'] = str_replace(array("\r\n", "\r", "\n"), ",", $_POST['novice']);
$noviceList = explode(',', $data['novice']);
$noviceList = array_filter($noviceList, function ($value) {
return $value != '';
});
$data['novice'] = implode(',', $noviceList);
$data['novice_num'] = count(explode(',',$data['novice']));
$Model->save($data);
addOperationLog(array(

@ -118,7 +118,6 @@ class MendController extends ThinkController {
public function edit($id = null)
{
if (IS_POST) {
$promoteService = new PromoteService();
if ($_POST['prmoote_id_to'] == -1){
@ -137,8 +136,12 @@ class MendController extends ThinkController {
// if(self::checkSettlement(strtotime($_POST['order_time']),$_POST['promote_id'])){
// $this->error('在订单日期内含有已经结算的订单,无法补链');
// }
if(self::checkSpend(strtotime($_POST['order_time']),$_POST['account'])){
$this->error("在订单日期内含有已经结算的订单,无法补链。如订单:{$this->tempid}");
// if(self::checkSpend(strtotime($_POST['order_time']),$_POST['account'])){
// $this->error("在订单日期内含有已经结算的订单,无法补链。");
// }
if(self::checkOrderTime(strtotime($_POST['order_time']))){
$this->error('仅能补链本周数据,请重新选择补链时间');
}
if(self::checkPromote(strtotime($_POST['order_time']),$_POST['account'])){
$this->error('在订单日期内含有多个推广员,无法补链');
@ -178,20 +181,35 @@ class MendController extends ThinkController {
$this->error($res['msg']);
}
} else {
$user = A('User', 'Event');
$user_data = $user->user_entity($id);
$user_data || $this->error("用户数据异常");
// echo 1;die();
$map['id'] = $id;
$data = M("user","tab_")->where($map)->find();
// $user = A('User', 'Event');
// $user_data = $user->user_entity($id);
// $user_data || $this->error("用户数据异常");
// var_dump($user_data);die;
$this->assign("data", $user_data);
$this->assign("data", $data);
$this->meta_title = '编辑推广补链';
$this->m_title = '推广补链';
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Mend/lists','status'=>1])->find());
$this->m_title = '推广补链';
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Mend/lists','status'=>1])->find());
$this->display();
}
}
private function checkOrderTime($order_time){
$sdefaultDate = date("Y-m-d");
$first=1;//周一开始
$w=date('w',strtotime($sdefaultDate));
$checktime=strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days'); //本周开始时间
if($order_time >= $checktime){
//在本周允许换绑
return false;
}
return true;
}
/**
* 2020.1.3 之后判断订单是否已经结算
*/
@ -200,42 +218,51 @@ class MendController extends ThinkController {
$map = array(
"pay_status"=>1,
"user_account"=>$account,
"pay_time"=>array("EGT",$order_time)
"payed_time"=>array("EGT",$order_time)
);
$spendlist = M("Spend","tab_")->field("id,selle_status,pay_order_number")->where($map)->select();
if(count($spendlist) < 1){
//无流水可换绑
return false;
}
//获取所有未审核
$withmap = array(
"status"=>0,
"settlement_begin_time"=>array("EGT",$order_time),
"settlement_end_time"=>array("ELT",$order_time)
);
$withspendlist = M("withdraw","tab_")->field("spend_ids")->select();
//获取结算方式
$c_id = M("User","tab_")
->alias('a')
->field("IFNULL(p.company_id,0) company_id")
->join('tab_promote p ON a.promote_id= p.id')
->where("a.account = '{$account}'")
->find();
$dsh_list = false;
if(!empty($withspendlist)){
//获取所有涉及订单
foreach ($withspendlist as $value) {
$dsh_list .= (','.$value['spend_ids']);
}
if(empty($c_id) || $c_id['company_id'] == 0){
//官方渠道不结算,可换绑
return false;
}
if($dsh_list){
$dsh_list = array_flip(explode(",",$dsh_list));
$c_id = $c_id['company_id'];
$r = M("CompanyRelation","tab_")->where("(first_company_type = 2 AND first_company_id = '{$c_id}') OR (second_company_type = 2 AND second_company_id = '{$c_id}')")->find();
if(empty($r) || $r['settlement_type'] == 0){
//不结算的公司允许换绑
return false;
}
foreach($spendlist as $k=>$v){
if($v['selle_status'] == 1){
$this->tempid = $v['pay_order_number'];
return true; //有已结算
}
if($dsh_list && $dsh_list[$v['id']]){
$this->tempid = $v['pay_order_number'];
return true; //有待审核的
}
$checktime = 0;
if($r['settlement_type'] == 1){
//周结
$sdefaultDate = date("Y-m-d");
$first=1;
$w=date('w',strtotime($sdefaultDate));
$checktime=strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days'); //本周开始时间
}else{
//月结
$y = date("Y", time()); //年
$m = date("m", time()); //月
$checktime = mktime(0, 0, 0, $m, 1, $y); // 本月开始时间
}
return false;
if($order_time >= $checktime){
//未在结算期内,允许换绑
return false;
}
//其他情况不允许换绑
return true;
}
/**

@ -446,6 +446,10 @@ class PlatformController extends ThinkController
$play_info_map = " and upi.server_id = '{$_REQUEST['server_id']}' and upi.game_name = '{$_REQUEST['game_name']}'";
}
if (!empty($_REQUEST['admin_id'])) {
$map['promote.admin_id'] = $_REQUEST['admin_id'];
}
$today = total(1);
$week = total(2);
$mounth = total(3);
@ -456,13 +460,23 @@ class PlatformController extends ThinkController
$map['u.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
}
}
// 如果是市场专员那么只能看自己的会长信息
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$map['promote.admin_id'] = is_login();
}
//为数据权限添加
setPowerPromoteIds($map, 'u.promote_id');
$data = M("User u","tab_")
->field("count(u.id) as count,IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',u.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) id")
->join("tab_promote promote ON u.promote_id = promote.id","left")
->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false)
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->join('tab_game on u.fgame_id = tab_game.id')
->where($map)
->group('id')
->order('count desc, register_time')
@ -491,6 +505,7 @@ class PlatformController extends ThinkController
->join("tab_promote promote ON u.promote_id = promote.id","left")
->join($play_map ? "tab_user_play as up on up.user_id = u.id " . $play_map : false)
->join($play_info_map ? "tab_user_play_info as upi on upi.user_id = u.id " . $play_info_map : false)
->join('tab_game on u.fgame_id = tab_game.id')
->where($tmap)
->group('id')
->order('register_time')
@ -539,7 +554,7 @@ class PlatformController extends ThinkController
$count = count($data);
foreach ($data as $key => $value) {
static $i = 0;
$i++;
$i++;
$data[$key]['rand'] = $i;
}
@ -563,9 +578,21 @@ class PlatformController extends ThinkController
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
//用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度)
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$companys = !empty($data) ? M('promote', 'tab_')
->field('tab_promote.id, company_name, sys_member.nickname as admin_username')
->join("tab_promote_company on tab_promote.company_id = tab_promote_company.id", 'left')
->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left')
->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : [];
$companys = $companys ? array_column($companys, null, 'id') : [];
foreach ($data as &$item) {
$item['company_name'] = $companys[$item['id']]['company_name'] ?? '无';
$item['admin_username'] = $companys[$item['id']]['admin_username'] ?? '无';
}
$this->meta_title = '渠道注册统计列表';
$this->assign("is_admin",is_administrator());
$this->assign('list_data', $data);
$this->assign('admin_users', M('member')->field('uid,nickname')->select());
$this->assign('total', $total);
$this->display();
}
@ -601,7 +628,7 @@ class PlatformController extends ThinkController
$map['pay_time'] = ['between', array(0, time())];
// $pay_time = " between 0 and " . time();
}
$map1['pay_status'] = $map['pay_status'] = 1;
$map1['s.pay_status'] = $map['s.pay_status'] = 1;
$today = total(1);
$week = total(2);
$mounth = total(3);
@ -616,17 +643,18 @@ class PlatformController extends ThinkController
}else{
$tmin = $tmonth[1][0];
}
//为数据权限添加
setPowerPromoteIds($map, 'tp1.id');
if (isset($_REQUEST['promote_id'])) {
$map['tp1.id'] = $_REQUEST['promote_id'];
//$map['tp1.id'] = $_REQUEST['promote_id'];
$promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select();
if ($promoter_ids) {
$map['tp1.id'] = $_REQUEST['promote_id'];
$map['tp2.id'] = ['in', implode(',', array_column($promoter_ids, 'id'))];
}
} else {
$map['tp1.chain'] = '/';
}
if (isset($_REQUEST['game_name'])) {
$map['s.game_name'] = $_REQUEST['game_name'];
if (isset($_REQUEST['server_id'])) {
@ -635,20 +663,47 @@ class PlatformController extends ThinkController
}
}
if (isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])) {
$data = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id,
floor(sum(pay_amount)*100) as count')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left')
->where($map)
->group('tp1.id')
->order('count desc')
->select();
if (isMarketAdmin()) {
$map['s.market_admin_id'] = is_login();
} else if (!empty($_REQUEST['admin_id'])) {
$map['s.market_admin_id'] = $_REQUEST['admin_id'];
} else {
$statisticsMap['time'] =$map['pay_time'];
$data = M('promote_statistics', 'tab_')->field("promote_account,promote_id as id,sum(count) count")->where($statisticsMap)->group("promote_id")->select();
}
//为数据权限添加
setPowerPromoteIds($map, 'tp1.id');
}
$data = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id,
floor(sum(pay_amount)*100) as count')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left')
->join("tab_game as g on g.id = s.game_id", 'left')
->where($map)
->group('tp1.id')
->order('count desc')
->select();
// if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])||isset($_REQUEST['admin_id'])||isset($_REQUEST['admin_user_id'])) {
// $data = M('promote', 'tab_')->alias('tp1')
// ->field('tp1.account as promote_account,tp1.id,
// floor(sum(pay_amount)*100) as count')
// ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
// ->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left')
// ->join("tab_game as g on g.id = s.game_id", 'left')
// ->where($map)
// ->group('tp1.id')
// ->order('count desc')
// ->select();
// } else {
// $statisticsMap['time'] =$map['pay_time'];
// setPowerPromoteIds($statisticsMap, 'tab_promote.id');
// $data = M('promote_statistics', 'tab_')
// ->field("promote_account,promote_id as id,sum(count) count")
// ->join('tab_promote on tab_promote.id = tab_promote_statistics.promote_id', 'left')
// ->where($statisticsMap)
// ->group("promote_id")
// ->select();
// }
// var_dump($data);die();
@ -664,6 +719,7 @@ class PlatformController extends ThinkController
floor(sum(IF(s.pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->join("tab_spend as s on tp2.id = s.promote_id", 'left')
->join("tab_game as g on g.id = s.game_id", 'left')
->where($tmap)
->group('tp1.id')
->select();
@ -674,6 +730,7 @@ class PlatformController extends ThinkController
$v['mounth'] = 0;
$tmdata[$v['id']] = $v;
}
//dd($data);
foreach ($tdata as $k => $v) {
$tmdata[$v['id']]['today'] = $v['today'];
@ -683,16 +740,18 @@ class PlatformController extends ThinkController
$tmdata[$v['id']]['promote_account'] = $v['promote_account'];
$tmdata[$v['id']]['count'] = 0;
}
$tmdata[$v['id']]['id'] = $v['id'];
}
$data = [];
foreach($tmdata as $k => $v){
$data[] = $v;
}
// dd($data);
unset($map['tp1.id']);
//dd($data);
unset($map['tp1.id'], $map['tp2.id'], $map['tp2.admin_id']);
unset($map['tp1.chain']);
unset($tmap['tp1.id']);
unset($tmap['tp1.chain']);
unset($tmap['tp1.chain'], $tmap['tp2.id']);
$map['s.promote_id'] = 0;
$tmap['s.promote_id'] = 0;
$authorityData['count'] = 0;
@ -760,7 +819,17 @@ class PlatformController extends ThinkController
$data = my_sort($data, $data_order_type, (int)$data_order);
$size = $row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
$companys = !empty($data) ? M('promote', 'tab_')
->field('tab_promote.id, company_name, sys_member.nickname as admin_username')
->join("tab_promote_company on tab_promote.company_id = tab_promote_company.id", 'left')
->join('sys_member on tab_promote.admin_id = sys_member.uid', 'left')
->where("tab_promote.id in (".implode(',', array_column($data, 'id')).")")->select() : [];
$companys = $companys ? array_column($companys, null, 'id') : [];
foreach ($data as &$item) {
$item['company_name'] = $companys[$item['id']]['company_name'] ?? '无';
$item['admin_username'] = $companys[$item['id']]['admin_username'] ?? '无';
}
if(isset($_REQUEST['export'])){
$GetData = $_GET;
@ -769,7 +838,9 @@ class PlatformController extends ThinkController
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'导出推广员充值统计','url'=>U('Platform/promotepay_statistics',$GetData),'menu'=>'统计-统计-推广员统计-推广员充值统计']);
data2csv($data,'推广员充值统计',array(
"promote_account"=>"推广员账号",
'company_name' => '公司',
"promote_account"=>"会长账号",
'admin_username' => '当前市场专员',
"count"=>"累计充值",
"rand"=>"排行榜",
"today"=>"今日充值",
@ -783,6 +854,7 @@ class PlatformController extends ThinkController
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->meta_title = '渠道充值统计列表';
$this->assign('list_data', $data);
$this->assign('admin_users', M('member')->field('uid,nickname')->select());
$this->assign("is_admin",is_administrator());
$this->display();

@ -72,26 +72,19 @@ class SpendController extends ThinkController
unset($_REQUEST['pay_game_status']);
}
$marketAdminId = I('market_admin_id', 0);
if ($marketAdminId) {
$map['market_admin_id'] = $marketAdminId;
}
$marketAdminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$map['market_admin_id'] = $userAuth['uid'];
$marketAdminId = $userAuth['uid'];
} else {
$marketAdminId = I('market_admin_id', 0);
}
if ($marketAdminId > 0) {
$map['market_admin_id'] = $marketAdminId;
} else {
setPowerPromoteIds($map,'promote_id');
}
// $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);
// }
setPowerPromoteIds($map,'promote_id');
if (isset($_REQUEST['promote_id'])) {
$promoteId = intval($_REQUEST['promote_id']);

@ -288,7 +288,7 @@ class UserController extends AdminController
$User = new UserApi;
$uid = $User->register($username, $password, $email, $second_pwd);
if (0 < $uid) { //注册成功
$user = array('uid' => $uid,'realname'=>$real_name, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
$user = array('uid' => $uid,'real_name'=>$real_name, 'nickname' => $username, 'status' => 1,"birthday"=>date('Y-m-d',time()));
$data['uid'] = $uid;
$data['group_id'] = I('auth');
M('auth_group_access')->data($data)->add();

@ -157,9 +157,11 @@ class VerifyBillController extends Controller {
$data['receive_company'] = $data['first_party_info'];
$data['pay_company'] = $data['second_party_info'];
}
if($data['receive_company']['invoice_type'] == 1){
if($data['receive_company']['invoice_type'] == 0){
$data['receive_company']['invoice_type']="无";
} elseif ($data['receive_company']['invoice_type'] == 1) {
$data['receive_company']['invoice_type']="专票";
}else{
} else {
$data['receive_company']['invoice_type']="普票";
}
if ($data['company_belong'] == 9) {//上游

@ -406,7 +406,7 @@ class PromoteModel extends Model{
$where['level'] = $level;
$userAuth = session('user_auth');
setPowerPromoteIds($where,'id');
// setPowerPromoteIds($where,'id');
$offcialData = [0=>['id'=>0,'nickname'=>C('OFFICIEL_CHANNEL')]];

@ -107,7 +107,7 @@
<select name="first_company_type" id="first_company_type" class="select_gallery">
<option value="">请选择甲方公司类型</option>
<volist name="companyType" id="vo">
<option value="{$key}">{$vo}</option>
<option value="{$key}" <?php if($defaultCompanyTypeA == $key):?>selected<?php endif;?>>{$vo}</option>
</volist>
</select>
<span class="notice-text"></span>
@ -142,7 +142,7 @@
<select name="second_company_type" id="second_company_type" class="select_gallery">
<option value="">请选择乙方公司类型</option>
<volist name="companyType" id="vo">
<option value="{$key}">{$vo}</option>
<option value="{$key}" <?php if($defaultCompanyTypeB == $key):?>selected<?php endif;?>>{$vo}</option>
</volist>
</select>
<span class="notice-text"></span>
@ -175,8 +175,8 @@
<td class="l"><i class="mustmark">*</i>结算周期:</td>
<td class="r">
<select name="settlement_type" id="settlement_type" class="select_gallery">
<option value="0" selected></option>
<option value="1">周结</option>
<option value="0"></option>
<option value="1" selected>周结</option>
<option value="2">月结</option>
</select>
<span class="notice-text"></span>
@ -186,7 +186,8 @@
<td class="l"><i class="mustmark">*</i>开票类型:</td>
<td class="r">
<select name="invoice_type" id="invoice_type" class="select_gallery">
<option value="1" selected>专票</option>
<option value="0" selected></option>
<option value="1">专票</option>
<option value="2">普票</option>
</select>
<span class="notice-text"></span>
@ -333,10 +334,15 @@ $(function(){
first_company = data.info;
var companystr = '<option value="">'+typename+'</option>';
for (var i in first_company) {
companystr += "<option value='" + first_company[i].id + "'>" + first_company[i].company_name + "</option>"
var selected = ''
if (first_company[i].company_name == '福建金菠菜网络科技有限公司') {
selected = 'selected'
}
companystr += "<option value='" + first_company[i].id + "' " + selected + ">" + first_company[i].company_name + "</option>"
}
$("#first_company_id").html(companystr);
$("#first_company_id").select2();
$("#first_company_id").change();
})
})
$("#first_company_id").on("change",function(){
@ -349,6 +355,7 @@ $(function(){
$("#first_company_name").val(companyinfo.company_name);
$("#first_company_info").html(setCompanyInfo(companyinfo));
});
$("#first_company_type").change();
$("#second_company_type").on("change",function(){
//置空
@ -369,6 +376,7 @@ $(function(){
$("#second_company_id").select2();
})
})
$("#second_company_type").change();
$("#second_company_id").on("change",function(){
var id = $(this).find("option:selected").val();
//获取基础信息

@ -163,6 +163,7 @@
<td class="l"><i class="mustmark">*</i>开票类型:</td>
<td class="r">
<select name="invoice_type" id="invoice_type" class="select_gallery">
<option value="0" <if condition="$data['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['invoice_type'] eq 2">selected</if>>普票</option>
</select>

@ -274,6 +274,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select>

@ -269,6 +269,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select>
@ -351,10 +352,18 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" data-change="${type}.invoice_type" class="select_gallery">
{@if party_info.invoice_type==0}
<option value="0" selected></option>
<option value="1">专票</option>
<option value="2">普票</option>
{@/if}
{@if party_info.invoice_type==1}
<option value="0"></option>
<option value="1" selected>专票</option>
<option value="2">普票</option>
{@else}
{@/if}
{@if party_info.invoice_type==2}
<option value="0"></option>
<option value="1">专票</option>
<option value="2" selected>普票</option>
{@/if}

@ -289,6 +289,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select>

@ -274,6 +274,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select>

@ -269,6 +269,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select>
@ -351,10 +352,18 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" data-change="${type}.invoice_type" class="select_gallery">
{@if party_info.invoice_type==0}
<option value="0" selected></option>
<option value="1">专票</option>
<option value="2">普票</option>
{@/if}
{@if party_info.invoice_type==1}
<option value="0"></option>
<option value="1" selected>专票</option>
<option value="2">普票</option>
{@else}
{@/if}
{@if party_info.invoice_type==2}
<option value="0"></option>
<option value="1">专票</option>
<option value="2" selected>普票</option>
{@/if}

@ -289,6 +289,7 @@
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="invoice_type" name="invoice_type" class="select_gallery" disabled>
<option value="0" <if condition="$data['payinfo']['invoice_type'] eq 0">selected</if>>无</option>
<option value="1" <if condition="$data['payinfo']['invoice_type'] eq 1">selected</if>>专票</option>
<option value="2" <if condition="$data['payinfo']['invoice_type'] eq 2">selected</if>>普票</option>
</select>

@ -194,7 +194,7 @@
<tr>
<th>推广公司</th>
<th>会长账号</th>
<th>所属市场专员</th>
<th>当前所属市场专员</th>
<th>团体类型</th>
<th>开发类型</th>
<th >游戏</th>

@ -183,7 +183,7 @@
<tr>
<th>推广公司</th>
<th>会长渠道</th>
<th>所属市场专员</th>
<th>当前所属市场专员</th>
<th>内外团</th>
<th>开发类型</th>
<th class="tooltip"><a class="paixu" data-order='cash_count'>

@ -174,7 +174,7 @@
<tr>
<th>推广公司</th>
<th>推广员账号</th>
<th>所属市场专员</th>
<th>当前所属市场专员</th>
<th>团体类型</th>
<th>开发类型</th>

@ -87,7 +87,7 @@
<tr>
<td class="l noticeinfo">订单日期:</td>
<td class="r table_radio">
<input type="text" name="order_time" class="date" value="{:I('order_time')}" placeholder="订单日期" />
<input type="text" name="order_time" autocomplete="off" class="date" value="{:I('order_time')}" placeholder="订单日期" />
</td>
</tr>
<tr>

@ -53,14 +53,23 @@
</div>
</div>
<div class="input-list input-list-promote search_label_rehab">
<label>推广员账号:</label>
<label>会长账号</label>
<select id="promote_id" name="promote_id" class="select_gallery" style="width:150px;">
<option value="">推广员账号</option>
<option value="">会长账号</option>
<volist name=":get_all_toppromote()" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<label>市场专员:</label>
<select id="admin_id" name="admin_id" class="select_gallery" style="width:150px;">
<option value="">全部</option>
<volist name="admin_users" id="vo">
<option <if condition="$vo.uid eq I('admin_id')">selected</if>" value="{$vo.uid}">{$vo.nickname}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</option>
@ -89,8 +98,12 @@
<!-- 表头 -->
<thead>
<tr>
<th >公司</th>
<th >推广员账号</th>
<th >市场专员</th>
<th ><a class="paixu" data-order='count'><if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'count'">累计注册▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'count'"/>累计注册▼
<else />累计注册<img src="__IMG__/up-down.png" width="13px">
@ -130,11 +143,12 @@
</style>
<empty name="list_data" >
<tr>
<td colspan="6" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="9" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else />
<volist name="list_data" id="data">
<tr>
<td>{$data['company_name']}</td>
<td >
{$data['promote_account']}
<!-- <if condition="$data.promote_id1 gt 0">
@ -143,6 +157,7 @@
其他注册
</if> -->
</td>
<td>{$data['admin_username']}</td>
<td ><span class='ljzc' data-value="{$data['id']}"><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>
@ -153,7 +168,7 @@
</volist>
</empty>
<tr class="data_summary">
<td><span>汇总</span></td>
<td colspan="3"><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>---</td>
<td>{$total.sum_today}</td>
@ -167,7 +182,7 @@
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn" href="{:U('Export/promote_statistics',
array('timestart'=>$_GET['timestart'],'timeend'=>$_GET['timeend'],'promote_id'=>$_GET['promote_id'],p=>$_GET['p'],'xlsname'=>'统计_推广员统计_推广员注册统计',)
array('timestart'=>$_GET['timestart'],'timeend'=>$_GET['timeend'],'admin_id'=>$_GET['admin_id'],'promote_id'=>$_GET['promote_id'],p=>$_GET['p'],'game_name'=>$_GET['game_name'], 'game_type'=>$_GET['game_type'],'server_id'=>$_GET['server_id'],'xlsname'=>'统计_推广员统计_推广员注册统计',)
,false)}">导出</a>
</if>
{$_page|default=''}
@ -284,7 +299,7 @@
// endDate:date
})
$("#game_id").change(function(){
$("#game_id").change(function(){
$.ajax({
url:"{:U('getSpendServer')}",
type:"post",
@ -326,4 +341,4 @@
}
})
</script>
</block>
</block>

@ -54,12 +54,21 @@
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" style="width:150px;">
<option value="">推广员账号</option>
<option value="">会长账号</option>
<volist name=":get_all_toppromote()" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<label>当前市场专员:</label>
<select id="admin_id" name="admin_id" class="select_gallery" style="width:150px;">
<option value="">全部</option>
<volist name="admin_users" id="vo">
<option <if condition="$vo.uid eq I('admin_id')">selected</if>" value="{$vo.uid}">{$vo.nickname}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_id" name="game_name" class="select_gallery" style="width:120px;">
<option value="">游戏名称</option>
@ -103,7 +112,11 @@
<th ><a class="paixu" date-url='mzhuce'>本月充值</a></th>
</tr> -->
<tr>
<th >推广员账号</th>
<th >公司</th>
<th >会长账号</th>
<th >当前市场专员</th>
<th ><a class="paixu" data-order='count'><if condition="$userarpu_order eq 4 and $userarpu_order_type eq 'count'">累计充值▲
<elseif condition="$userarpu_order eq 3 and $userarpu_order_type eq 'count'"/>累计充值▼
@ -144,12 +157,14 @@
</style>
<empty name="list_data" >
<tr>
<td colspan="6" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="10" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else />
<volist name="list_data" id="data">
<tr>
<td>{$data['company_name']}</td>
<td >{$data['promote_account']}</td>
<td>{$data['admin_username']}</td>
<td ><span class='ljcz' data-value="{$data['promote_id']}"><a>{$data.count}</a></span></td>
<td ><strong><if condition="$data.rand eq 1"><span>{$data.rand}</span><elseif condition="$data.rand eq 2"/><span>{$data.rand}</span><elseif condition="$data.rand eq 3"/><span>{$data.rand}</span><else/>{$data.rand}</if></strong></td>
<td >{$data.today}</td>
@ -159,7 +174,7 @@
</volist>
</empty>
<tr class="data_summary">
<td><span>汇总</span></td>
<td colspan="3"><span>汇总</span></td>
<td ><span>{$total.sum_count}</span></td>
<td>---</td>
<td>{$total.sum_today}</td>
@ -352,7 +367,7 @@
pickerPosition:'bottom-left',
// endDate:date
})
$("#game_id").change(function(){
$("#game_id").change(function(){
console.log($("#game_id option:selected").attr('game-id'));
$.ajax({
url:"{:U('getSpendServer')}",
@ -396,4 +411,4 @@
}
})
</script>
</block>
</block>

@ -411,6 +411,46 @@ function set_pagination($count, $row,$request='') {
}
}
function set_pagination_all($count, $row,$request='') {
$aside = '<script>function pagechange(that){url = location.href.replace(".html","").replace(/(&|\/)row(=|\/)\d*/gi,"").replace(/\/p\/\d*/gi,"");if(url.indexOf("?")>0){url += "&row="+that.value;}else{url += "?row="+that.value;} window.location.href = url;}</script><select id="pagechange" name="row" onchange="pagechange(this)">';
if($row == 999999){
$aside .= '<option value="999999" selected>全部显示</option>';
}else{
$aside .= '<option value="999999">全部显示</option>';
}
if($row == 10){
$aside .= '<option value="10" selected>每页10条</option>';
}else{
$aside .= '<option value="10">每页10条</option>';
}
if($row == 50){
$aside .= '<option value="50" selected>每页50条</option>';
}else{
$aside .= '<option value="50">每页50条</option>';
}
if($row == 100){
$aside .= '<option value="100" selected>每页100条</option></select>';
}else{
$aside .= '<option value="100">每页100条</option></select>';
}
$count=$count?$count:0;
$row=$row?$row:10;
if ($count > $row) {
$page = new \Think\Page($count, $row,$request);
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$html = $page->show();
return str_replace('<div>','<div>' .$aside,$html);
} else {
return '<div>' .$aside. '<span class="rows">共 '.$count.' 条记录</span></div>';
}
}
function get_source_from_game($id=0) {
if (!is_numeric($id) || $id<1) {return '';}

@ -2111,7 +2111,7 @@ class QueryController extends BaseController
$timeout = 0;
$records = [];
if (intval($endTime - $beginTime) / (24 * 3600) <= 7) {
if (intval($endTime - $beginTime) / (24 * 3600) <= 31) {
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params);

@ -162,7 +162,7 @@
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<eq name='timeout' value='1'>
<script>
layer.msg('时间间隔不能超过7天');
layer.msg('时间间隔不能超过31天');
</script>
</eq>
<script type="text/javascript">

@ -112,4 +112,5 @@ return array(
'TMPL_EXCEPTION_FILE' => MODULE_PATH.'View/Public/exception.html',// 异常页面的模板文件
/*默认公司名称*/
'DEFAULT_COMPANY'=>"海南万盟天下科技有限公司",
'WEB_SITE_TITLE'=>"财务打款系统"
);

@ -0,0 +1,392 @@
<?php
namespace Payment\Controller;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class ExcelPaymentController extends BaseController
{
public $PayStatus=[
"-1"=>"打款失败",
"0"=>"未打款",
"1"=>"打款成功"
];
public $CompanyType = [
"1"=>"下游公司",
"2"=>"下游个人",
"3"=>"上游CP"
];
public $ALIRSP=[
"out_biz_no"=>"商户订单号",
"order_id"=>"支付订单号",
"pay_fund_order_id"=>"资金流水号",
"status"=>"转账状态",
"trans_date"=>"订单支付时间",
"msg"=>"支付信息",
"sub_msg"=>"失败描述",
"sub_code"=>"失败码",
"remark"=>"打款备注",
"code"=>"打款状态码"
];
public function _initialize()
{
$this->admininfo = session('payment_user');;
// $this->DBModel = M("CompanyStatementPool","tab_");
parent::_initialize();
}
public function lists()
{
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
$map=[
"_string"=>"1=1",
];
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$time_start = strtotime($_REQUEST['time_start']);
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(i.statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (i.statement_end_time BETWEEN {$time_start} AND {$time_end})";
} elseif (isset($_REQUEST['time_start'])) {
$time_start = strtotime($_REQUEST['time_start']);
$map["_string"] = "(i.statement_begin_time >= {$time_start} ) OR (i.statement_end_time >= {$time_start})";
} elseif (isset($_REQUEST['time_end'])) {
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(i.statement_begin_time <= {$time_end} ) OR (i.statement_end_time <= {$time_end})";
}
if (isset($_REQUEST['pay_time_start']) && isset($_REQUEST['pay_time_end'])) {
$map['i.pay_time'] = ['between', [strtotime($_REQUEST['pay_time_start']), strtotime($_REQUEST['pay_time_end']) + 86399]];
} elseif (isset($_REQUEST['pay_time_start'])) {
$map['i.pay_time'] = ['EGT', strtotime($_REQUEST['pay_time_start'])];
} elseif (isset($_REQUEST['pay_time_end'])) {
$map['i.pay_time'] = ['ELT', strtotime($_REQUEST['pay_time_end']) + 86399];
}
if(isset($_REQUEST['company_name'])){
$map['i.company_name'] = ['LIKE',"%".$_REQUEST['company_name']."%"];
}
if(isset($_REQUEST['pay_status'])){
$map['i.pay_status'] = $_REQUEST['pay_status'];
}
if(isset($_REQUEST['batch_num'])){
$map['i.batch_num'] = ["LIKE","%{$_REQUEST['batch_num']}%"];
}
$CompanyInfo = M("excel_statement_info","tab_")
->alias('i')
->field("i.*")
->where($map)
->page($page,$row)
->order("FIELD(pay_status,0,-1,1)")
->select();
foreach($CompanyInfo as $k=>&$v){
$v['can_pay'] = 1;
if($v['pay_status'] == 1){ $v['can_pay'] = 0; }
if($v['statement_money'] < 0.1){ $v['can_pay'] = 0; }
$v['company_type'] = $this->CompanyType[$v['company_type']];
$v["pay_status_str"] = $this->PayStatus[$v['pay_status']];
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
// $v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
// $v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
if(empty($v['pay_time'])){
$v['pay_time'] = "--";
}else{
$v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']);
}
// $v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
}
//统计待打款金额
$field = "IFNULL(SUM(CASE WHEN pay_status = 1 THEN statement_money ELSE 0 END),0) as success_money,
IFNULL(SUM(CASE WHEN pay_status = 0 THEN statement_money ELSE 0 END),0) as statement_money,
IFNULL(SUM(CASE WHEN pay_status = -1 THEN statement_money ELSE 0 END),0) as error_money";
$money = M("excel_statement_info","tab_")->alias('i')->field( $field)->where($map)->find();
$count = M("excel_statement_info","tab_")->alias('i')->field("count(id) count")->where($map)->find();
$page = set_pagination_all($count['count'], $row);
if ($page) {
$this->assign('_page', $page);
}
// echo($page);die();
$this->meta_title = '线下打款';
$this->assign("data",$CompanyInfo);
$this->assign("money",$money);
$this->assign("CompanyType", $this->CompanyType);
$this->assign("PayStatus", $this->PayStatus);
$this->display();
}
public function add()
{
$batch = date('Ymd').date('His').sp_random_num(3);
$this->assign("batch",$batch);
$this->meta_title = 'EXCEL导入';
$this->display();
}
//
public function loopAdd()
{
$p = $_REQUEST;
// $statement_begin_time = strtotime($p['statement_begin_time']);
// $statement_end_time = strtotime($p['statement_end_time'])+86399;
$batch = $p['batch'];
$checkarr = $p['checkarr'];
//循环获取添加
if(count($checkarr) < 1){
$this->ajaxReturn(["status"=>1,"msg"=>"ok"]);
}
$ExcelStatementInfo = M('ExcelStatementInfo',"tab_");
foreach ($checkarr as $k => &$v) {
$company_info = $v['company_info'];
// $v['statement_begin_time'] = $statement_begin_time;
// $v['statement_end_time'] = $statement_end_time;
$v['batch_num'] = $batch;
$v['statement_info'] = json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE);
$v['company_info'] = json_encode($v['company_info'],JSON_UNESCAPED_UNICODE);
$v['company_type'] = 2;
$v['create_time'] = time();
$v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5);
$dm = [
"mobile"=>$this->admininfo['mobile'],
"real_name"=>$this->admininfo['real_name'],
"time"=>date("Y-m-d H:i:s")
];
$v['document_maker'] = json_encode($dm,JSON_UNESCAPED_UNICODE);
if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){
M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"支付宝真实姓名及登陆账号不允许为空"]);
}
$res = $ExcelStatementInfo->add($v);
if($res === false){
M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]);
}
}
$this->ajaxReturn(["status"=>1,"msg"=>"ok"]);
}
//查看
public function viewPool()
{
if(!isset($_REQUEST['id'])){
$this->error('参数错误');
}
$id = $_REQUEST['id'];
$is_export= false;
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
$is_export = true;
}
//获取基本信息
if($is_export && isset($_REQUEST['exporttype']) && $_REQUEST['exporttype']=='all'){
$dbres = M("ExcelStatementInfo","tab_")->where("id in ({$id})")->select();
$title = date("YmdHis");
}else{
$dbres = M("ExcelStatementInfo","tab_")->where("id ='{$id}'")->select();
$title = $dbres[0]['company_name'].date("YmdHis");
}
$this->assign("title",$title);
$this->viewPuPool($dbres,$is_export);
}
public function delItem()
{
if(!isset($_REQUEST['ids'])){
$this->error('参数错误');
}
$ids = $_REQUEST['ids'];
$map = [
"pay_status"=>["NEQ",1],
"id"=>["IN",$ids]
];
$dbres = M("ExcelStatementInfo","tab_")->where($map)->delete();
if($dbres === false){
$this->ajaxReturn(["status"=>0,"info"=>"删除失败"]);
}
$this->ajaxReturn(["status"=>1,"info"=>"删除成功"]);
}
//个人汇总结算查看
public function viewPuPool(&$infolist,$is_export){
$line = 1;
$count = [];
//获取对接人
foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true);
$v['company_info'] = json_decode($v['company_info'],true);
// $v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
// $v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
$cline = $line+1;
if($is_export){
$v['sum_money_exp'] = "=";
$hh = "\n";
}else{
$hh = "<br>";
}
$dm = json_decode($v['document_maker'],true);
$v['document_maker'] = $dm['mobile'].$hh."({$dm['real_name']})";
if(!empty($v['payment_user'])){
$pu = json_decode($v['payment_user'],true);
$v['payment_user'] = $pu['mobile'].$hh."({$pu['real_name']})";
}else{
$v['payment_user'] = "--";
}
$v["pay_status_str"] = $this->PayStatus[$v['pay_status']];
if(!empty($v['pay_time'])){
$v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']);
}else{
$v['pay_time'] = '--';
}
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
$va['row'] = count($va['game_list']);
$row += count($va['game_list']);
foreach($va['game_list'] as $key=>&$val){
$line ++;
if(isset($val['ratio'])){
$val['increment_ratio'] = 0;
}else{
$val['ratio'] = 0;
}
$val['ratio'] = $val['ratio']*100;
$val['increment_ratio'] = $val['increment_ratio']*100;
if($is_export){
//J3*(K3+L3)+M3-N3
$val['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['sum_money'] += $val['sum_money'];
}
}
}
$v['row'] = $row;
}
if($is_export){
$count["platform_amount"] = "=SUM(J2:J".$line.")";
$count["sum_money"] = "=SUM(O2:O".$line.")";
}
$this->assign("data",$infolist);
$this->assign("count",$count);
$this->assign("is_export",$is_export);
$this->display("viewPuPool");
}
public function showPayment()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$CompanyInfo = M("ExcelStatementInfo","tab_")
->alias('i')
->field("i.id,i.company_name,i.company_info,i.statement_money,i.batch_num,i.remark,i.pay_status")
->where("i.id in ({$ids})")
->select();
foreach($CompanyInfo as $k=>&$v){
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? '';
}
$count = M("ExcelStatementInfo","tab_")->field("sum(statement_money) statement_money")->where("id in ({$ids})")->find();
$this->getAccountMoney();
// dd($CompanyInfo);
$this->assign("CompanyInfo",$CompanyInfo);
$this->assign("mobile",$this->admininfo['mobile']);
$this->assign("count",$count);
$this->display();
// $this->display();
}
public function getAccountMoney(){
Vendor("Alipay2020/Fund");
$fund = new \Fund();
$money = $fund->account();
if($money !== -1){
$money = $money['amount'];
}else{
$money = "--";
}
$this->assign("money",$money);
}
//以下打款流程
public function checkVerify()
{
$mobile = $this->admininfo['mobile'];
$verify = $_REQUEST['verify'];
if (!A("Public")->checksafecode($mobile, $verify)) {
$this->ajaxReturn(["error"=>"验证码错误"]);
}
$this->ajaxReturn(["success"=>"验证码验证成功","data"=>[]]);
}
//执行打款
public function doPayment()
{
$id = $_REQUEST['id'];
$remark = $_REQUEST['remark'];
Vendor("Alipay2020/Fund");
$fund = new \Fund();
$dbres = M("ExcelStatementInfo","tab_")->where("id='{$id}'")->find();
$company_info = json_decode($dbres['company_info'],true);
if($dbres['pay_status'] != 1){
//执行打款
$title = $remark;
$amount = $dbres['statement_money'];
$payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title);
$resultCode = $payres->code;
$savedata = ["id"=>$dbres['id']];
if(!empty($resultCode)&&$resultCode == 10000){
$savedata["pay_status"]=1;
} else {
$savedata["pay_status"]=-1;
}
$payres = json_decode( json_encode($payres),true);
$payres["remark"] = $remark;
$savedata["pay_info"] = json_encode($payres,JSON_UNESCAPED_UNICODE);
$savedata["pay_time"]=time();
$pu = [
"mobile"=>$this->admininfo['mobile'],
"real_name"=>$this->admininfo['real_name'],
"time"=>date("Y-m-d H:i:s")
];
$savedata['payment_user'] = json_encode($pu,JSON_UNESCAPED_UNICODE);
}
M("ExcelStatementInfo","tab_")->save($savedata);
$this->ajaxReturn(["success"=>"打款成功","data"=>[]]);
}
/**
* 打款详情
*/
public function paymentInfo()
{
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$info = M("ExcelStatementInfo","tab_")->field("pay_info")->where("id='{$id}'")->find()['pay_info'];
$info = json_decode($info,true);
$senddata = [];
foreach($info as $k => &$v){
if(isset($this->ALIRSP[$k])){
$senddata[$this->ALIRSP[$k]] = $v;
}else{
$senddata[$k] = $v;
}
}
$this->assign("info",$senddata);
$this->display();
}
}

@ -91,6 +91,7 @@ class PaymentController extends BaseController
->field("i.*,p.statement_num statement_pool_num")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where($map)
->page($page,$row)
->order("FIELD(pay_status,0,-1,1),verify_status desc")
->select();
foreach($CompanyInfo as $k=>&$v){
@ -123,10 +124,7 @@ class PaymentController extends BaseController
$count = M("company_statement_info","tab_")->alias('i')->field("count(id) count")->where($map)->find();
// dd($count);
$parameter['p'] = $page;
$parameter['row'] = $row;
$page = set_pagination($count['count'], $row, $parameter);
$page = set_pagination($count['count'], $row);
if ($page) {
$this->assign('_page', $page);
}
@ -358,7 +356,7 @@ class PaymentController extends BaseController
public function transfer_set()
{
$this->getAccountMoney();
$this->meta_title = '打款设置';
$this->meta_title = '复核账号设置';
$this->assign("mobile",$this->admininfo['mobile']);
$this->display();
}
@ -366,7 +364,8 @@ class PaymentController extends BaseController
{
$mobile = $_REQUEST['mobile'];
$verify = $_REQUEST['verify'];
if (!$this->checksafecode($this->admininfo['mobile'], $verify)) {
$flag = A("Public")->checksafecode($this->admininfo['mobile'], $verify);
if (!$flag ) {
$this->error('验证码错误');
}
$dbres = M("Kv")->where("`key`='payment_check_mobile'")->save(['value'=>$mobile]);
@ -440,7 +439,7 @@ class PaymentController extends BaseController
if($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1){
//执行打款
$title = $dbres['company_name']."结算";
$title = "信息服务费";
$amount = $dbres['statement_money'];
$payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title);
$resultCode = $payres->code;

@ -19,27 +19,26 @@ class PublicController extends \Think\Controller
public function login($mobile = null, $verify = null)
{
if (IS_POST) {
$logininfo = ["mobile"=>$mobile];
//1.验证手机
$this->check_moblie($mobile);
$this->check_moblie($logininfo);
/* 检测验证码 TODO: */
if (!$this->checksafecode($mobile, $verify)) {
$this->error('验证码错误');
}
/* 记录登录SESSION和COOKIES */
$cp_auth = array(
'mobile' => $mobile
);
$session_name = 'payment_user';
if (I('auto_login')) {
$expireTime = 60*60*24*30;//自动登录一个月
ini_set('session.gc_maxlifetime', $expireTime);
ini_set('session.cookie_lifetime', $expireTime);
session($session_name, $cp_auth);
session($session_name.'_sign', data_auth_sign($cp_auth));
session($session_name, $logininfo);
session($session_name.'_sign', data_auth_sign($logininfo));
session($session_name.'_expire', time());
} else {
session($session_name, $cp_auth);
session($session_name.'_sign', data_auth_sign($cp_auth));
session($session_name, $logininfo);
session($session_name.'_sign', data_auth_sign($logininfo));
}
$this->success('登录成功!', U('Payment/lists'));
@ -130,6 +129,10 @@ class PublicController extends \Think\Controller
*/
public function checksafecode($phone, $code)
{
//测试验证码
// if($code == "txsb0601"){
// return true;
// }
$taskClient = new TaskClient();
$result = $taskClient->checkSms($phone, $code);
$data = [];
@ -139,14 +142,28 @@ class PublicController extends \Think\Controller
return false;
}
}
public function check_moblie($mobile){
$check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile'")->find();
public function check_moblie(&$logininfo){
$mobile = $logininfo['mobile'];
$check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile' AND `value`= '{$mobile}'")->find();
if(empty($check_mobile)){
$this->error('请先配置登陆验证手机');
}
$check_mobile = $check_mobile['value'];
if($check_mobile !== $mobile){
$this->error('该账号没有权限登录打款系统');
//获取普通登陆
$plogin = M("payment_member","tab_")->where("`mobile`= '{$mobile}'")->find();
if(empty($plogin)){
$this->error('无此登陆账号');
}else{
$logininfo["real_name"] = $plogin['real_name'];
$logininfo["is_payment"] = 0;
}
}else{
$rname = M("Kv")->field("value")->where("`key`='payment_check_name'")->find();
if(empty( $rname)){
$logininfo['real_name'] = "admin";
}else{
$logininfo['real_name'] = $rname['value'];
}
$logininfo['is_payment'] = 1;
}
}

@ -0,0 +1,80 @@
<?php
namespace Payment\Controller;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class UserController extends BaseController
{
public function _initialize()
{
$this->admininfo = session('payment_user');;
// $this->DBModel = M("CompanyStatementPool","tab_");
parent::_initialize();
}
public function index()
{
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
$data = M("PaymentMember","tab_")->page($page,$row)->order("id desc")->select();
$count = M("PaymentMember","tab_")->count("id");
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->meta_title = '打款结算单';
$this->assign("data",$data);
$this->display();
}
public function add()
{
if (IS_POST) {
$p = $_REQUEST;
$mobile = $p['mobile'];
/*检测用户名是否为空*/
if (empty($p['mobile'])) {
$this->error('手机号码不能为空!');
}
if (!preg_match('/^1[1-9]\d{9}$/', $p['mobile'])) {
return $this->error("手机号码格式错误");
}
if (empty($p['real_name'])) {
$this->error('姓名允许为空');
}
//判断手机唯一
$check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile' AND `value`= '{$mobile}'")->find();
if(empty($check_mobile)){
//获取普通登陆
$plogin = M("payment_member","tab_")->where("`mobile`= '{$mobile}'")->find();
if(!empty($plogin)){
$this->error('手机号码已存在');
}
}else{
$this->error('手机号码已存在');
}
M("payment_member","tab_")->add($p);
$this->success('用户添加成功!', U('index'));
} else {
$this->meta_title = '新增制表人';
$this->display();
}
}
public function delete($id)
{
$res = M('payment_member',"tab_")->where("id = '{$id}'")->delete();
if ($res) {
$this->success('删除成功');
} else {
$this->error('删除失败');
}
}
}

@ -0,0 +1,517 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<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">
<style>
.tabcon1711 td:first-child {
width: auto;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">新增excel导入</h3>
<p class="description_text">说明:导入预付款数据</p>
</div>
<!-- 标签页导航 -->
<div class="tab-wrap" style="display: flex;">
<div class="tab-content tabcon1711" style="min-width:700px;">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">本次批次号:</td>
<td class="r">
<div class="input-list" id="batch" style="margin-left: 0;line-height: 30px;font-size: 16px;">
</div>
<span class="notice-text" style="margin-left: 20px;">用于检索使用</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>文件上传:</td>
<td class="r">
<div class="input-list" style="margin-left: 0;">
<input type="file" id="fileinput" name="file">
</div>
<span class="notice-text" style="margin-left: 0;">暂只支持.xls .xlsx 格式文件</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="form-item cf">
<button class="submit_btn" id="submit_btn">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();">
返回
</a>
</div>
</div>
</div>
<div style="margin-top: 60px;" id="firle">
<div style="width: 100%;height: 45px;font-size: 16px;">
文件格式参考:<span style="color: #777;font-size: 12px;margin-left: 20px;">请严格按此格式,文件的第一行必须是字段名,且字段名不允许修改</span>
</div>
<style>
#firle td,#firle th{
padding: 10px 5px;
}
</style>
<table id="cktable" style="width: 100%;margin: 0;padding: 0;text-align: center;border: 1px solid #777;" border="1px">
<thead>
<tr>
<th>序号</th>
<th>下游名称</th>
<th>会长账号</th>
<th>下游类型</th>
<th>市场员</th>
<th>下游性质</th>
<th>产品</th>
<th>产品类型</th>
<th>结算时间</th>
<th>推广流水</th>
<th>分成比例</th>
<th>补点</th>
<th>奖励</th>
<th>罚款</th>
<th>结算金额</th>
<th>支付宝真实姓名</th>
<th>支付宝账号</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>海南万盟天下科技</td>
<td>leilihua</td>
<td>外团开发</td>
<td>小明</td>
<td>个人</td>
<td>秦汉风云</td>
<td>策略</td>
<td>2020.6.22-2020.6.28 5626</td>
<td>5626</td>
<td>1%</td>
<td>0%</td>
<td>0</td>
<td>0</td>
<td>56.26</td>
<td>小花</td>
<td>12345678910</td>
<td>不重要的备注</td>
</tr>
</tbody>
</table>
</div>
<div style="width: 100vw;height: 100vh;padding: 0;position: absolute;top: 0;z-index: 9999;display: none;" id="creat_msg">
<div class="layui-layer layui-layer-dialog layui-layer-border layui-layer-msg layui-layer-hui"
type="dialog" times="1" showtime="50000" contype="string" style="z-index: 19891015; top:30%; left:30%;">
<div class="layui-layer-content" style="padding: 15px 0 5px;font-size: 20px;font-weight: 600;">执行进度</div>
<div id="tip_msg" class="layui-layer-content">开始时间与结束时间都不允许为空</div>
<div class="layui-layer-content" style="padding: 5px 10px 15px;font-size: 10px;color: #BBB;">TIP:未执行完成之前请勿刷新或关闭此页面</div>
<span class="layui-layer-setwin"></span>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__STATIC__/xlsx.core.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('lists')}");
var MSG={
showmsg:function(str){
$("#creat_msg").show();
$("#tip_msg").html(str);
},
hidemsg:function(){
$("#creat_msg").hide();
$("#tip_msg").html('');
}
}
var COMPARE={
publiucAjax:function(url,senddata,callback){
$.ajax({
type: 'post',
url: url,
data:senddata,
success: function(data) {
if(data.status == 1){
callback();
}else{
MSG.hidemsg();
layer.alert(data.msg);
return false;
}
},
error:function(){
MSG.hidemsg();
layer.alert("网络错误或超时");
return false;
}
});
},
//循环比较
loopCheck:function(page,callback){
if(page > sendDefaultData.check_page){
MSG.showmsg("添加成功,执行跳转中");
callback();
return;
}
var senddata = {
statement_begin_time:sendDefaultData.begin_time,
statement_end_time:sendDefaultData.end_time,
batch:sendDefaultData.batch,
checkarr:sendDefaultData.filedata.splice(0,check_size)
}
COMPARE.publiucAjax("{:U('loopAdd')}",senddata,function(data){
var checkok = page*check_size > sendDefaultData.filedata_count ? sendDefaultData.filedata_count : page*check_size;
MSG.showmsg("数据插入 ["+checkok+"/"+sendDefaultData.filedata_count+"] ......");
page++;
COMPARE.loopCheck(page,callback)
});
},
checkData:function(callback){
MSG.showmsg("数据校验中...");
var d = sendDefaultData.filedata;
for (const key in d) {
var c = d[key].company_info;
if(!c.hasOwnProperty('ali_user') || c.ali_user == '' || !c.hasOwnProperty('ali_account') || c.ali_account == ''){
MSG.hidemsg();
layer.msg('支付宝真实姓名及登陆账号不允许为空');
return false;
}
}
callback();
}
}
</script>
<script type="text/javascript">
var isfile = false;
var rABS = false; //是否将文件读取为二进制字符串
var check_size = 10;//每次验证的数量
var batch = '{$batch}';
var sendDefaultData = {
"filedata_count": 0,
"check_page":0,
"filedata":[],
"pay_way":-1,
"batch":batch
}
$("#batch").html(batch);
$(function () {
$("#submit_btn").on("click", function () {
//获取文件
if (!isfile) {
layer.msg('excel文件不能为空');
return false;
}
//执行
readFileInput(function () {
if(sendDefaultData.filedata_count == 0){
MSG.hidemsg();
layer.msg('excel内容不能为空');
return false;
}
//获取需要循环的次数
sendDefaultData.check_page = Math.ceil(sendDefaultData.filedata_count/check_size);
COMPARE.checkData(function(){
COMPARE.loopCheck(1,function(){
setTimeout(function(){
window.location.href="{:U('lists',['row'=>999999,'page'=>1,'batch_num'=>$batch])}";
},1500);
})
});
})
})
$("#fileinput").change(function () {
var p = $(this).val();
var ext = p.substr(p.lastIndexOf(".")).toLowerCase();
if (ext != ".xls" && ext != ".xlsx") {
layer.msg("文件仅支持excel文件格式");
$(this).val('');
p = '';
}
if (p != '') {
isfile = true;
} else {
isfile = false;
}
})
});
function readFileInput(callback) {
MSG.showmsg("读取excle中。。。");
var wb;//读取完成的数据
var f = $("#fileinput")[0].files[0];
var reader = new FileReader();
if (rABS) {
reader.readAsArrayBuffer(f);
} else {
reader.readAsBinaryString(f);
}
reader.onload = function (e) {
MSG.showmsg("文件读取完成,添加命令初始化。。。");
var data = e.target.result;
if (rABS) {
wb = XLSX.read(btoa(fixdata(data)), {
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
// console.log(wb);
try {
var filedata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
sendDefaultData.filedata = resetCount(filedata);
sendDefaultData.filedata_count = sendDefaultData.filedata.length;
callback();
} catch (error) {
MSG.hidemsg();
isfile = false;
layer.msg('excel内容不符或不能为空');
return false;
}
// document.getElementById("demo").innerHTML= JSON.stringify( XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]) );
};
}
function resetCount(fdata){
var titleKey={
"序号": "sort",
"下游名称": "company_name",
"会长账号": "account",
"下游类型": "company_relation_str",
"市场员": "nickname",
"下游性质": "company_type_str",
"产品": "game_name",
"产品类型": "game_type_name",
"结算时间": "statement_time",
"推广流水": "pay_amount",
"分成比例": "ratio",
"补点": "increment_ratio",
"奖励": "reward",
"罚款": "fine",
"结算金额":"sum_money",
"账户名": "payee_name",
"银行卡号": "bank_account",
"开户支行": "opening_bank",
"账户类型": "bank_type",
"支付宝真实姓名": "ali_user",
"支付宝账号": "ali_account",
"备注": "remark",
}
var data = [];
//临时公司
var temp ={
statement_money:0,
platform_amount:0,
fine:0,
reward:0,
statement_info:[],
company_info:{}
};
var game_name = '';
var game_type= '';
for (let index = 0; index < fdata.length; index++) {
const e = fdata[index];
//全量公司
if (e.hasOwnProperty("序号")) {
if(index != 0){
temp.statement_money = temp.statement_money/100;
temp.platform_amount = temp.platform_amount/100;
temp.fine = temp.fine/100;
temp.reward = temp.reward/100;
data.push(temp);//上次的走掉
temp ={
statement_money:0,
platform_amount:0,
fine:0,
reward:0,
statement_info:[],
company_info:{}
};//重置
}
var acc = {
game_list:[]
};
var gamet = {}
for (const k in e) {
if(k == "会长账号"){
acc[titleKey[k]] = e[k];
}else if(k=="产品" || k=="产品类型" || k == "结算时间" || k == "推广流水" || k == "分成比例" || k == "补点" || k == "奖励" || k == "罚款" || k == "结算金额"){
if(k=="产品") game_name = e[k];
if(k=="产品类型") game_type = e[k];
if(k=="奖励") temp.reward += Math.round(e[k]*100);
if(k=="罚款") temp.fine += Math.round(e[k]*100);
if(k=="推广流水") temp.platform_amount +=Math.round(e[k]*100);
if(k=="结算金额") temp.statement_money += Math.round(e[k]*100);
if(k == "推广流水" || k == "奖励" || k == "罚款" || k == "结算金额"){
e[k] = Math.round(e[k]*100)/100;
}
gamet[titleKey[k]] = e[k];
}else if(k=="下游类型" ||k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){
temp.company_info[titleKey[k]] = e[k];
}else{
temp[titleKey[k]] = e[k];
}
}
if(!gamet.hasOwnProperty("game_name")){
gamet.game_name =game_name;
}
if(!gamet.hasOwnProperty("game_type_name")){
gamet.game_type_name =game_type;
}
acc.game_list.push(gamet);
temp.statement_info.push(acc);
continue;
}
//含会长信息
if (e.hasOwnProperty("会长账号")) {
var acc = {
game_list:[]
};
var gamet = {}
for (const k in e) {
if(k == "会长账号"){
acc[titleKey[k]] = e[k];
}else if(k=="产品" || k=="产品类型" || k == "结算时间" || k == "推广流水" || k == "分成比例" || k == "补点" || k == "奖励" || k == "罚款" || k == "结算金额"){
if(k=="产品") game_name = e[k];
if(k=="产品类型") game_type = e[k];
if(k=="奖励") temp.reward += Math.round(e[k]*100);
if(k=="罚款") temp.fine += Math.round(e[k]*100);
if(k=="推广流水") temp.platform_amount += Math.round(e[k]*100);
if(k=="结算金额") temp.statement_money += Math.round(e[k]*100);
if(k == "推广流水" || k == "奖励" || k == "罚款" || k == "结算金额"){
e[k] = Math.round(e[k]*100)/100;
}
gamet[titleKey[k]] = e[k];
}else if(k=="下游类型" || k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){
temp.company_info[titleKey[k]] = e[k];
}else{
temp[titleKey[k]] = e[k];
}
}
if(!gamet.hasOwnProperty("game_name")){
gamet.game_name =game_name;
}
if(!gamet.hasOwnProperty("game_type_name")){
gamet.game_type_name =game_type;
}
acc.game_list.push(gamet);
temp.statement_info.push(acc);
continue;
}
//只含有游戏的信息
var gamet = {}
for (const k in e) {
if(k == "会长账号"){
acc[titleKey[k]] = e[k];
}else if(k=="产品" || k=="产品类型" || k == "结算时间" || k == "推广流水" || k == "分成比例" || k == "补点" || k == "奖励" || k == "罚款" || k == "结算金额"){
if(k=="产品") game_name = e[k];
if(k=="产品类型") game_type = e[k];
if(k=="奖励") temp.reward += Math.round(e[k]*100);
if(k=="罚款") temp.fine += Math.round(e[k]*100);
if(k=="推广流水") temp.platform_amount +=Math.round(e[k]*100);
if(k=="结算金额") temp.statement_money += Math.round(e[k]*100);
if(k == "推广流水" || k == "奖励" || k == "罚款" || k == "结算金额"){
e[k] = Math.round(e[k]*100)/100;
}
gamet[titleKey[k]] = e[k];
}else if( k=="下游类型" || k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){
temp.company_info[titleKey[k]] = e[k];
}else{
temp[titleKey[k]] = e[k];
}
}
if(!gamet.hasOwnProperty("game_name")){
gamet.game_name =game_name;
}
if(!gamet.hasOwnProperty("game_type_name")){
gamet.game_type_name =game_type;
}
temp.statement_info[temp.statement_info.length-1].game_list.push(gamet);
}
//判断
temp.statement_money = temp.statement_money/100;
temp.platform_amount = temp.platform_amount/100;
temp.fine = temp.fine/100;
temp.reward = temp.reward/100;
data.push(temp);//最后一次
return data;
}
function getNowDate(){
var da = new Date();
var trade =da.getFullYear();
var mt =da.getMonth() + 1 >10 ? da.getMonth() + 1 : "0"+(da.getMonth() + 1);
var dt =da.getDate() >=10 ? da.getDate() : "0"+da.getDate();
var dh =da.getHours() >=10 ? da.getHours() : "0"+da.getHours();
var dm =da.getMinutes() >=10 ? da.getMinutes() : "0"+da.getMinutes();
var ds =da.getSeconds() >=10 ? da.getSeconds() : "0"+da.getSeconds();
var dms =(Array(3).join(0) + da.getMilliseconds()).slice(-3);
return trade+=""+mt+""+dt+""+dh+""+dm+""+ds+''+dms;
}
function fixdata(data) { //文件流转BinaryString
var o = "",
l = 0,
w = 10240;
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));
return o;
}
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
</script>
</block>

@ -0,0 +1,439 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
/* .data_list table td{
line-height: 2;
} */
.layui-layer-title {
text-align: center;
height: 42px;
line-height: 42px;
font-weight: 400;
font-size: 14px;
}
.tooltip {
position: relative;
/* display: block; */
/* color: #056dae; */
}
.tooltip .tooltiptext {
display: none;
width: 100%;
background-color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 10px 5px 5px;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
border: #000 solid 1px;
line-height: 20px;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
color: #333;
display: block;
}
.page .sch-btn:before{
content: '';
padding: 0;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">线下打款</h3>
<p class="description_text">批次号指同一表格上传的打款单</p>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom: 0">
<div class="input-list">
<input type="text" name="company_name" placeholder="请输入公司名称模糊搜索" value="{:I('company_name')}" style="width: 180px;">
</div>
<!-- <div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" style="display:inline-block">
<input type="text" readonly id="datetimepicker" name="time_end" class="" value="{:I('time_end')}" placeholder="结算结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div> -->
<div class="input-list input-list-promote search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" >
<option value="">支付状态</option>
<volist name="PayStatus" id="vo">
<option value="{$key}" <if condition="isset($_GET['pay_status']) && $key eq I('pay_status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" name="batch_num" placeholder="批次号" value="{:I('batch_num')}" style="width: 180px;">
</div>
<div class="input-list">
<input type="text" readonly id="time_start2" name="pay_time_start" class="" value="{:I('pay_time_start')}" placeholder="支付开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" style="display:inline-block">
<input type="text" readonly id="datetimepicker2" name="pay_time_end" class="" value="{:I('pay_time_end')}" placeholder="支付结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<if condition="session('payment_user.is_payment') eq 1">
<a class='butn' id='doPayment'>批量打款</a>
</if>
<a class='butn' id='leadExcel'>Excel导入</a>
<a class='butn' id='export'>导出</a>
<a class='butn' id='delItem' style="background-color: red;">批量删除</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>合作公司</th>
<th>公司类型</th>
<th>创建时间</th>
<th>批次号</th>
<th>结算金额</th>
<th>结算流水</th>
<th>打款状态</th>
<th>支付时间</th>
<th>预打款备注</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td ><input class="ids" type="checkbox" value="{$data['id']}" data-pay="{$data['can_pay']}" data-paystatus="{$data.pay_status}" name="ids[]"></td>
<td>{$data.company_name}</td>
<td>{$data.company_type}</td>
<td>{$data.create_time}</td>
<td>{$data.batch_num}</td>
<td>{$data.statement_money}</td>
<td>{$data.platform_amount}</td>
<if condition="($data['pay_status'] eq -1) ">
<td style="color: red;">{$data.pay_status_str}</td>
<else />
<td>{$data.pay_status_str}</td>
</if>
<td>{$data.pay_time}</td>
<td>{$data.remark}</td>
<td>
<a class='confirm viewPool' data-id='{$data.id}'>查看</a>
<a class='confirm exportPool' data-id='{$data.id}'>导出</a>
<if condition="$data['pay_status'] neq 0">
<a class='confirm paymentInfo' data-id='{$data.id}'>打款详情</a>
</if>
</td>
</tr>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">
打款成功金额:&nbsp;{$money.success_money}&nbsp;&nbsp;/&nbsp;&nbsp;待打款金额:&nbsp;{$money.statement_money}&nbsp;&nbsp;/&nbsp;&nbsp;打款失败金额:&nbsp;{$money.error_money}
</td></tr>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<!-- <a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a> -->
</if>
{$_page|default=''}
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script src="__STATIC__/laydate/laydate.js" type="text/javascript"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('lists')}");
function reload() {
window.location.reload();
}
$(function(){
$(".viewPool").click(function () {
var id = $(this).data("id");
var url = "{:U('viewPool')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: url
});
});
$("#export").click(function () {
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '请先选择要导出的打款单' + "</font>");
return;
}
_export();
function _export(){
layer.alert("<font style='color:#333'>"+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ "</font>");
var id = text.join(",");
var url ="{:U('viewPool')}"+"&id="+id+"&export=1&exporttype=all";
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
$("body").append(iframeExcel);
}
})
$("#delItem").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("paystatus") == 1){
flag = true;
}else{
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>无可删除数据,支付成功的数据无法删除</font>");
return;
}
text = text.join(",");
layer.confirm('【警告】删除操作将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(){
$.ajax({
type: "POST",
url: "{:U('delItem')}",
dataType: 'json',
async: false,
data: {ids:text},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
})
$(".exportPool").click(function(){
layer.alert("<font style='color:#333'>"+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ "</font>");
var id = $(this).data("id");
var url ="{:U('viewPool')}"+"&id="+id+"&export=1&exporttype=one";
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
$("body").append(iframeExcel);
})
$(".paymentInfo").on("click",function(){
var id = $(this).data("id");
var url = "{:U('paymentInfo')}"+"&id="+id
layer.open({
type: 2,
title: "打款详情",
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
})
$("#doPayment").on("click",function(){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("pay") == 1){
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>请先选择需要打款的结算单仅大于0.1元的打款单才能进行打款</font>");
return;
}
text = text.join(",");
window.location.href = "{:U('showPayment')}"+"&ids="+text;
})
$("#leadExcel").on("click",function(){
window.location.href = "{:U(add)}";
})
$("#search").click(function(){
var start = $("#time_start").val();
var end = $("#datetimepicker").val();
if(start !='' && end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
var start2 = $("#time_start2").val();
var end2 = $("#datetimepicker2").val();
if(start2 !='' && end2 != ''){
if (Date.parse(start2) > Date.parse(end2)){
layer.msg("<font style='color:white'>支付时间开始时间必须小于等于结束时间</font>");
return false;
}
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
laydate.render({
elem: '#time_start'
// ,position: 'static'
});
laydate.render({
elem: '#datetimepicker'
});
laydate.render({
elem: '#time_start2'
});
laydate.render({
elem: '#datetimepicker2'
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
</script>
</block>

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 10px 150px 10px;
/* width: 960px; */
}
</style>
<body>
<div class="tab-wrap">
<div class="tab-content tabcon1711 tabcon17112">
<div id="tab1" class="tab-pane in tab1">
<form action="{:U('saveTool')}" method="post" class="form-horizontal qq_login form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<foreach name="info" item="v" key="k">
<tr>
<td class="l noticeinfo">{$k}:</td>
<td class="r table_radio">
{$v}
<!-- <input type="text" class="text input-large" value="{$wechat_url}"> -->
<!-- <span class="notice-text">请将此地址复制到微信公众平台接口URL项</span> -->
</td>
</tr>
</foreach>
</tbody>
</table>
</form>
</div>
</div>
</div>
<body>
<script type="text/javascript">
</script>
</html>

@ -0,0 +1,315 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.tabcon1711 table {
width: 480px;
}
table {
margin: auto;
}
.hidebox {
display: none;
}
.r {
width: 300px;
}
.l {
width: 180px;
}
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;
height: 35px;
height: 28px;
border-radius: 3px;
font-size: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 35px;
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height: 26px;
line-height: 26px;
font-size: 12px;
}
.select2-results__option[aria-selected] {
font-size: 12px;
}
.input-list,
.i_list {
float: left;
margin: 0;
}
#sendSasfeCode {
border-radius:3px;
width:100px;
cursor:pointer;
border:1px solid;
top:0;
right:0;
height:40px;
text-align: center;
line-height: 40px;
}
.g-btntn{
border-color: grey;
color: grey;
}
.g-btn{
border-color: #2697FF;
color: #2697FF;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">批量打款</h3>
<p class="description_text">确认打款前请先确认账户余额是否足够</p>
</div>
<div class="data_list box_mt">
<div class="">
<table>
<thead>
<tr>
<th style="border-right: solid 1px #b6cad2;">序号</th>
<th style="border-right: solid 1px #b6cad2;">合作公司</th>
<th style="border-right: solid 1px #b6cad2;">支付宝真实名称</th>
<th style="border-right: solid 1px #b6cad2;">支付宝账号</th>
<th style="border-right: solid 1px #b6cad2;">批次号</th>
<th style="border-right: solid 1px #b6cad2;">金额(元)</th>
<th style="border-right: solid 1px #b6cad2;">备注</th>
<th style="border-right: solid 1px #b6cad2;">打款备注</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="CompanyInfo" item="vo" >
<tr>
<td>{$key-0+1}</td>
<td>{$vo.company_name}</td>
<td>{$vo.company_info.ali_user}</td>
<td>{$vo.company_info.ali_account}</td>
<td>{$vo.batch_num}</td>
<td>{$vo.statement_money}</td>
<td>{$vo.remark}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" data-pool="{$vo.pool_id}" name="remark" value="" placeholder="打款备注"></td>
</tr>
</foreach>
<tr>
<td colspan="2">合计:</td>
<td colspan="6">打款总金额:&nbsp;{$count['statement_money']} <span <if condition="$count['statement_money'] gt $money ">style="color: red;"</if>>&nbsp;&nbsp;&nbsp;&nbsp;账户金额:&nbsp;{$money}</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="display: flex;padding:20px 10px;line-height: 40px;justify-content:center;">
<input name="verify" type="text" class="login_input verify" value="" placeholder="请填写验证码"/>
<div id="sendSasfeCode" class="g-btn" style="margin-left: 20px;">获取验证码</div>
<div style="margin-left: 20px;">接收验证码手机:{$mobile}</div>
</div>
<div class="search_list" style="display:flex;justify-content:flex-end;width:100%;">
<div class="input-list" style="margin-left: 30px;float: right;">
<a class="sch-btn" href="javascript:;" id="setPayment" style="width: 150px;">确认打款</a>
</div>
</div>
<div style="width: 100vw;height: 100vh;padding: 0;position: absolute;top: 0;z-index: 9999;display: none;" id="creat_msg">
<div class="layui-layer layui-layer-dialog layui-layer-border layui-layer-msg layui-layer-hui"
type="dialog" times="1" showtime="50000" contype="string" style="z-index: 19891015; top:30%; left:45%;">
<div class="layui-layer-content" style="padding: 15px 0 5px;font-size: 20px;font-weight: 600;">执行进度</div>
<div id="tip_msg" class="layui-layer-content">开始时间与结束时间都不允许为空</div>
<div class="layui-layer-content" style="padding: 5px 10px 15px;font-size: 10px;color: #BBB;">TIP:未执行完成之前请勿刷新或关闭此页面</div>
<span class="layui-layer-setwin"></span>
</div>
</div>
</block>
<block name="script">
<script>
var DATA={};
// $("#creat_msg").show();
highlight_subnav("{:U('lists')}");
var MSG={
showmsg:function(str){
$("#creat_msg").show();
$("#tip_msg").html(str);
},
hidemsg:function(){
$("#creat_msg").hide();
$("#tip_msg").html('');
}
}
var COMPARE={
publiucAjax:function(url,senddata,callback){
$.ajax({
type: 'post',
url: url,
data:senddata,
success: function(data) {
if(data.success){
callback(data.data);
}else{
MSG.hidemsg();
layer.alert(data.error);
return false;
}
},
error:function(){
MSG.hidemsg();
layer.alert("网络错误或超时");
return false;
}
});
},
//验证验证码
checkVerify:function(callback){
MSG.showmsg("验证码验证中....");
COMPARE.publiucAjax("{:U('checkVerify')}",{verify:DATA.verify},function(data){
MSG.showmsg("验证码验证通过,开始进行打款 [0/"+DATA.datacount+"] ......");
callback();
});
},
//打款
doPayment:function(callback){
var senddata = DATA.data[(DATA.now-1)];
console.log(senddata);
COMPARE.publiucAjax("{:U('doPayment')}",senddata,function(){
MSG.showmsg("开始进行打款 ["+DATA.now+"/"+DATA.datacount+"] ......");
DATA.now ++;
if( DATA.now > DATA.datacount){
callback();
}else{
COMPARE.doPayment(callback)
}
});
}
}
var r = function(i, t) {
if (i>0) {
var r = 60;
e='#sendSasfeCode';
$(e).removeClass('g-btn').addClass('g-btntn');
var a = setInterval(function() {
r--;
$(e).text(r + '秒');
0 == r && ($(e).removeClass('g-btntn').addClass('g-btn'),
$(e).text('获取验证码'),
clearInterval(a))
},1000)
}
};
$('#sendSasfeCode').on('click',function() {
if ($(this).hasClass('g-btntn')) {
return false;
}
var phone = "{$mobile}";
$.ajax({
type:'post',
dataType:'json',
data:'phone='+phone,
url:'{:U("Public/telsafecode")}',
success:function(data) {
if (data.status ==1) {
r(1);
} else {
alert(data.msg);
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
}
});
});
$("#setPayment").on("click",function(){
MSG.showmsg("程序初始化中...");
var verify = $("input[name='verify']").val();
if($.trim(verify) == ''){
MSG.hidemsg();
alert('验证码不能为空');
return false;
};
DATA.data=[];
DATA.now=1;
DATA.verify=verify;
var text = $("input[name='remark']").map(function(index,elem) {
var t = {};
t.id = $(elem).data("id");
t.remark = $(elem).val();
DATA.data.push(t);
});
DATA.datacount = DATA.data.length;
//执行流程
COMPARE.checkVerify(function(){
COMPARE.doPayment(function(){
MSG.showmsg("打款结束,执行跳转中......");
setTimeout(function(){
window.location.href = "{:U('lists')}";
},2000)
})
});
})
function cancelPoolAjax(opurl,senddata){
//执行
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: false,
data: senddata,
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
}
</script>
</block>

@ -0,0 +1,278 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 10px 150px 10px;
/* width: 960px; */
margin: auto;
}
/* .tabcon1711 table{
width: 480px;
} */
table{
margin: auto;
}
tr{
border-bottom: dotted 1px #c7c7c7;
}
.hidebox{
display: none;
}
.r{
width: 300px;
}
.l{
width: 180px;
}
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;
height: 35px;
height: 28px;
border-radius: 3px;
font-size: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 35px;
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height: 26px;
line-height: 26px;
font-size: 12px;
}
.select2-results__option[aria-selected] {
font-size: 12px;
}
.input-list, .i_list {
float: left;
margin: 0;
}
#statementShow td{
line-height: 1.5;
padding: 8px 0;
}
</style>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div class="data_list box_mt" style="margin-top: 10px;">
<div class="">
<table id="exporttable">
<!-- 表头 -->
<thead>
<tr>
<th>序号</th>
<th>下游名称</th>
<th>会长账号</th>
<th>下游类型</th>
<th>市场员</th>
<th>下游性质</th>
<th>产品</th>
<th>产品类型</th>
<th>结算时间</th>
<th>推广流水</th>
<th>分成比例</th>
<th>补点</th>
<th>奖励</th>
<th>罚款</th>
<th>结算金额</th>
<th>支付宝真实姓名</th>
<th>支付宝账号</th>
<th>制单人</th>
<th>复核人员</th>
<th>打款状态</th>
<th>打款时间</th>
<th>备注</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.row}">{$key-0+1}</td>
<td rowspan="{$com.row}">{$com.company_name}</td>
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.account}</td> -->
<notempty name="com['statement_info']">
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['account']}</td>
<else />
<td>-</td>
</notempty>
<td rowspan="{$com.row}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.row}">{$com.company_info.nickname}</td>
<td rowspan="{$com.row}">{$com.company_info.company_type_str}</td>
<notempty name="com['statement_info'][0]['game_list']">
<td>{$com['statement_info'][0]['game_list'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['game_type_name']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['statement_time']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['game_list'][0]['increment_ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['game_list'][0]['reward']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['fine']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['sum_money']}</td>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</notempty>
<td rowspan="{$com.row}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.row}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.row}">{$com.document_maker}</td>
<td rowspan="{$com.row}">{$com.payment_user}</td>
<td rowspan="{$com.row}">{$com.pay_status_str}</td>
<td rowspan="{$com.row}">{$com.pay_time}</td>
<td rowspan="{$com.row}">{$com.remark}</td>
</tr>
<if condition="$com['statement_info'][0]['row'] gt 1">
<foreach name="com['statement_info'][0]['game_list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game['game_name']}</td>
<td>{$game['game_type_name']}</td>
<td>{$game['statement_time']}</td>
<td>{$game['pay_amount']}</td>
<td>{$game['ratio']|default=0}%</td>
<td>{$game['increment_ratio']|default=0}%</td>
<td>{$game['reward']}</td>
<td>{$game['fine']}</td>
<td>{$game['sum_money']}</td>
</tr>
</if>
</foreach>
</if>
<notempty name="com['statement_info'][1]">
<foreach name="com['statement_info']" item="account" key="akey">
<if condition="$akey gt 0">
<tr>
<td rowspan="{$account['row']}">{$account['account']}</td>
<notempty name="account['game_list']">
<td>{$account['game_list'][0]['game_name']}</td>
<td>{$account['game_list'][0]['game_type_name']}</td>
<td>{$account['game_list'][0]['statement_time']}</td>
<td>{$account['game_list'][0]['pay_amount']}</td>
<td>{$account['game_list'][0]['ratio']|default=0}%</td>
<td>{$account['game_list'][0]['increment_ratio']|default=0}%</td>
<td>{$account['game_list'][0]['reward']}</td>
<td>{$account['game_list'][0]['fine']}</td>
<td>{$account['game_list'][0]['sum_money']}</td>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</notempty>
</tr>
<if condition="$account['row'] gt 1">
<foreach name="account['game_list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game['game_name']}</td>
<td>{$game['game_type_name']}</td>
<td>{$game['statement_time']}</td>
<td>{$game['pay_amount']}</td>
<td>{$game['ratio']|default=0}%</td>
<td>{$game['increment_ratio']|default=0}%</td>
<td>{$game['reward']}</td>
<td>{$game['fine']}</td>
<td>{$game['sum_money']}</td>
</tr>
</if>
</foreach>
</if>
</if>
</foreach>
</notempty>
</foreach>
<tr>
<td colspan=9 >合计:</td>
<td>{$count.platform_amount}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{$count.sum_money}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
<script>
<if condition="$is_export">
$(function(){
$("#exporttable").table2excel({
filename: "{$title}.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
</if>
</script>
</html>

@ -96,7 +96,7 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">打款结算单</h3>
<h3 class="page_title">线上打款</h3>
<p class="description_text">信息不全指:支付宝账号或真实姓名未填写</p>
</div>
@ -169,7 +169,9 @@
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class='butn' id='doPayment'>批量打款</a>
<if condition="session('payment_user.is_payment') eq 1">
<a class='butn' id='doPayment'>批量打款</a>
</if>
</div>
</div>

@ -278,6 +278,7 @@
if($.trim(verify) == ''){
MSG.hidemsg();
alert('验证码不能为空');
return false;
};
DATA.data=[];
DATA.now=1;

@ -16,7 +16,7 @@
<tbody>
<tr>
<td class="l noticeinfo">打款验证手机</td>
<td class="l noticeinfo">复核账</td>
<td class="r table_radio">
<input name="mobile" type="text" data-mobile="{$mobile}" value="{$mobile}" class="">
<span class="notice-text"></span>
@ -74,7 +74,7 @@
$.ajax({
type:'post',
dataType:'json',
data:'phone='+mobile,
data:'phone='+ym,
url:'{:U("Public/telsafecode")}',
success:function(data) {
if (data.status ==1) {

@ -71,7 +71,7 @@
<li><a class="tuichujs" href="">退出</a></li>
</ul>
<div class="user">
<span>{:session('payment_user.mobile')}</span>
<span>{:session('payment_user.real_name')}</span>
</div>
</div>
</div>
@ -203,13 +203,24 @@ $(function(){
</div>
<div class="fgx">功能菜单</div> -->
<div id="subnav" class="subnav">
<h3 class=""><i class="icon icon-unfold"></i>万盟打款</h3>
<ul class="side-sub-menu">
<if condition="session('payment_user.is_payment') eq 1">
<h3 class='no'><i class="icon icon-unfold"></i>账号管理</h3>
<ul class="side-sub-menu" style="display: none;">
<li>
<a class="item" href="{:U('Payment/transfer_set')}">复核账号</a>
</li>
<li>
<a class="item" href="{:U('User/index')}">制单账号</a>
</li>
</ul>
</if>
<h3 class='no'><i class="icon icon-unfold"></i>打款方式</h3>
<ul class="side-sub-menu" style="display: none;">
<li>
<a class="item" href="{:U('Payment/transfer_set')}">打款设置</a>
<a class="item" href="{:U('Payment/lists')}">线上付款</a>
</li>
<li>
<a class="item" href="{:U('Payment/lists')}">打款结算单</a>
<a class="item" href="{:U('ExcelPayment/lists')}">线下付款</a>
</li>
</ul>
</div>
@ -279,7 +290,7 @@ $(function(){
location.reload();
},
error:function(){
updateAlert("服务器故障!",'tip_error');
updateAlert('退出成功','tip_right');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);

@ -0,0 +1,50 @@
<extend name="Public/base"/>
<block name="body">
<div class="tabcon1711">
<form action="{:U()}" method="post" class="form-horizontal form_info_ml">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">新增制单人</h3>
<p class="description_text"></p>
</div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"><i class="mustmark">*</i>姓名:</td>
<td class="r">
<input name="real_name" type="text" class="">
<span class="notice-text">制单人姓名</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>手机号码:</td>
<td class="r">
<input name="mobile" type="text" class="">
<span class="notice-text">制单人登陆用的手机</span>
</td>
</tr>
</tbody>
</table>
<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(-1);" >
返回
</a>
</div>
</form>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('User/index')}');
</script>
</block>

@ -0,0 +1,84 @@
<extend name="Public/base" />
<block name="body">
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">制单账号</h3>
<p class="description_text">说明:可设置制单账号</p>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<a class="" href="{:U('add')}"><span class="button_icon button_icon1"></span>新增</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<table class="">
<thead>
<tr>
<th class="">姓名</th>
<th class="">手机号码</th>
<th class="" style="width:8%;min-width:110px;">操作</th>
</tr>
</thead>
<tbody>
<notempty name="data">
<volist name="data" id="vo">
<tr>
<td>{$vo.real_name}</td>
<td>{$vo.mobile} </td>
<td>
<a href="{:U('User/delete',['id'=>$vo['id']])}" class="confirm ajax-get">删除</a>
</td>
</tr>
</volist>
<else/>
<td colspan="9" class="text-center">aOh! 暂时还没有内容!</td>
</notempty>
</tbody>
</table>
</div>
<div class="page">
{$_page}
</div>
</block>
<block name="script">
<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
<script type="text/javascript">
Think.setValue('status',"{:I('status')}");
Think.setValue('row',"{:I('row',10)}");
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车搜索
$(".search-input").keyup(function(e){
if(e.keyCode === 13){
$("#search").click();
return false;
}
});
//导航高亮
highlight_subnav('{:U('User/index')}');
</script>
</block>

@ -2075,6 +2075,36 @@ ADD COLUMN `fax_ratio` varchar(20) NULL COMMENT '开票税率' AFTER `ali_accou
ALTER TABLE `sys_shift_task`
ADD COLUMN `change_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '推广员充值换榜执行状态 0 未处理 1 已处理' AFTER `status`;
CREATE TABLE `tab_excel_statement_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`batch_num` varchar(500) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '批次号',
`company_type` tinyint(3) NOT NULL DEFAULT '1' COMMENT '公司性质: 1-下游公司 2-下游个人 3上游公司',
`company_name` varchar(60) NOT NULL DEFAULT '' COMMENT '对账公司名称',
`company_info` text NOT NULL COMMENT '公司其他信息json',
`statement_money` decimal(10,2) DEFAULT '0.00' COMMENT '对账金额',
`platform_amount` decimal(10,2) DEFAULT '0.00' COMMENT '平台流水金额',
`fine` decimal(10,2) DEFAULT '0.00' COMMENT '罚款',
`reward` decimal(10,2) DEFAULT '0.00' COMMENT '奖励',
`statement_begin_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账开始时间',
`statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间',
`statement_num` varchar(500) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '结算单号',
`statement_info` text NOT NULL COMMENT '订单相关信息json',
`pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款状态 -1:打款失败 0:未打款 1:打款成功',
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付完成时间',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '生成时间',
`pay_info` text COMMENT '打款信息',
`document_maker` varchar(255) DEFAULT '' COMMENT '制单信息',
`payment_user` varchar(255) DEFAULT '' COMMENT '打款基础信息',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
PRIMARY KEY (`id`),
KEY `batch_num` (`batch_num`) USING BTREE,
KEY `statement_begin_time` (`statement_begin_time`) USING BTREE,
KEY `statement_end_time` (`statement_end_time`) USING BTREE,
KEY `pay_status` (`pay_status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='exce汇总单';
-- zyx 20200629
ALTER TABLE `sys_member`
ADD COLUMN `real_name` varchar(255) NULL DEFAULT '' COMMENT '真实姓名' AFTER `status`;
@ -2117,4 +2147,22 @@ CREATE TABLE `tab_market_altogether` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
INSERT INTO `tab_tool`(`id`, `name`, `title`, `config`, `type`, `status`) VALUES (59, 'tax_radio', '公司税费', '{"tax_radio":1.5,"time":1589361782}', 1, 1)
INSERT INTO `tab_tool`(`id`, `name`, `title`, `config`, `type`, `status`) VALUES (59, 'tax_radio', '公司税费', '{"tax_radio":1.5,"time":1589361782}', 1, 1)
--20200709 chenzhi
CREATE TABLE `tab_payment_member` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`real_name` varchar(255) DEFAULT '' COMMENT '真实姓名',
`mobile` char(11) NOT NULL COMMENT '手机号码',
`last_login_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间',
PRIMARY KEY (`id`),
KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打款登陆账号';
INSERT INTO `tab_payment_member` (`id`, `real_name`, `mobile`, `last_login_time`) VALUES ('1', '胡歌', '18959188422', '0')

@ -6,13 +6,13 @@ require_once "aop/request/AlipayFundTransOrderQueryRequest.php";
require_once "aop/request/AlipayFundAccountQueryRequest.php";
class Fund {
private $appCertPath = __DIR__ . "/cert/appCertPublicKey_2021001165628090.crt";
private $appCertPath = __DIR__ . "/cert/appCertPublicKey_2021001150621489.crt";
private $alipayCertPath = __DIR__ . "/cert/alipayCertPublicKey_RSA2.crt";
private $rootCertPath = __DIR__ . "/cert/alipayRootCert.crt";
private $gatewayUrl = "https://openapi.alipay.com/gateway.do";
private $appId = "2021001165628090";
private $alipayUserId = '2088331082835421'; // pid
private $rsaPrivateKey = 'MIIEowIBAAKCAQEAmDggf4zno5KmKKEv0gbKctXyceEylTbWgZhannFGDXBkVkUqKC1btcKOFRWteVcQDFFCAgMobiTxH4rpIopyoC3x66mAynTVQnEWYFCyc628ZMAJ6aXQMvYNmzJgDczX8YI9taXbOf2YtV3uLdSs6t3Qm/rCBfrn/wj30QNsUm1f8yqCiHVwZ3jTM3ygKCr4SU3XjTKa1IqlYvGgIHrNHmTwATxvNRXa9pDTvSFz/zdvFxveWBn9PDhiNVebgEDFq0Xtv//z78UzRC3T8vV7HfCvcuR/gH0bVhvTzK55VlXlANM8o06tGsOj1jpJUGjUeMe2yiH9bDO810zNuri9LwIDAQABAoIBADoZQh4s88S1FoJvc0cgnGjUTCM3Jw1YzurL8dqDtY8vlLxwzbRkC5sGVSCrE3k6x79LzHvkJKxVoUq+xFkQqsuEfc/K9INRsIwZicbdRh9s8nkp6x6o0RyCWZMg2RSrWMivQ0pvsYsixgSDg4Mup4lFfHfsb93EdIQdMikuu0uCKFcXLO8UTma7mBRLdOis11vaZv7ROVftEUww9MZHCh/AJl7S73RvwZwZHQ9H5Y7fJ8EFqARJmTDEwDaOUQUGVTVho85KIlvpQ9gYbwy9R+xbftBSra+/THTiYjcMPR06wbf0dQwSunsz/NK4guVIpjKD23hQI1XcTcvxl6qRvjECgYEA12oro1NV9U4wVdwbbGzonW3hyNIE8pNbs3AE4q8pJF8aTVVnQuicunrgfK1W88urrngMMx+byg4ZnxUmahcyU+fId+z6FZbfypij+lMRpF85oQ0bhcXn04dcJimMlNrV4i62GeVcKtaAvoVXNYOXeS7SHtZ2nI0f7ArHbdgpbgMCgYEAtOXtfm3+CmNrlbhyPXPjUbNY3q3Uo09X6R01zYSvIobl3hoVVsw+7zJIAAaCTLcRxiVhvK5QVdRi/ohUphu2YugJx8fzNw6zl0iR/B9dWpDplMFDn3VOuS5UBeIHDn1C/A8RO7VKmYpCSAyHZxaxg0sAsAqjn9pk0ClvFpshcmUCgYEAwxXL32Yher8M1zU3QMKBB9HzoMNS57y8V40jX4fyYpYeY9rsYZP4HIobs83n6XKSULc3lTUTCbIrUf79gybu1T4cNz/OXK7+jaQfHR0N5Sa4MjqEqmnIwbDcq1MFlel5uhVDpcAp8EHC5sgrarN6Aq18baEcWjsUpdg9NCWHn7ECgYAVcyodErfLzYwlPbC2Hra2qliAVwZesvrOlnsZuoD1zB8Xneon16IixMiK0DrFE/QUlbwoHldCRiPS4KGA7MpMogz+1nO9dI3RA3bj+WgdZA9+Zwg4sTU7egXWiL2jdzDpKHQ3q0CEQkOnvWyUybkUw2D6fth2DPRlRnR4rr5hjQKBgHxl/E/sWi8iTN1thUbWzs2Q/8Qt+CHiXnWEU1rraV/0OlE4wbYVyFxURuZHCNdpTyuj0LS28WanbjJsmceL//+hy5qcjSBFJ8UO4Mw8pwDM8SEfWbo/MHNV48ElovOXxLrKTuvQUR6duWkv73qZYOpPYr+Rl0ylHGvNsqsLY7LZ';
private $appId = "2021001150621489";
private $alipayUserId = '2088731986604211'; // pid
private $rsaPrivateKey = 'MIIEogIBAAKCAQEAokaztliXge4pDoNWVVdYNSq6N+Be7xNU2LBKANhhdPfSny1VdCBgn7bbuSXA38ubkVZ8xZ/oFcPHa0LMZ5Ki9hRntU+Ry7vJN5kKwqP1CX8rCVWj2Jx2IuTUNdFA1TzCSLV1UMNvIIkFTFnkJUR++YWoQ2EBDYuQsccSbveZ4U5bHf4xopNhQ42a3lwVyuJaBC3q/m4pLVkBIxupP7HSgc3M/ZP0EBHRoq65wHrRsW70A3JPYCmKaw+9W0qeM2fmSXjhU0U7TS1QyyWLwaYgkFZySFscGYVgG6L1dzdVkSbQxlcp/3kEBQXnwTgdODBCdoNrDBZyIteMOlzfZ2MK/QIDAQABAoIBACkqSFJ8fMqgENg2pwL1KlIqaZzdFRgOzlo9tjgqq+ZRK6PniyLvR7OcXnbERf4/l1IyH2q+mtBSntbt1g58G0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6ZAIo2vNSjqJudQS/16Q8xu8Gxzl9E9e3LZBeE=';
public function transfer($aliAccount, $realName, $orderId, $amount, $title='') {

@ -1,19 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDtTCCAp2gAwIBAgIQICAGGS5p70QviSuHRfPPBjANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
MIIDtTCCAp2gAwIBAgIQICAHED3e6K/ggqeAVyIHETANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0
aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs
YXNzIDIgUjEwHhcNMjAwNjE5MDc1OTUwWhcNMjIwNjE5MDc1OTUwWjCBlTELMAkGA1UEBhMCQ04x
YXNzIDIgUjEwHhcNMjAwNzEwMDgwMzI0WhcNMjIwNzEwMDgwMzI0WjCBlTELMAkGA1UEBhMCQ04x
MDAuBgNVBAoMJ+emj+W7uumHkeiPoOiPnOe9kee7nOenkeaKgOaciemZkOWFrOWPuDEPMA0GA1UE
CwwGQWxpcGF5MUMwQQYDVQQDDDrmlK/ku5jlrp0o5Lit5Zu9Kee9kee7nOaKgOacr+aciemZkOWF
rOWPuC0yMDg4MzMxMDgyODM1NDIxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApGA7
3xiJnGXsrIPCqTSgq9C/4uNArsX3/xBE1qSl6n4X2NR+oejR9fVzM3+rlo4npJPUDh5sq3udfUNW
kC5Gb4MzHyNExNWD97pV+xNjwwKIV95ysll44qNFhSIeeiHg3duPV9ZJ3GxUS2lAE0Mw3+6eU5QF
AjYHmBsozCXz3RKk9UxVNBR3VkjLzkUh7kyg00kv/pIFM03i4l804FQ3ssbzE5FSL9maucibwRib
AnStR778bM9r9PLNZ48v9XeAGThfk9WFoOfbJB8UQMgO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