diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 771cf52d1..c432bc5d5 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -126,9 +126,11 @@ class ConsoleController extends Think { public function testAggregate() { - $client = new AggregateClient(); + /* $client = new AggregateClient(); $result = $client->api('game-data', ['unique_codes' => ['w123'], 'started_at' => '2019-06-27', 'ended_at' => '2020-07-27']); - var_dump($result); + var_dump($result); */ + + echo M('game', 'tab_')->where('id>2')->field(['id', 'game_name'])->where('sdk_version=1')->select(false); } public function initMarketAdmin() diff --git a/Application/Admin/Controller/PartnerController.class.php b/Application/Admin/Controller/PartnerController.class.php index 6540bf3af..3ba81f8d1 100644 --- a/Application/Admin/Controller/PartnerController.class.php +++ b/Application/Admin/Controller/PartnerController.class.php @@ -337,6 +337,9 @@ class PartnerController extends ThinkController $this->error('保存失败'); } } else { + $selfCompanies = M('company_info', 'tab_')->field('id,partner company_name,link_man,link_phone')->where(['status' => 1])->select(); + + $this->assign('selfCompanies', $selfCompanies); $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/add'])->find()); $this->meta_title = '新增上游CP公司'; $this->display(); diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 942e2cbab..229982a94 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -7,6 +7,7 @@ use User\Api\UserApi as UserApi; use OSS\OssClient; use OSS\Core\OSsException; use Base\Service\PresidentDepositService; +use Base\Service\PromoteCompanyService; use Think\Controller; /** @@ -399,7 +400,24 @@ class PromoteCompanyController extends ThinkController if ($_POST) { $time = time(); $save = I('post.');//前端已经验证 + + $save['promotes'] = json_decode($save['promotes'], true); + $this->checkData($save); + + $presidentDepositService = new PresidentDepositService(); + $promoteCompanyService = new PromoteCompanyService(); + + try { + $presidentDepositService->checkBeforeSave($save['deposit'] ?? []); + $promoteCompanyService->checkPromotes($save['promotes'] ?? []); + } catch (\Exception $e) { + $this->ajaxReturn(array( + 'status' => 0, + 'info' => $e->getMessage() + )); + } + $save['create_time'] = $time; $save['turnover_ratio'] = $this->setTurnoverRatio($save); $res = D("PromoteCompanyVerify")->add_db($save); @@ -418,6 +436,9 @@ class PromoteCompanyController extends ThinkController )); } } else { + $selfCompanies = M('company_info', 'tab_')->field('id,partner company_name,link_man,link_phone')->where(['status' => 1])->select(); + + $this->assign('selfCompanies', $selfCompanies); $this->assign('payWays', PresidentDepositService::$payWays); $this->assign('payTypes', PresidentDepositService::$payTypes); $this->assign('serviceAgreements', M('service_agreement', 'tab_')->select()); @@ -974,14 +995,6 @@ class PromoteCompanyController extends ThinkController } } - if (I('pay_type', 0) == 0) { - $this->error('请选择押金付款方式'); - } - - if (I('pay_type', 0) != PresidentDepositService::PAY_TYPE_NONE && I('pay_way', 0) == 0) { - $this->error('请选择付款方式'); - } - // if(!empty(I("contact_phone")) && !checkPhone(I('contact_phone'))) { // $this->error('联系电话格式不正确'); // } diff --git a/Application/Admin/View/Partner/add.html b/Application/Admin/View/Partner/add.html index b0e4f67a6..c1e5b4ce2 100644 --- a/Application/Admin/View/Partner/add.html +++ b/Application/Admin/View/Partner/add.html @@ -19,6 +19,10 @@