From dd66846e680198921306b505104bf83c5fcd9ac9 Mon Sep 17 00:00:00 2001 From: "elf@home" <360197197@qq.com> Date: Sun, 22 Nov 2020 21:34:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=85=AC=E5=8F=B8=E9=85=8D=E7=BD=AE=E6=8E=A8=E5=B9=BF=E5=90=8E?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 49 ++++++- .../Admin/View/PromoteCompany/add.html | 111 ++++++++++++++ .../Admin/View/PromoteCompany/edit.html | 135 +++++++++++++++++- .../Admin/View/PromoteCompany/view.html | 60 ++++++++ .../Service/PromoteCompanyService.class.php | 2 + .../Base/Service/PromoteService.class.php | 35 +++++ .../Home/Controller/BaseController.class.php | 15 +- .../Home/Controller/HomeController.class.php | 33 ++++- .../Home/View/default/Public/bases.html | 16 +-- .../View/default/Public/promote_base.html | 4 +- Data/update.sql | 9 +- Public/Admin/js/uploader.js | 127 ++++++++++++++++ 12 files changed, 563 insertions(+), 33 deletions(-) create mode 100644 Public/Admin/js/uploader.js diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 25e0b7c3f..5524c3c17 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -534,6 +534,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); @@ -542,7 +548,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(); @@ -589,6 +595,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); @@ -598,6 +610,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"); @@ -704,6 +717,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']); @@ -743,6 +760,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(); } @@ -1134,13 +1152,30 @@ class PromoteCompanyController extends ThinkController } } + if (isset($save['is_site_custom']) && $save['is_site_custom'] == 1) { + if ($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('税费费率格式错误'); diff --git a/Application/Admin/View/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html index f547c50bd..e86b6adb9 100644 --- a/Application/Admin/View/PromoteCompany/add.html +++ b/Application/Admin/View/PromoteCompany/add.html @@ -22,6 +22,7 @@ +