| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- /**
- * Niushop商城系统 - 团队十年电商经验汇集巨献!
- * =========================================================
- * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
- * ----------------------------------------------
- * 官方网址: https://www.niushop.com
- * =========================================================
- */
- namespace addon\fenxiao\api\controller;
- use app\api\controller\BaseApi;
- use addon\fenxiao\model\Config as ConfigModel;
- use app\model\system\Document;
- /**
- * 分销相关配置
- */
- class Config extends BaseApi
- {
- /**
- * 提现配置
- */
- public function withdraw()
- {
- $config = new ConfigModel();
- $res = $config->getFenxiaoWithdrawConfig($this->site_id);
- return $this->response($this->success($res['data']['value']));
- }
- /**
- * 文字设置
- * @return false|string
- */
- public function words()
- {
- $config = new ConfigModel();
- $res = $config->getFenxiaoWordsConfig($this->site_id);
- return $this->response($this->success($res['data']['value']));
- }
- /**
- * 申请协议
- * @return false|string
- */
- public function agreement()
- {
- $config = new ConfigModel();
- $agreement = $config->getFenxiaoAgreementConfig($this->site_id);
- $res = [];
- $res['agreement'] = $agreement['data']['value'];
- if ($agreement['data']['value']['is_agreement'] == 1) {
- $document_model = new Document();
- $document = $document_model->getDocument([['site_id', '=', $this->site_id], ['app_module', '=', 'shop'], ['document_key', '=', "FENXIAO_AGREEMENT"]]);
- $res['document'] = $document['data'];
- }
- return $this->response($this->success($res));
- }
- /**
- * 分销基本设置
- * @return false|string
- */
- public function basics()
- {
- $config = new ConfigModel();
- $res = $config->getFenxiaoBasicsConfig($this->site_id);
- return $this->response($this->success($res['data']['value']));
- }
- /**
- * 分销商资格设置
- * @return false|string
- */
- public function fenxiao()
- {
- $config = new ConfigModel();
- $res = $config->getFenxiaoConfig($this->site_id);
- return $this->response($this->success($res['data']['value']));
- }
- /**
- * 获取上下级关系设置
- * @return false|string
- */
- public function relation()
- {
- $config = new ConfigModel();
- $res = $config->getFenxiaoRelationConfig($this->site_id);
- return $this->response($this->success($res['data']['value']));
- }
- }
|