123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- namespace addons\shopro\service\commission;
- class Config
- {
- protected $config;
- public function __construct()
- {
- $this->config = sheep_config('shop.commission');
- }
-
- public function setConfig($config)
- {
- foreach ($config as $name => $value) {
- $this->config[$name] = $value;
- }
- }
-
- public function getInviteLockEvent()
- {
- $becomeAgentEvent = $this->getBecomeAgentEvent();
- if($becomeAgentEvent === 'user') {
- return 'agent';
- }
- return $this->config['invite_lock'];
- }
-
- public function getBecomeAgentEvent()
- {
- return $this->config['become_agent'];
- }
-
- public function isAgentCheck()
- {
- return boolval($this->config['agent_check']);
- }
-
- public function isUpgradeCheck()
- {
- return boolval($this->config['upgrade_check']);
- }
-
- public function isUpgradeJump()
- {
- return boolval($this->config['upgrade_jump']);
- }
-
- public function isAgentApplyForm()
- {
- return boolval($this->config['agent_form']['status']);
- }
-
- public function getAgentForm()
- {
- return $this->config['agent_form'];
- }
-
- public function getApplyProtocol()
- {
- return $this->config['apply_protocol'];
- }
-
- public function getCommissionLevel()
- {
- return intval($this->config['level']);
- }
-
- public function isSelfBuy()
- {
- return boolval($this->config['self_buy']);
- }
-
- public function isUpgradeDisplay()
- {
- return boolval($this->config['upgrade_display']);
- }
-
- public function getRewardType()
- {
- return $this->config['reward_type'];
- }
-
- public function getRewardEvent()
- {
- return $this->config['reward_event'];
- }
-
- public function getRefundCommissionOrder()
- {
- return boolval($this->config['refund_commission_order']);
- }
-
- public function getRefundCommissionReward()
- {
- return boolval($this->config['refund_commission_reward']);
- }
- }
|