diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php
index bba334868..a33e6a6b5 100644
--- a/Application/Admin/Controller/PromoteCompanyController.class.php
+++ b/Application/Admin/Controller/PromoteCompanyController.class.php
@@ -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('税费费率格式错误');
diff --git a/Application/Admin/View/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html
index f547c50bd..670ef62f9 100644
--- a/Application/Admin/View/PromoteCompany/add.html
+++ b/Application/Admin/View/PromoteCompany/add.html
@@ -22,6 +22,7 @@
+