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

# Conflicts:
#	Data/update.sql
master
zhengyongxing 4 years ago
commit 27ffddfe75

@ -2237,7 +2237,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['receive_company']['opening_bank']);//开户行
$height = 20;
$font_size = 56;
$font_size = 44;
if (strlen($data['pay_company']['partner'])<strlen($data['receive_company']['partner'])) {
$partner_height = intval(strlen($data['receive_company']['partner'])/$font_size)+1;

@ -640,8 +640,11 @@ class AggregateFinanceStatementController extends ThinkController
if($data['pay_type'] == 0){
//甲-乙
$data['pay_company'] = $data['second_party_info'];
$data['invoice'] = $data['first_party_info'];
}else{
$data['pay_company'] = $data['first_party_info'];
$data['invoice'] = $data['second_party_info'];
}
$this->doAddOperationLog($id,"导出");
$relation = M("company_relation","tab_")->where("(first_company_id={$data['channel_id']} and first_company_type=3) or (second_company_id = {$data['channel_id']} and second_company_type=3)")->find();
@ -754,14 +757,14 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->getRowDimension(($line+6))->setRowHeight($address_height*$height);
//开票信息
$invoice_data = "发票类型:".$data['pay_company']['invoice_type'];
$invoice_data .= "\n发票抬头".$data['pay_company']['partner'];
$invoice_data .= "\n纳税人识别号".$data['pay_company']['company_tax_no'];
$invoice_data = "发票类型:".$data['invoice']['invoice_type'];
$invoice_data .= "\n发票抬头".$data['invoice']['partner'];
$invoice_data .= "\n纳税人识别号".$data['invoice']['company_tax_no'];
$invoice_data .= "\n开户银行".$data['pay_company']['opening_bank'];
$invoice_data .= "\n开户账号".$data['pay_company']['bank_account'];
$invoice_data .= "\n开票内容".$data['pay_company']['invoice_item'];
$invoice_data .= "\n注册地址及电话".$data['pay_company']['register_address'].",".$data['second_party_info']['register_phone'];
$invoice_data .= "\n开户银行".$data['invoice']['opening_bank'];
$invoice_data .= "\n开户账号".$data['invoice']['bank_account'];
$invoice_data .= "\n开票内容".$data['invoice']['invoice_item'];
$invoice_data .= "\n注册地址及电话".$data['invoice']['register_address'].",".$data['second_party_info']['register_phone'];
$objPHPExcel->getActiveSheet()->setCellValue('B'.($line+7), $invoice_data);//乙方
@ -851,7 +854,7 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+6), $data['second_party_info']['address']);//邮寄地址
$height = 20;
$font_size = 56;
$font_size = 44;
if (strlen($data['second_party_info']['partner'])<strlen($data['first_party_info']['partner'])) {
$partner_height = intval(strlen($data['first_party_info']['partner'])/$font_size)+1;

@ -1455,6 +1455,8 @@ class CompanyStatementController extends ThinkController
$statement_data = [];
$company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find();
// dump($company_data);die();
$company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find();
$insert['is_payment'] = $company_type['is_payment'];
@ -1473,7 +1475,7 @@ class CompanyStatementController extends ThinkController
$proCompany_info['link_man'] = $company_data['settlement_contact'];
$proCompany_info['link_phone'] =$company_data['contact_phone'];
$proCompany_info['address'] = $company_data['address'];
$proCompany_info['payee_name'] =$company_data['company_name'];
$proCompany_info['payee_name'] =$company_data['bank_address'];
$proCompany_info['bank_account'] = $company_data['bank_card'];
$proCompany_info['opening_bank'] =$company_data['bank_name'];

@ -294,6 +294,11 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money'] = "=ROUND(";
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
$va['row'] = count($va['game_list']);
@ -336,15 +341,13 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money'] .= "N{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['sum_money'] += $val['sum_money'];
// $count['sum_money'] += $val['sum_money'];
}
}
$count['week_money'] += $va['week_amount'];
$count['sum_money'] += $va['week_amount'];
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;
$v['row'] = $row;
if($is_export){
if($v['withdraw_type'] != 3) {
@ -388,6 +391,10 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money'] = "=ROUND(";
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
$va['row'] = count($va['game_list']);
@ -430,15 +437,13 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money'] .= "N{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['sum_money'] += $val['sum_money'];
// $count['sum_money'] += $val['sum_money'];
}
}
$count['week_money'] += $va['week_amount'];
$count['sum_money'] += $va['week_amount'];
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;
$v['row'] = $row;
if($is_export){
if($v['withdraw_type'] != 3) {
@ -484,7 +489,7 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money'] = "=ROUND(";
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
// dump($handle_data);
$v['statement_info'] = $handle_data;
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
@ -515,17 +520,19 @@ class CompanyStatementPoolController extends ThinkController
if($v['withdraw_type'] != 3) {
$val['sum_money'] = "=ROUND((K{$line}-L{$line})*(M{$line}+N{$line}),2)";
} else {
$val['sum_money'] = "=ROUND(K{$line}*(N{$line}),2)";
$val['sum_money'] = "=ROUND((K{$line}-L{$line})*(N{$line}),2)";
}
$v['statement_money'] .= "S{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['week_money'] += $val['sum_money'];
$count['sum_money'] += $val['sum_money'];
// $count['sum_money'] += $val['sum_money'];
}
}
$count['week_money'] += $va['week_amount'];
$count['sum_money'] += $va['week_amount'];
}
// dump($count);
$v['row'] = $row;
@ -598,7 +605,7 @@ class CompanyStatementPoolController extends ThinkController
//周结算金额计算
for ($i=0;;$i++) {
if ($sv[$i]['sum_money']) {
$game_data['week_amount'] += $sv[$i]['sum_money'];
$game_data['week_amount'] += $sv[$i]['sum_money']- $sv[$i]['withhold']+$sv[$i]['reward']-$sv[$i]['fine'];
$game_data['withhold_amount'] += $sv[$i]['withhold'];
$game_data['fine'] += $sv[$i]['fine'];
$game_data['reward'] += $sv[$i]['reward'];
@ -696,7 +703,7 @@ class CompanyStatementPoolController extends ThinkController
}
}
// dump($handle_data);
return $handle_data?$handle_data:[];
}
@ -1703,8 +1710,14 @@ class CompanyStatementPoolController extends ThinkController
$amount = 0;
$statement_amount = 0;
$statement_lack_amount = 0;
$reward = 0;
$fine = 0;
$lreward = 0;
$lfine = 0;
$handledata = [];
// dump($increment_ratio);
foreach ($increment_ratio as $key => $value) {
$statement_info = array();
@ -1712,12 +1725,27 @@ class CompanyStatementPoolController extends ThinkController
if ($st[$key][$akey] == 1) {
$model = M("company_statement_info","tab_");
if (!$handledata[$key][1]) {
$handledata[$key][1] = 1;
} else {
continue;
}
} else {
$model = M("company_lack_statement_info","tab_");
if (!$handledata[$key][0]) {
$handledata[$key][0] = 1;
} else {
continue;
}
}
$statement_data = $model->where(['id'=>$key])->find();
$statement_info = json_decode($statement_data['statement_info'],true);
foreach ($statement_info as $k => $v) {
@ -1737,12 +1765,13 @@ class CompanyStatementPoolController extends ThinkController
$statement_info[$k]['game_list'][$gk]['sum_money'] = $sum_money[$key][$v['account']][$gk];
$amount += $sum_money[$key][$v['account']][$gk];
$amount += $sum_money[$key][$v['account']][$gk] - $statement_info[$k]['game_list'][$gk]['withhold'];
if ($st[$key][$akey] == 1) {
$statement_amount += $sum_money[$key][$v['account']][$gk];
$statement_amount += $sum_money[$key][$v['account']][$gk]-$statement_info[$k]['game_list'][$gk]['withhold'];
} else {
$statement_lack_amount += $sum_money[$key][$v['account']][$gk];
$statement_lack_amount += $sum_money[$key][$v['account']][$gk]-$statement_info[$k]['game_list'][$gk]['withhold'];
}
}
@ -1751,7 +1780,16 @@ class CompanyStatementPoolController extends ThinkController
$statement_info_data = json_encode($statement_info);
$model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount,'pay_amount'=>$amount,'remark'=>$remark[$key]]);
$r_data = $model->field("fine,reward")->where(['id'=>$key])->find();
if($model == M("company_statement_info","tab_")) {
$reward += $r_data['reward'];
$fine += $r_data['fine'];
} else {
$lreward += $r_data['reward'];
$lfine += $r_data['fine'];
}
$model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount+($r_data['reward']?$r_data['reward']:0)-($r_data['fine']?$r_data['fine']:0),'pay_amount'=>$amount,'remark'=>$remark[$key]]);
$amount = 0;
@ -1759,8 +1797,8 @@ class CompanyStatementPoolController extends ThinkController
}
M("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount,'lack_statement_money'=>$statement_lack_amount]);
//die();
M("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount+$reward-$fine,'lack_statement_money'=>$statement_lack_amount+$lreward-$lfine]);
$this->ajaxReturn(['status'=>1,'info'=>'保存成功']);

@ -952,14 +952,16 @@ class CompanyStatementSetController extends Controller {
$spenMap = [
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]],
"s.is_check"=>1
];
$cpMap = [
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]]
];
$cpAllMap =[
"s.pay_status"=>1,
"s.payed_time"=>['elt',$endtime]
];
// dump($spenMap);
$cpMap = $spenMap;
$cpMap["s.payed_time"] = ['between', [strtotime(date("Y-m-1",$begintime)),$endtime]];
$cpAllMap = $spenMap;
$cpAllMap["s.payed_time"] = ['elt',$endtime];
for ($i=0; $i <count($idarr); $i++) {
$company_id = $idarr[$i];
@ -996,6 +998,7 @@ class CompanyStatementSetController extends Controller {
if(empty($list)){continue;}
foreach($list as $k=>$v){
try {
@ -1256,15 +1259,19 @@ class CompanyStatementSetController extends Controller {
$spenMap = [
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]],
"s.is_check"=>1
];
$cpallgame = [];
$cpgame = [];
$cpMap = $spenMap;
$cpMap["s.payed_time"] = ['between', [strtotime(date("Y-m-1",$begintime)),$endtime]];
$cpMap = [
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]]
];
$cpAllMap = $spenMap;
$cpAllMap["s.payed_time"] = ['elt',$endtime];
$cpAllMap = [
"s.pay_status"=>1,
"s.payed_time"=>['elt',$endtime]
];
// unset($cpAllMap["s.payed_time"]);
for ($i=0; $i <count($idarr); $i++) {
@ -1684,6 +1691,8 @@ class CompanyStatementSetController extends Controller {
$p_info['pay_amount'] = $this->getRelationGameIdPromoteSpend($p_info["p_id"],$p_info['relation_game_id'],$tmp_game_ratio['begintime'],$tmp_game_ratio['endtime']);
$p_info['pay_amount'] = number_format($p_info['pay_amount'],2,'.','');
$v['platform_amount'] += $p_info['pay_amount'];
$p_info['sum_money']=round($p_info['pay_amount']*$tratio/100,2); //个人等于 结算金额*比例
$v['pay_amount'] += $p_info['sum_money'];
@ -1760,6 +1769,7 @@ class CompanyStatementSetController extends Controller {
}
$temp_game['pay_amount'] = $this->getRelationGameIdPromoteSpend($p_info["p_id"],$p_info['relation_game_id'],$tmp_game_ratio['begintime'],$tmp_game_ratio['endtime']);
$temp_game['pay_amount'] -=0;
$temp_game['pay_amount'] = number_format($temp_game['pay_amount'],2,'.','');
$v['platform_amount'] += $temp_game['pay_amount'];
$temp_game['sum_money']=round($temp_game['pay_amount']*$tratio/100,2); //个人等于 结算金额*比例
@ -2127,6 +2137,7 @@ class CompanyStatementSetController extends Controller {
$spenMap = [
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]],
"s.is_check"=>1
];
$company_id = $company_id;
@ -2152,6 +2163,7 @@ class CompanyStatementSetController extends Controller {
$spenMap = [
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]],
"s.is_check"=>1
];
$Pmap = [
@ -2177,8 +2189,6 @@ class CompanyStatementSetController extends Controller {
*/
protected function getModuleRatioGame($company_id,$relation_game_ids,$begintime,$endtime){
$where = [
"relation_game_id"=>["in",$relation_game_ids],
"company_id"=>$company_id,
@ -2199,9 +2209,41 @@ class CompanyStatementSetController extends Controller {
}
if(is_string($relation_game_ids)) $relation_game_ids = explode(",",$relation_game_ids);
$array_mer = [];
foreach ($relation_game_ids as $key => $value) {
$turnover_type = $this->getTurnoverType($value,$company_id,$begintime,$endtime);
if ($turnover_type == 2 || $turnover_type == 3 || $turnover_type == 4) {
$mercy_game = M("game",'tab_')->field("original_package_name")->where(['relation_game_id'=>$value])->find()['original_package_name'];
$original_game_id = M("game",'tab_')
->field("relation_game_id")
->where(['original_package_name'=>$mercy_game,'relation_game_id'=>['neq',$value]])
->group("relation_game_id")
->select();
foreach ($original_game_id as $k => $v) {
if(!in_array($v['relation_game_id'], $relation_game_ids)){
$array_mer[] = $v['relation_game_id'];
}
}
}
}
$relation_game_ids = array_merge($relation_game_ids,$array_mer);
if(empty($dbres)){
return implode(",",$relation_game_ids);;
return implode(",",$relation_game_ids);
}else{
$dbres = array_column($dbres,"relation_game_id");
$diff = array_diff($relation_game_ids,$dbres);

@ -1616,9 +1616,16 @@ class MarketPercentageController extends ThinkController
}
$belong_game = M("company_belong_game","tab_")
->where("((begin_time<={$time_start} and (end_time >={$time_start} or end_time=0)) or (begin_time<={$time_end} and end_time >={$time_end}) or (end_time>={$time_start} and end_time <={$time_end})) and id != {$id}")
->select();
if ($_POST['end_time']) {
$belong_game = M("company_belong_game","tab_")
->where("((begin_time<={$time_start} and (end_time >={$time_start} or end_time=0)) or (begin_time<={$time_end} and end_time >={$time_end}) or (end_time>={$time_start} and end_time <={$time_end})) and id != {$id}")
->select();
} else {
$belong_game = M("company_belong_game","tab_")
->where("(begin_time>={$time_start} or (end_time >={$time_start})) and id != {$id}")
->select();
}
if ($belong_game) {

@ -10,6 +10,40 @@ namespace Admin\Controller;
class OldCountController extends \Think\Controller
{
public function oldRewardChange() {
$data = M("company_statement_info","tab_")
->where("(fine > 0 or reward > 0) and company_type = 2")
->select();
foreach ($data as $key => $value) {
$statement_info = json_decode($value['statement_info'],true);
$statement_info[0]['game_list'][0]['fine'] = $value['fine'];
$statement_info[0]['game_list'][0]['reward'] = $value['reward'];
$statement_info = json_encode($statement_info);
M("company_statement_info","tab_")->where(['id'=>$value['id']])->save(['statement_info'=>$statement_info]);
}
$pool_data = M("company_statement_pool",'tab_')->where(['id'=>['in',[22,27]]])->select();
foreach ($pool_data as $key => $value) {
$save = json_decode($value['verify_log'],true);
$save['firstverify_user'] = $save['verify_user'];
$save['firstverify_time'] = $save['verify_time'];
$save = json_encode($save);
M('company_statement_pool','tab_')->where(['id'=>$value['id']])->save(['verify_log'=>$save]);
}
echo "success";
}
public function changeCompanyGameidToPromoteGameid()
{
//默认设为

@ -563,6 +563,12 @@ class PromoteCompanyController extends ThinkController
$deposit = M('president_deposit', 'tab_')->where(['company_id' => $data['id']])->find();
$siteConfig = $data['site_config'] == '' ? null : json_decode($data['site_config'], true);
if ($siteConfig) {
$siteConfig['logo'] = get_cover($siteConfig['logo'], 'path');
$siteConfig['icon'] = get_cover($siteConfig['icon'], 'path');
}
$this->assign('selfCompanies', $selfCompanies);
$this->assign('payWays', PresidentDepositService::$payWays);
$this->assign('payTypes', PresidentDepositService::$payTypes);
@ -571,7 +577,7 @@ class PromoteCompanyController extends ThinkController
$this->assign('deposit', $deposit);
}
$this->assign('relation', $relation);
$this->assign('siteConfig', $siteConfig);
$this->assign('data', $data);
$this->meta_title ='推广公司信息查看';
$this->display();
@ -618,6 +624,12 @@ class PromoteCompanyController extends ThinkController
$selfCompanies = M('company_info', 'tab_')->field('id,partner company_name,link_man,link_phone')->where(['status' => 1])->select();
$siteConfig = $data['site_config'] ?? null;
if ($siteConfig) {
$siteConfig['logo'] = get_cover($siteConfig['logo'], 'path');
$siteConfig['icon'] = get_cover($siteConfig['icon'], 'path');
}
$this->assign('selfCompanies', $selfCompanies);
$this->assign('payWays', PresidentDepositService::$payWays);
$this->assign('payTypes', PresidentDepositService::$payTypes);
@ -627,6 +639,7 @@ class PromoteCompanyController extends ThinkController
}
$this->assign('relation', $data['relation'] ?? null);
$this->assign('data', $data);
$this->assign('siteConfig', $siteConfig);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/edit'])->find());
$this->meta_title ='审核信息查看';
$this->display("view");
@ -733,6 +746,10 @@ class PromoteCompanyController extends ThinkController
if($data['resources'] == ''){
$data['resources'] ="[]";
}
$siteConfig = null;
if ($data['site_config']) {
$siteConfig = json_decode($data['site_config'], true);
}
$data['turnover_ratio'] = $data['turnover_ratio'] ? json_decode($data['turnover_ratio'], true) : $data['turnover_ratio'];
// $data['game_ids'] = explode(',', $data['game_ids']);
@ -772,6 +789,7 @@ class PromoteCompanyController extends ThinkController
$this->assign('relation', $relation);
$this->assign('serviceAgreements', M('service_agreement', 'tab_')->select());
$this->assign('siteConfig', $siteConfig);
$this->assign('data', $data);
$this->display();
}
@ -1163,13 +1181,36 @@ class PromoteCompanyController extends ThinkController
}
}
if (isset($save['is_site_custom']) && $save['is_site_custom'] == 1) {
if ($save['site_domain_prefix'] == '') {
$this->error('请输入推广后台域名前缀');
}
if (strlen($save['site_domain_prefix']) > 6) {
$this->error('域名前缀不能超过6个字符');
}
if (!preg_match('/^[a-z0-9]+$/', $save['site_domain_prefix'])) {
$this->error('域名前缀只能由小写字母和数字组成');
}
if ($save['site_config']['icon'] == '') {
$this->error('请上传推广后台ICON');
}
if ($save['site_config']['logo'] == '') {
$this->error('请上传推广后台logo');
}
/**
* @todo 暂未检查待审核的推广公司是否含有重复域名前缀
*/
$domainExistMap = ['site_domain_prefix' => $save['site_domain_prefix']];
if (!empty($save['id'])) {
$domainExistMap['id'] = ['neq', $save['id']];
}
$domainCompany = M('promote_company', 'tab_')->field(['id'])->where($domainExistMap)->find();
if ($domainCompany) {
$this->error('推广后台域名前缀已存在');
}
}
// if(!empty(I("contact_phone")) && !checkPhone(I('contact_phone'))) {
// $this->error('联系电话格式不正确');
// }
// if(!empty(I('reg_phone')) && !checkPhone(I('reg_phone'))) {
// $this->error('注册电话格式不正确');
// }
if(!empty(I('taxation_rate')) && I('taxation_rate') > 0) {
if(!checkNumber(I('taxation_rate'))){
$this->error('税费费率格式错误');

@ -810,9 +810,9 @@ class TimingController extends AdminController {
}
//
if (isset($return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']])) {
$return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = !$is_inside?$v['sum_money']:0;
$return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = !$is_inside?($v['sum_money']-($v['withhold']?$v['withhold']:0)):0;
} else {
$return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += !$is_inside?$v['sum_money']:0;
$return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += !$is_inside?($v['sum_money']-($v['withhold']?$v['withhold']:0)):0;
}
}
@ -1199,7 +1199,7 @@ class TimingController extends AdminController {
->join("left join tab_promote_company company on promote.company_id = company.id")
->join("left join ({$data}) auth on auth.uid=market_admin_id")
->where(['develop_type'=>['egt',1],'group_id'=>['in',['11','12','21']]])
// ->where(['company_id'=>278,'spend.promote_id'=>3917,'relation_game_id'=>213])
// ->where(['company_id'=>43,'spend.promote_id'=>1498,'relation_game_id'=>191])
// ->order("is_settlement ASC")
->select();
@ -1235,6 +1235,8 @@ class TimingController extends AdminController {
->order("begin_time ASC")
->select();
// dump($company_belong_game);
$promote_data[$key]['promote_amount'] = 0;
foreach ($company_belong_game as $ck => $cv) {
@ -1294,10 +1296,10 @@ class TimingController extends AdminController {
}
if ($ck > 1) {
// echo 3;
if (($cv['begin_time'] - $company_belong_game[$ck-1]['end_time'] + 86399) > 1) {
if ($ck > 0) {
if (($cv['begin_time'] - $company_belong_game[$ck-1]['end_time'] + 86399) > 1) {
// echo 3;
$promote_data[$key]['promote_amount'] += $this->getCompanyGameRadio($value['admin_id'],$value['promote_id'],$value['company_id'],$value['relation_game_id'],$company_belong_game[$ck-1]['end_time'] + 86400,$cv['begin_time']-1,$value['pay_amount']);
}
}

@ -46,9 +46,9 @@ class CompanyGameRatioModel extends Model
foreach($company_belong_game as $key => $value) {
if ($value['begin_time'] > $company_begin_time) {
$game_ratio[$game_id] = array_merge($game_ratio[$game_id],$this->getGameRadio($company_id,$game_id,$company_belong,$company_begin_time,$value['begin_time']));
$game_ratio[$game_id] = array_merge($game_ratio[$game_id],$this->getGameRadio($company_id,$game_id,$company_belong,$company_begin_time,$value['begin_time']-1));
if ($value['end_time'] >= $company_end_time) {
if ($value['end_time'] >= $company_end_time || !$value['end_time']) {
// $game_ratio[$game_id] = array_merge($game_ratio[$game_id],[[
// "begintime" => $value['begin_time'],
// "endtime"=>$company_end_time,
@ -75,7 +75,7 @@ class CompanyGameRatioModel extends Model
}
}
} else {
if ($value['end_time'] >= $company_end_time) {
if ($value['end_time'] >= $company_end_time || !$value['end_time']) {
// $game_ratio[$game_id] = array_merge($game_ratio[$game_id],[[
// "begintime" => $company_begin_time,
// "endtime"=>$company_end_time,

@ -172,10 +172,13 @@
<td><span class="sum_money_span">{$com['statement_info'][0]['game_list'][0]['sum_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
<td rowspan="{$com.row}">{$com['reward']}</td>
<td rowspan="{$com.row}">{$com['fine']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}"><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]"></td>
<td rowspan="{$com['statement_info'][0]['time_row']}" class="week_amount">{$com['statement_info'][0]['week_amount']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['reward']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['fine']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
</td>
<td rowspan="{$com['statement_info'][0]['time_row']}"><span class="week_amount">{$com['statement_info'][0]['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$com['statement_info'][0]['week_amount']}"></td>
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
<else />
@ -229,7 +232,10 @@
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td><span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['sum_money']}" style="width: 20px;display: none"></td>
<td>
<span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$game['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
</td>
<!-- <td><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][]"></td>-->
</tr>
@ -259,10 +265,23 @@
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
<td><span class="sum_money_span">{$account['game_list'][0]['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['sum_money']}" style="width: 20px;display: none"></td>
<td>
<span class="sum_money_span">{$account['game_list'][0]['sum_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$account['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
</td>
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">{$account['reward']|default=0}</td>
<td rowspan="{$account['time_row']}">{$account['fine']|default=0}</td>
</notempty>
<notempty name="account['time']">
<td rowspan="{$account['time_row']}"><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]"></td>
<td rowspan="{$account['time_row']}" class="week_amount">{$account['week_amount']}</td>
<td rowspan="{$account['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
</td>
<td rowspan="{$account['time_row']}"><span class="week_amount">{$account['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$account['week_amount']}"></td>
</notempty>
<else />
<td>-</td>
@ -291,7 +310,10 @@
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['account']}][]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$account['account']}][]" value="{$game['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td><span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$game['sum_money']}" style="width: 20px;display: none"></td>
<td>
<span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$game['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$account['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
</td>
<!-- <td><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][]"></td>-->
</tr>
@ -454,14 +476,22 @@
//退款
var withhold = $(_this).parent().parent().find(".withhold").val();
if (!withhold || withhold < 0) {
var oldwithhold = $(_this).parent().parent().find(".oldwithhold").val();
// console.log(withhold-oldwithhold);
if (!withhold ) {
withhold = 0;
$(_this).parent().parent().find(".withhold").val(withhold);
} else if(parseFloat(withhold) > parseFloat(pay_money)) {
withhold = pay_money;
$(_this).parent().parent().find(".withhold").val(withhold);
}
if (!oldwithhold ) {
oldwithhold = 0;
$(_this).parent().parent().find(".oldwithhold").val(oldwithhold);
}
// else if(parseFloat(withhold) > parseFloat(pay_money)) {
// withhold = pay_money;
// $(_this).parent().parent().find(".withhold").val(withhold);
// }
//补点
var increment_ratio = $(_this).parent().parent().find(".increment_ratio").val();
if (!increment_ratio || increment_ratio < 0) {
@ -485,20 +515,26 @@
var this_amount = week_amount_find.find(".sum_money_span").text();
var week_amount = 0;
var i = 0;
for (;;) {
week_amount = week_amount_find.find(".week_amount").text();
i++;
// console.log(week_amount);
if (week_amount) {
break;
} else {
week_amount_find = week_amount_find.prev();
}
if (i>10) {
break;
}
}
var D_value = parseFloat(old_amount)-parseFloat(this_amount) - parseFloat(withhold);
var D_value = parseFloat(old_amount)-parseFloat(this_amount) + parseFloat(withhold-oldwithhold);
week_amount_find.find(".week_amount").text((parseFloat(week_amount)-D_value).toFixed(2));
week_amount_find.find(".week_amount").text((parseFloat(week_amount) - D_value).toFixed(2));
$(_this).parent().parent().find(".oldwithhold").val(withhold)
}
//结算金额重算
@ -524,9 +560,15 @@
for (var i =0;i<parseInt(row);i++) {
var amount = get_item.find(".sum_money_span").text();
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
get_item = get_item.next();
var amount = get_item.find(".week_amount").text();
if (amount) {
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
get_item = get_item.next();
} else {
get_item = get_item.next();
}
}
// week_amount_find.find(".week_amount").text();

@ -167,8 +167,8 @@
<!-- <td>{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}-{$com['statement_info'][0]['game_list'][0]['statement_end_time']}</td>-->
<td><span class="pay_amount">{$com['statement_info'][0]['game_list'][0]['pay_amount']}</span></td>
<td>
{$com['statement_info'][0]['game_list'][0]['refund']|default=0}
<!-- <input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]">-->
<!-- {$com['statement_info'][0]['game_list'][0]['refund']|default=0}-->
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['account']}][]">
</td>
<td>{$com['statement_info'][0]['game_list'][0]['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['account']}][]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
@ -178,10 +178,11 @@
<td rowspan="{$com.row}">{$com['reward']}</td>
<td rowspan="{$com.row}">{$com['fine']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}
<!-- <input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][]">-->
<!-- {$com['statement_info'][0]['game_list'][0]['withhold']|default=0}-->
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}" style="width: 40px;display: none" >
</td>
<td rowspan="{$com['statement_info'][0]['time_row']}" class="week_amount">{$com['statement_info'][0]['week_amount']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}"><span class="week_amount">{$com['statement_info'][0]['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$com['statement_info'][0]['week_amount']}"></td>
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
<else />
@ -267,8 +268,12 @@
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
<td><span class="sum_money_span">{$account['game_list'][0]['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$account['account']}][]" value="{$account['game_list'][0]['sum_money']}" style="width: 20px;display: none"></td>
<notempty name="account['time']">
<td rowspan="{$account['time_row']}"><input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]"></td>
<td rowspan="{$account['time_row']}" class="week_amount">{$account['week_amount']}</td>
<td rowspan="{$account['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
</td>
<td rowspan="{$account['time_row']}"><span class="week_amount">{$account['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$account['week_amount']}"></td>
</notempty>
<else />
<td>-</td>
@ -459,15 +464,23 @@
}
//退款
var withhold = $(_this).parent().parent().find(".withhold").val();
if (!withhold || withhold < 0) {
var withhold = parseFloat($(_this).parent().parent().find(".withhold").val());
var oldwithhold = $(_this).parent().parent().find(".oldwithhold").val();
if (!withhold ) {
withhold = 0;
$(_this).parent().parent().find(".withhold").val(withhold);
} else if(parseFloat(withhold) > parseFloat(pay_money)) {
withhold = pay_money;
$(_this).parent().parent().find(".withhold").val(withhold);
}
if (!oldwithhold ) {
oldwithhold = 0;
$(_this).parent().parent().find(".oldwithhold").val(oldwithhold);
}
// else if(parseFloat(withhold) > parseFloat(pay_money)) {
// withhold = pay_money;
// $(_this).parent().parent().find(".withhold").val(withhold);
// }
//补点
var increment_ratio = $(_this).parent().parent().find(".increment_ratio").val();
if (!increment_ratio || increment_ratio < 0) {
@ -481,30 +494,36 @@
var week_amount_find = $(_this).parent().parent();
var old_amount = week_amount_find.find(".sum_money_span").text();
var week_amount = 0;
var i = 0;
for (;;) {
week_amount = week_amount_find.find(".week_amount").text();
i++;
if (week_amount) {
break;
} else {
week_amount_find = week_amount_find.prev();
}
if (i>10) {
break;
}
}
//扣款
pay_money = parseFloat(pay_money) - parseFloat(refund);
var value = (parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100));
var value = (parseFloat(pay_money)*(parseFloat(increment_ratio)/100));
$(_this).parent().parent().find(".sum_money_span").text(value.toFixed(2));
$(_this).parent().parent().find(".sum_money").val(value.toFixed(2));
var this_amount = week_amount_find.find(".sum_money_span").text();
var week_amount = 0;
for (;;) {
week_amount = week_amount_find.find(".week_amount").text();
if (week_amount) {
break;
} else {
week_amount_find = week_amount_find.prev();
}
}
var D_value = parseFloat(old_amount)-parseFloat(this_amount) - parseFloat(withhold);
var D_value = parseFloat(old_amount)-parseFloat(this_amount) + parseFloat(withhold-oldwithhold) ;
week_amount_find.find(".week_amount").text((parseFloat(week_amount)-D_value).toFixed(2));
// week_amount_find.find(".week_amount_input").val((parseFloat(week_amount)-D_value- parseFloat(withhold)));
$(_this).parent().parent().find(".oldwithhold").val(withhold)
}
//结算金额重算
@ -530,9 +549,13 @@
for (var i =0;i<parseInt(row);i++) {
var amount = get_item.find(".sum_money_span").text();
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
get_item = get_item.next();
var amount = get_item.find(".week_amount").text();
if (amount) {
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
get_item = get_item.next();
}
}
// week_amount_find.find(".week_amount").text();

@ -22,6 +22,7 @@
<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__/czinputcheck.js?v=07151710" type="text/javascript"></script>
<script type="text/javascript" src="__JS__/uploader.js"></script>
<style>
.coin-detail{
display: block;
@ -358,6 +359,71 @@
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否定制推广后台:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="is_site_custom" >
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="is_site_custom" checked>
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr class="site-custom-item" style="display: none;">
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>推广后台域名前缀:</td>
<td class="r" >
<input type="text" class="txt" style="float: none;" name="site_domain_prefix" value="" placeholder="请输入推广后台域名前缀">
<span class="notice-text" style="float: none;">请确保唯一只能由小写字母和数字组成不能超过6个字符。完整地址 <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=C('DOMAIN', null, null)?>"></span></span>
</td>
</tr>
<tr class="picbox site-custom-item" style="display: none;">
<td class="l noticeinfo" ><i class="mustmark" style="margin-left:-7px">*</i>推广后台ICON</td>
<td class="r">
<span class="table_btn table_upload table_icon" style="float: none;">
<div class="upload-wrapper">
<input type="hidden" id="site-icon" name="site_config[icon]" value="" />
<div class="btns">
<div id="icon-uploader">
<div class="webuploader-pick" style="line-height:13px">上传图标</div>
</div>
</div>
<!--用来存放文件信息-->
<div class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">尺寸为16*16pxpng图片</span>
</td>
</tr>
<tr class="picbox site-custom-item" style="display: none;">
<td class="l noticeinfo" ><i class="mustmark" style="margin-left:-7px">*</i>推广后台LOGO</td>
<td class="r">
<span class="table_btn table_upload table_icon" style="float: none;">
<div class="upload-wrapper">
<input type="hidden" id="site-logo" name="site_config[logo]" value="" />
<div class="btns">
<div id="logo-uploader">
<div class="webuploader-pick" style="line-height:13px">上传图标</div>
</div>
</div>
<!--用来存放文件信息-->
<div class="uploader-list" style="display: flex;">
</div>
</div>
</span>
<span class="notice-text">尺寸为210*60px透明png图片</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">文档管理</td>
<td class="r table_radio">
@ -1202,5 +1268,66 @@
$('#deposit-pay-way').val('')
}
})
var uploadUrl = "{:U('File/uploadPicture', ['session_id'=>session_id(), 'flag'=>true])}"
var iconUploader = new WmUploader({
selector: '#icon-uploader',
url: uploadUrl,
accept: {
title: '图片',
extensions: 'png',
mimeTypes: 'image/*',
},
afterSuccess: function(file, response) {
if (response.status == 0) {
return layer.msg(response.info)
}
$('#site-icon').val(response.id)
},
afterDelete: function(file) {
$('#site-icon').val('')
}
})
var logoUploader = new WmUploader({
selector: '#logo-uploader',
url: uploadUrl,
accept: {
title: '图片',
extensions: 'png',
mimeTypes: 'image/*',
},
afterSuccess: function(file, response) {
if (response.status == 0) {
return layer.msg(response.info)
}
$('#site-logo').val(response.id)
},
afterDelete: function(file) {
$('#site-logo').val('')
}
})
$('input[name=is_site_custom]').on({
click: function() {
var isSiteCustom = $('input[name=is_site_custom]:checked').val()
if (isSiteCustom == 1) {
$('.site-custom-item').show()
} else {
$('.site-custom-item').hide()
}
}
})
$('input[name=site_domain_prefix]').on({
blur: function() {
var domain = $('#site-url-show').attr('data-domain');
var prefix = $.trim($(this).val());
if (domain != '' && prefix != '') {
$('#site-url-show').html('https://tg-' + prefix + domain)
} else {
$('#site-url-show').html('无')
}
}
})
</script>
</block>

@ -22,6 +22,7 @@
<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__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<script type="text/javascript" src="__JS__/uploader.js"></script>
<style>
.coin-detail{
display: block;
@ -359,6 +360,93 @@
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否定制推广后台:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="is_site_custom" <if condition="$data['is_site_custom'] eq 1">checked</if>> 是
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="is_site_custom" <if condition="$data['is_site_custom'] eq 0">checked</if>> 否
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr class="site-custom-item" <?php if($data['is_site_custom'] == 0):?>style="display:none"<?php endif;?>>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>推广后台域名前缀:</td>
<td class="r" >
<?php
$domain = C('DOMAIN', null, null);
$siteUrl = '无';
if ($domain && !empty($data['site_domain_prefix'])) {
$siteUrl = 'https://tg-' . $data['site_domain_prefix'] . $domain;
}
?>
<input type="text" class="txt" style="float: none;" name="site_domain_prefix" value="{$data.site_domain_prefix}" placeholder="请输入推广后台域名前缀">
<span class="notice-text" style="float: none;">请确保唯一只能由小写字母和数字组成不能超过6个字符。完整地址 <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=$domain?>"><?=$siteUrl?></span></span>
</td>
</tr>
<tr class="picbox site-custom-item" <?php if($data['is_site_custom'] == 0):?>style="display:none"<?php endif;?>>
<td class="l noticeinfo" ><i class="mustmark" style="margin-left:-7px">*</i>推广后台ICON</td>
<td class="r">
<span class="table_btn table_upload table_icon" style="float: none;">
<div class="upload-wrapper">
<input type="hidden" id="site-icon" name="site_config[icon]" value="<?=$siteConfig ? $siteConfig['icon'] : ''?>" />
<div class="btns">
<div id="icon-uploader">
<div class="webuploader-pick" style="line-height:13px">上传图标</div>
</div>
</div>
<!--用来存放文件信息-->
<div class="uploader-list" style="display: flex;">
<?php if(!empty($siteConfig['icon'])):?>
<div id="<?=$siteConfig['icon']?>" class="item flooring_page_img_box" style="margin-right: 10px;">
<a href="javascript:;"><img src="<?=get_cover($siteConfig['icon'], 'path')?>" style="width: 100px;height: 100px;cursor: move;"></a>
<h4 class="info" style="text-align: center;">
<a href="javascript:;" class="file-delete table_click" style="float:none;display:inline-block;" data-ref-tag="#site-icon">删除</a>
</h4>
</div>
<?php endif;?>
</div>
</div>
</span>
<span class="notice-text">尺寸为16*16pxpng图片</span>
</td>
</tr>
<tr class="picbox site-custom-item" <?php if($data['is_site_custom'] == 0):?>style="display:none"<?php endif;?>>
<td class="l noticeinfo" ><i class="mustmark" style="margin-left:-7px">*</i>推广后台LOGO</td>
<td class="r">
<span class="table_btn table_upload table_icon" style="float: none;">
<div class="upload-wrapper">
<input type="hidden" id="site-logo" name="site_config[logo]" value="<?=$siteConfig ? $siteConfig['logo'] : ''?>" />
<div class="btns">
<div id="logo-uploader">
<div class="webuploader-pick" style="line-height:13px">上传图标</div>
</div>
</div>
<!--用来存放文件信息-->
<div class="uploader-list" style="display: flex;">
<?php if(!empty($siteConfig['logo'])):?>
<div id="<?=$siteConfig['logo']?>" class="item flooring_page_img_box" style="margin-right: 10px;">
<a href="javascript:;"><img src="<?=get_cover($siteConfig['logo'], 'path')?>" style="width: 100px;height: 100px;cursor: move;"></a>
<h4 class="info" style="text-align: center;">
<a href="javascript:;" class="file-delete table_click" style="float:none;display:inline-block;" data-ref-tag="#site-logo">删除</a>
</h4>
</div>
<?php endif;?>
</div>
</div>
</span>
<span class="notice-text">尺寸为210*60px透明png图片</span>
</td>
</tr>
<tr>
<td class="l noticeinfo">文档管理</td>
<td class="r table_radio">
@ -1056,6 +1144,71 @@
if ($('#deposit-pay-type').val() == 3) {
$('.need-amount').hide();
}
// $('#deposit-pay-type').change()
var uploadUrl = "{:U('File/uploadPicture', ['session_id'=>session_id(), 'flag'=>true])}"
var iconUploader = new WmUploader({
selector: '#icon-uploader',
url: uploadUrl,
accept: {
title: '图片',
extensions: 'png,ico',
mimeTypes: 'image/*',
},
afterSuccess: function(file, response) {
if (response.status == 0) {
return layer.msg(response.info)
}
$('#site-icon').val(response.id)
},
afterDelete: function(file) {
$('#site-icon').val('')
}
})
var logoUploader = new WmUploader({
selector: '#logo-uploader',
url: uploadUrl,
accept: {
title: '图片',
extensions: 'png',
mimeTypes: 'image/*',
},
afterSuccess: function(file, response) {
if (response.status == 0) {
return layer.msg(response.info)
}
$('#site-logo').val(response.id)
},
afterDelete: function(file) {
$('#site-logo').val('')
}
})
$('input[name=is_site_custom]').on({
click: function() {
var isSiteCustom = $('input[name=is_site_custom]:checked').val()
if (isSiteCustom == 1) {
$('.site-custom-item').show()
} else {
$('.site-custom-item').hide()
}
}
})
$('input[name=site_domain_prefix]').on({
blur: function() {
var domain = $('#site-url-show').attr('data-domain');
var prefix = $.trim($(this).val());
if (domain != '' && prefix != '') {
$('#site-url-show').html('https://tg-' + prefix + domain)
} else {
$('#site-url-show').html('无')
}
}
})
$('.uploader-list').children().children('h4').children('.file-delete').on('click', function() {
var tag = $(this).attr('data-ref-tag');
$(this).parent().parent().remove();
$(tag).val('')
});
</script>
</block>

@ -374,6 +374,66 @@
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>是否定制推广后台:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" disabled class="inp_radio" value="1" name="is_site_custom" <if condition="$data['is_site_custom'] eq 1">checked
</if>> 是
</label>
<label>
<input type="radio" disabled class="inp_radio" value="0" name="is_site_custom" <if condition="$data['is_site_custom'] eq 0">checked
</if>> 否
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<?php if(isset($data['is_site_custom']) && $data['is_site_custom'] == 1):?>
<?php
$domain = C('DOMAIN', null, null);
$siteUrl = '无';
if ($domain && !empty($data['site_domain_prefix'])) {
$siteUrl = 'https://tg-' . $data['site_domain_prefix'] . $domain;
}
?>
<tr class="site-custom-item" >
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>推广后台域名前缀:</td>
<td class="r" >
<input type="text" disabled class="txt" style="float: none;" name="site_domain_prefix" value="{$data.site_domain_prefix}" placeholder="请输入推广后台域名前缀">
<span class="notice-text" style="float: none;">完整地址: <span id="site-url-show" style="color: red; font-weight: bold;" data-domain="<?=$domain?>"><?=$siteUrl?></span></span>
</td>
</tr>
<tr class="picbox site-custom-item">
<td class="l noticeinfo" ><i class="mustmark" style="margin-left:-7px">*</i>推广后台ICON</td>
<td class="r">
<span class="table_btn table_upload table_icon" style="float: none;">
<div class="upload-wrapper">
<div class="uploader-list" style="display: flex;">
<a href="javascript:;"><img src="{$siteConfig.icon}" style="width: 100px;height: 100px;cursor: move;"></a>
</div>
</div>
</span>
</td>
</tr>
<tr class="picbox site-custom-item">
<td class="l noticeinfo" ><i class="mustmark" style="margin-left:-7px">*</i>推广后台LOGO</td>
<td class="r">
<span class="table_btn table_upload table_icon" style="float: none;">
<div class="upload-wrapper">
<div class="uploader-list" style="display: flex;">
<a href="javascript:;"><img src="{$siteConfig.logo}" style="width: 100px;height: 100px;cursor: move;"></a>
</div>
</div>
</span>
</td>
</tr>
<?php endif;?>
<tr>
<td class="l noticeinfo">文档管理</td>

@ -172,6 +172,8 @@ class PromoteCompanyService
unset($companyInfo['relation']);
unset($companyInfo['promotes']);
$companyInfo['site_config'] = json_encode($companyInfo['site_config']);
$isNewDeposit = false;
if($application['company_id'] == 0){
//新增

@ -1256,4 +1256,42 @@ class PromoteService {
}
return true;
}
public function getPromoteCompanyBySite($url)
{
$domain = C('DOMAIN', null, '');
if ($domain == '') {
return null;
}
if (strpos($url, $domain) === false) {
return null;
}
$url = str_replace('http://', '', $url);
$url = str_replace('https://', '', $url);
$url = str_replace($domain, '', $url);
$domainPrefix = '';
if ($url != 'tg') {
$domainPrefix = str_replace('tg-', '', $url);
}
return M('promote_company', 'tab_')->where(['site_domain_prefix' => $domainPrefix])->find();
}
public function getSiteConfig($promoteCompany)
{
$siteConfig = $promoteCompany && $promoteCompany['is_site_custom'] == 1 ? json_decode($promoteCompany['site_config'], true) : null;
if (!$siteConfig) {
$siteConfig = [];
$siteConfig['logo'] = check_logo_is_exist(C('CH_LOGO_BACKSTAGE'), 'logo_default.png');
// $siteConfig['login_logo'] = check_logo_is_exist(C('CH_SET_LOGO'),'logo_default.png');
$siteConfig['icon'] = get_cover(C('CH_SET_ICO'), 'path');
$siteConfig['title'] = seo_replace(C('channel_index.seo_title'),'','channel') . '_' . C('CH_SET_TITLE');
} else {
$siteConfig['logo'] = get_cover($siteConfig['logo'], 'path');
$siteConfig['icon'] = get_cover($siteConfig['icon'], 'path');
$siteConfig['title'] = '推广平台_手机游戏推广联盟_手游推广员赚钱平台';
}
$siteConfig['description'] = '首页 登录 欢迎您回来!';
$siteConfig['keywords'] = C('channel_index.seo_keyword');
return $siteConfig;
}
}

@ -99,7 +99,7 @@ class Request {
public function getHost()
{
$host = $this->getScheme() . '://' . $this->serverInfo['SERVER_NAME'];
$host = $this->getScheme() . '://' . $this->serverInfo['HTTP_HOST'];
if (in_array($this->serverInfo['SERVER_PORT'], [80, 443])) {
return $host;
}

@ -46,10 +46,8 @@ class BaseController extends HomeController
define('G_SETTLEMENT_GRADE', 'sub_status,third_status');
}
if ($loginer['company_id']) {
$company = M('promote_company', 'tab_')->where(['id'=>$loginer['company_id']])->find();
$this->assign('company', $company);
}
$company = $this->getLoginPromoteCompany();
$this->assign('company', $company);
$this->canViewUserRecharge = $this->promoteCan('view-user-recharge');
$this->checkUrlPermission();
@ -264,15 +262,6 @@ class BaseController extends HomeController
return $records;
}
public function getLoginPromote()
{
if ($this->loginPromote == null) {
$promoteId = session('promote_auth.pid');
$this->loginPromote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
}
return $this->loginPromote;
}
//验证安全密码--视图
public function verifyPasswordView($modelList, $show = true)
{

@ -15,6 +15,9 @@ use Base\Tool\MobileDetect;
*/
class HomeController extends Controller
{
protected $loginPromote = null;
protected $loginPromoteCompany = null;
/* 空操作用于输出404页面 */
public function _empty()
{
@ -26,10 +29,38 @@ class HomeController extends Controller
/* 读取站点配置 */
$config = api('Config/lists');
C($config); //添加配置
//var_dump($config);
if (!C('WEB_SITE_CLOSE')) {
$this->error('站点已经关闭,请稍后访问~');
}
$promoteService = new PromoteService();
$siteConfig = null;
$promoteCompany = $this->getLoginPromoteCompany();
if (is_null($promoteCompany)) {
$url = Request::getHost();
$promoteCompany = $promoteService->getPromoteCompanyBySite($url);
}
$siteConfig = $promoteService->getSiteConfig($promoteCompany);
$this->assign('siteConfig', $siteConfig);
}
public function getLoginPromote()
{
if ($this->loginPromote == null) {
$promoteId = session('promote_auth.pid');
$this->loginPromote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
}
return $this->loginPromote;
}
public function getLoginPromoteCompany()
{
$loginer = $this->getLoginPromote();
if ($this->loginPromoteCompany == null && $loginer) {
$this->loginPromoteCompany = M('promote_company', 'tab_')->where(['id'=>$loginer['company_id']])->find();
}
return $this->loginPromoteCompany;
}
public function rule()

@ -7,13 +7,13 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<if condition="ACTION_NAME eq index and CONTROLLER_NAME eq Index">
<title>{:seo_replace(C('channel_index.seo_title'),'','channel')}_{:C('CH_SET_TITLE')}</title>
<meta name="description" content="首页 登录 欢迎您回来!"/>
<title>{$siteConfig['title']}</title>
<meta name="description" content="{$siteConfig['description']}"/>
<meta name="robots" content="noarchive">
<meta property="og:description" content="首页 登录 欢迎您回来!"/>
<meta property="og:title" content="{:seo_replace(C('channel_index.seo_title'),'','channel')}_{:C('CH_SET_TITLE')}"/>
<meta property="og:image" content="{:get_cover(C('CH_SET_ICO'),'path')}"/>
<meta name="keywords" content="{:C('channel_index.seo_keyword')}">
<meta property="og:description" content="{$siteConfig['description']}"/>
<meta property="og:title" content="{$siteConfig['title']}"/>
<meta property="og:image" content="{$siteConfig['icon']}"/>
<meta name="keywords" content="{$siteConfig['keywords']}">
<elseif condition="ACTION_NAME eq game_list and CONTROLLER_NAME eq Article"/>
<title>{:seo_replace(C('channel_game_list.seo_title'),'','channel')}</title>
<meta name="keywords" content="{:C('channel_game_list.seo_keyword')}">
@ -31,7 +31,7 @@
<meta name="keywords" content="{:C('channel_news_detail.seo_keyword')}">
<meta name="description" content="{:C('channel_news_detail.seo_description')}">
</if>
<link href="{:get_cover(C('CH_SET_ICO'),'path')}" type="image/x-icon" rel="shortcut icon">
<link href="{$siteConfig['icon']}" type="image/x-icon" rel="shortcut icon">
<link href="__CSS__/20170913/common.css" rel="stylesheet">
<script src="__JS__/jquery-1.11.1.min.js"></script>
@ -54,7 +54,7 @@
<else/>
<a href="{:U('index/index')}">
<span class="placeholder-graphic placeholder-graphic_logo" style="background:transparent;">
<img src="{:check_logo_is_exist(C('CH_SET_LOGO'),'logo_default.png')}" alt="logo">
<img src="{$siteConfig['logo']}" alt="logo">
</span>
</a>
</if>

@ -8,7 +8,7 @@
<link href="__CSS__/20170831/select2.min.css" rel="stylesheet" type="text/css" />
<!--<link href="__CSS__/20170831/common.css" rel="stylesheet" type="text/css">-->
<link href="__CSS__/20180207/common.css" rel="stylesheet" type="text/css">
<link href="{:get_cover(C('CH_SET_ICO'),'path')}" type="image/x-icon" rel="shortcut icon">
<link href="{$siteConfig['icon']}" type="image/x-icon" rel="shortcut icon">
<script type="text/javascript" src="__JS__/jquery-1.11.1.min.js"></script>
<!--[if lt IE 9]>
@ -33,7 +33,7 @@
<!--左侧导航栏 开始-->
<div class="nav_new fl">
<div class="logo_picture">
<img src="{:check_logo_is_exist(C('CH_LOGO_BACKSTAGE'),'logo_default.png')}" style="height:40px;margin:0px;">
<img src="{$siteConfig['logo']}" style="height:40px;margin:0px;">
</div>
<div class="subNavBox">
<a href="{:U('Promote/index')}" class="subNav <if condition='CONTROLLER_NAME eq Promote and ACTION_NAME eq index '>active</if>"> 后台首页 </a>

@ -2745,4 +2745,11 @@ CREATE TABLE `sys_payment_member` (
-- ----------------------------
INSERT INTO `sys_payment_member` VALUES (1, '', '1990676517', 1);
INSERT INTO `sys_payment_member` VALUES (3, '关飞', '18859216458', 0);
INSERT INTO `sys_payment_member` VALUES (4, '测试正在', '16754678756', 0);
INSERT INTO `sys_payment_member` VALUES (4, '测试正在', '16754678756', 0);
ALTER TABLE `tab_promote_company`
ADD COLUMN `is_site_custom` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否定制推广后台' AFTER `is_inside`;
ALTER TABLE `tab_promote_company`
ADD COLUMN `site_domain_prefix` varchar(20) NOT NULL DEFAULT '' COMMENT '推广后台域名前缀' AFTER `is_site_custom`;
ALTER TABLE `tab_promote_company`
ADD COLUMN `site_config` varchar(255) NOT NULL DEFAULT '' COMMENT '推广后台网站配置' AFTER `is_site_custom`;

@ -0,0 +1,129 @@
function WmUploader(options) {
this.randomNum = function(min, max){
var range = max - min;
var rand = Math.random();
var num = min + Math.round(rand * range);
return num;
}
this.accept = options.accept == undefined ? {
title: '图片',
extensions: 'png,gif,jpg,jpeg,bmp',
mimeTypes: 'image/*',
} : options.accept
// fileType: img file
this.fileType = options.fileType == undefined ? 'img' : options.fileType
this.uploadKey = options.uniqueCode == undefined ? this.randomNum(10000, 99999) : options.uniqueCode
this.uploadSelector = options.selector
this.uploadUrl = options.url
this.uploadWrapper = $(this.uploadSelector).parents('.upload-wrapper').eq(0);
this.uploadList = this.uploadWrapper.find('.uploader-list');
this.afterSuccess = options.afterSuccess
this.afterDelete = options.afterDelete
var that = this
this.getFileId = function(file) {
return file.id + '-' + that.uploadKey
}
this.getFileTag = function(file) {
return $('#' + that.getFileId(file))
}
this.uploader = WebUploader.create({
auto: true,
swf: '/Public/static/webuploader/Uploader.swf',
server: that.uploadUrl,
pick: {
id: that.uploadSelector,
multiple: false
},
accept: that.accept,
resize: false,
disableGlobalDnd: true,
fileNumLimit: 1,
threads: 5,
thumb: true,
compress: false,
prepareNextFile: true,
formData: function(){ return $.extend(true, {}, {}); },
chunked: false,
duplicate: true
});
this.uploader.on('fileQueued', function(file) {
if (that.fileType == 'img') {
var html = '';
html += '<div id="' + that.getFileId(file) + '" class="item" style="margin-right: 10px;">';
html += '<a href="javascript:;"><img src="" style="width: 100px;height: 100px;cursor: move;"></a>';
html += '<h4 class="info">' + file.name + '</h4>';
html += '<p class="state">等待上传...</p>';
html += '</div>';
that.uploadList.append(html);
that.uploadList.css('margin-top','10px');
var imgNode = that.uploadList.children(that.getFileTag(file)).find('img');
that.uploader.makeThumb(file, function (error, src) {
if (error) {
return;
}
imgNode.attr('src', src);
}, 300, 300);
} else {
that.uploadList.append(
'<div id="' + that.getFileId(file) + '" class="item">' +
'<h4 class="info">' + file.name + '</h4>' +
'<p class="state">等待上传...</p>' +
'</div>'
);
}
});
this.uploader.on('uploadProgress', function(file, percentage) {
var $li = that.getFileTag(file),
$percent = $li.find('.progress .progress-bar');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
'</div>' +
'</div>').appendTo( $li ).find('.progress-bar');
}
$li.find('p.state').text('上传中');
$percent.css('width', percentage * 100 + '%');
$percent.text((percentage * 100).toFixed(0) + '%');
});
this.uploader.on('uploadSuccess', function(file, response) {
var fileTag = that.getFileTag(file)
fileTag.find('p.state').text('已上传').fadeOut(800);
fileTag.find('h4.info').append('<a href="javascript:;" class="file-delete table_click" style="float:none;display:inline-block;margin-left:10px;">删除</a>');
fileTag.find('.file-delete').on('click', function() {
$('#file_url').val('');
that.uploader.removeFile(file.id);
fileTag.remove();
if (that.afterDelete != undefined) {
that.afterDelete(file)
}
return false;
});
if(!response.chunk) {
var url = response.path + '/' + response.name;
$('#file_url').val(url);
}
if (that.afterSuccess != undefined) {
that.afterSuccess(file, response)
}
});
this.uploader.on('uploadError', function(file) {
that.getFileTag(file).find('p.state').text('上传出错');
});
this.uploader.on('uploadComplete', function(file) {
that.getFileTag(file).find('.progress').fadeOut();
});
}
Loading…
Cancel
Save