| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\models;
- use app\models\CashExt;
- use app\models\Level;
- use app\models\ShareHolderLevel;
- use yii\base\Model;
- use app\models\Option;
- use app\utils\FuGou;
- class BonusPoolSetting extends Model
- {
- public $store_id;
- public $shareHolderTeamRewardPlatformBears;
- public $shareHolderRewardPointRate;
- public $shareHolderFrostSendCond;
- public $dividends_method;
- public $cycle;
- public $is_open_share;
- public $is_open_range;
- public $is_open_area;
- public $team_num;
- public $qrcode;
- public $range_name;
- public $holder_name;
- public $area_name;
- public $old_range_name;
- public $direct_range_name;
- public $old_add_holder_name;
- public $shareHolderProfit;
- public $shareHolderPriceMin;
- public $shareHolderCashProfit;
- public $shareHolderLevel;
- public $shareHolderNumber;
- public $shareHolderHasCheck;
- public $pay_wechat;
- public $pay_alipay;
- public $bank;
- public $remaining_sum;
- public $lg;
- public $cash_max_day;
- public $cash_max_single_day;
- public $min_money;
- public $auto_money;
- public $dividends_condition;
- public $shareHolderProfitSwitch;
- public $shareHolderHighProfit;
- public $shareHolderAliasName;
- public $shareHolderRepeatProfitSwitch;
- public $shareHolderJiandian;
- //客户需求‘滑落’
- public $shareHolderChangeOldParentSwitch;//滑落开关
- public $shareHolderChangeOldParentNumber;//滑落人数
- public $shareHolderChangeChildMinNumber;//滑落人数
- public $userSlippedOnceSwitch;//单用户只允许滑落一次开关
- // 复购
- public $fugou;
- public $userLevel;
- //提现
- public $cash_price_type;//提现佣金到账类型
- public $cash_price_amount;//提现佣金现金比例
- public $cash_price_integral;//提现佣金积分比例
- public $cash_price_balance;//提现佣金余额比例
- //高等级是否参与加权平均
- public $high_level_join_average;
- // 直推团队收益发放层级
- public $shareHolderPriceLevel;
- /**
- * @return array
- */
- public function rules()
- {
- return [
- [['cycle', 'is_open_share', 'is_open_range', 'is_open_area', 'team_num', 'store_id', 'shareHolderProfitSwitch', 'shareHolderRepeatProfitSwitch', 'shareHolderJiandian', 'shareHolderChangeOldParentSwitch', 'high_level_join_average'], 'integer'],
- // [['cycle', 'is_open_share', 'is_open_range', 'is_open_area'], 'default', 'value' => 0],
- // [['team_num'], 'default', 'value' => 3],
- [['range_name', 'holder_name', 'area_name', 'old_range_name', 'direct_range_name', 'old_add_holder_name', 'shareHolderAliasName', 'cash_price_type'], 'string', 'max' => 255],
- [['qrcode', 'shareHolderNumber'], 'string'],
- // [['shareHolderProfit', 'dividends_condition'], 'default', 'value' => 0],
- [['shareHolderProfit', 'shareHolderCashProfit', 'shareHolderLevel', 'shareHolderHasCheck',
- 'pay_wechat', 'pay_alipay', 'bank', 'lg', 'remaining_sum', 'cash_max_day', 'min_money', 'shareHolderPriceMin', 'dividends_condition', 'shareHolderHighProfit', 'cash_max_single_day',
- 'shareHolderChangeOldParentNumber', 'shareHolderChangeChildMinNumber', 'userSlippedOnceSwitch', 'userLevel', 'cash_price_amount', 'cash_price_integral', 'cash_price_balance', 'shareHolderPriceLevel'], 'number'],
- [['fugou'], 'safe'],
- [['shareHolderTeamRewardPlatformBears', 'shareHolderRewardPointRate', 'shareHolderFrostSendCond', 'dividends_method'], 'safe'],
- [['auto_money'], 'safe'],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'shareHolderTeamRewardPlatformBears' => '是否平台承担平级奖',
- 'shareHolderRewardPointRate' => '发放积分占比佣金百分比',
- 'shareHolderFrostSendCond' => '帮扶佣金解冻条件',
- 'dividends_method' => '分红方式',
- 'cycle' => '奖金池周期',
- 'is_open_share' => '是否开启股东分红',
- 'is_open_range' => '是否开启极差分红',
- 'is_open_area' => '是否开启区域分红',
- 'team_num' => '团队层数',
- 'qrcode' => '二维码相关',
- 'range_name' => '极差分红',
- 'holder_name' => '股东分红',
- 'area_name' => '区域分红',
- 'old_range_name' => '极差分红(原关系)',
- 'direct_range_name' => '2+1直推团队收益比例',
- 'old_add_holder_name' => '2+1直推团队收益比例(原关系)',
- 'shareHolderProfit' => '冻结佣金配置',
- 'shareHolderPriceMin' => '停止基数(分红金额小于此即停止递归分红)',
- 'shareHolderCashProfit' => '佣金提现手续费比例',
- 'shareHolderLevel' => '冻结等级',
- 'shareHolderNumber' => '冻结层数',
- 'shareHolderHasCheck' => '是否开启股东审核',
- 'pay_wechat' => '提现方式微信',
- 'pay_alipay' => '提现方式支付宝',
- 'bank' => '提现方式银行卡',
- 'remaining_sum' => '提现方式余额',
- 'lg' => '提现方式灵工',
- 'cash_max_day' => '每日上限',
- 'min_money' => '最少提现',
- 'auto_money'=>'自动发放以内的金额',
- 'dividends_condition' => '分红条件',
- 'shareHolderProfitSwitch' => '小推大佣金限制',
- 'cash_max_single_day' => '每人每日提现上限',
- 'shareHolderAliasName' => '股东别名',
- 'shareHolderRepeatProfitSwitch' => '小推大复购佣金限制',
- 'shareHolderJiandian' => '见点奖发放层级',
- 'shareHolderChangeOldParentSwitch' => '滑落开关',
- 'shareHolderChangeOldParentNumber' => '滑落人数',
- 'shareHolderChangeChildMinNumber' => '直推最低人数',
- 'userSlippedOnceSwitch' => '单用户只允许滑落一次开关',
- 'userLevel' => '会员等级',
- 'cash_price_type' => '提现佣金到账类型',
- 'cash_price_amount' => '提现佣金现金比例',
- 'cash_price_integral' => '提现佣金积分比例',
- 'cash_price_balance' => '提现佣金余额比例',
- 'high_level_join_average' => '是否开启高等级是否参与加权平均',
- 'shareHolderPriceLevel' => '直推团队收益发放层级'
- ];
- }
- public function save()
- {
- if (!$this->validate()) {
- return [
- 'code' => 1,
- 'msg' => $this->getErrorSummary(false)[0],
- ];
- }
- $name = [];
- $val = [];
- isset($this->shareHolderTeamRewardPlatformBears) && ($name = array_merge($name, ['shareHolderTeamRewardPlatformBears'])) && ($val = array_merge($val, [$this->shareHolderTeamRewardPlatformBears]));
- isset($this->shareHolderRewardPointRate) && ($name = array_merge($name, ['shareHolderRewardPointRate'])) && ($val = array_merge($val, [$this->shareHolderRewardPointRate]));
- isset($this->shareHolderFrostSendCond) && ($name = array_merge($name, ['shareHolderFrostSendCond'])) && ($val = array_merge($val, [$this->shareHolderFrostSendCond]));
- isset($this->dividends_method) && ($name = array_merge($name, ['dividends_method'])) && ($val = array_merge($val, [$this->dividends_method]));
- isset($this->is_open_share) && ($name = array_merge($name, ['is_open_share'])) && ($val = array_merge($val, [$this->is_open_share]));
- isset($this->is_open_range) && ($name = array_merge($name, ['is_open_range'])) && ($val = array_merge($val, [$this->is_open_range]));
- isset($this->team_num) && ($name = array_merge($name, ['team_num'])) && ($val = array_merge($val, [$this->team_num]));
- isset($this->range_name) && ($name = array_merge($name, ['range_name'])) && ($val = array_merge($val, [$this->range_name]));
- isset($this->holder_name) && ($name = array_merge($name, ['holder_name'])) && ($val = array_merge($val, [$this->holder_name]));
- isset($this->qrcode) && ($name = array_merge($name, ['qrcode'])) && ($val = array_merge($val, [$this->qrcode]));
- isset($this->area_name) && ($name = array_merge($name, ['area_name'])) && ($val = array_merge($val, [$this->area_name]));
- isset($this->is_open_area) && ($name = array_merge($name, ['is_open_area'])) && ($val = array_merge($val, [$this->is_open_area]));
- isset($this->shareHolderProfit) && ($name = array_merge($name, ['shareHolderProfit'])) && ($val = array_merge($val, [$this->shareHolderProfit]));
- isset($this->shareHolderPriceMin) && ($name = array_merge($name, ['shareHolderPriceMin'])) && ($val = array_merge($val, [$this->shareHolderPriceMin]));
- // 直推团队收益发放层级
- isset($this->shareHolderPriceLevel) && ($name = array_merge($name, ['shareHolderPriceLevel'])) && ($val = array_merge($val, [$this->shareHolderPriceLevel]));
- isset($this->shareHolderCashProfit) && ($name = array_merge($name, ['shareHolderCashProfit'])) && ($val = array_merge($val, [$this->shareHolderCashProfit]));
- isset($this->shareHolderLevel) && ($name = array_merge($name, ['shareHolderLevel'])) && ($val = array_merge($val, [$this->shareHolderLevel]));
- isset($this->shareHolderNumber) && ($name = array_merge($name, ['shareHolderNumber'])) && ($val = array_merge($val, [$this->shareHolderNumber]));
- isset($this->shareHolderHasCheck) && ($name = array_merge($name, ['shareHolderHasCheck'])) && ($val = array_merge($val, [$this->shareHolderHasCheck]));
- isset($this->pay_wechat) && ($name = array_merge($name, ['pay_wechat'])) && ($val = array_merge($val, [$this->pay_wechat]));
- isset($this->pay_alipay) && ($name = array_merge($name, ['pay_alipay'])) && ($val = array_merge($val, [$this->pay_alipay]));
- isset($this->bank) && ($name = array_merge($name, ['bank'])) && ($val = array_merge($val, [$this->bank]));
- isset($this->remaining_sum) && ($name = array_merge($name, ['remaining_sum'])) && ($val = array_merge($val, [$this->remaining_sum]));
- isset($this->lg) && ($name = array_merge($name, ['lg'])) && ($val = array_merge($val, [$this->lg]));
- isset($this->cash_max_day) && ($name = array_merge($name, ['cash_max_day'])) && ($val = array_merge($val, [$this->cash_max_day]));
- isset($this->cash_max_single_day) && ($name = array_merge($name, ['cash_max_single_day'])) && ($val = array_merge($val, [$this->cash_max_single_day]));
- isset($this->min_money) && ($name = array_merge($name, ['min_money'])) && ($val = array_merge($val, [$this->min_money]));
- isset($this->auto_money) && ($name = array_merge($name, ['auto_money'])) && ($val = array_merge($val, [$this->auto_money]));
- isset($this->old_range_name) && ($name = array_merge($name, ['old_range_name'])) && ($val = array_merge($val, [$this->old_range_name]));
- isset($this->direct_range_name) && ($name = array_merge($name, ['direct_range_name'])) && ($val = array_merge($val, [$this->direct_range_name]));
- isset($this->old_add_holder_name) && ($name = array_merge($name, ['old_add_holder_name'])) && ($val = array_merge($val, [$this->old_add_holder_name]));
- isset($this->dividends_condition) && ($name = array_merge($name, ['dividends_condition'])) && ($val = array_merge($val, [$this->dividends_condition]));
- isset($this->cycle) && ($name = array_merge($name, ['cycle'])) && ($val = array_merge($val, [$this->cycle]));
- isset($this->shareHolderProfitSwitch) && ($name = array_merge($name, ['shareHolderProfitSwitch'])) && ($val = array_merge($val, [$this->shareHolderProfitSwitch]));
- isset($this->shareHolderHighProfit) && ($name = array_merge($name, ['shareHolderHighProfit'])) && ($val = array_merge($val, [$this->shareHolderHighProfit]));
- isset($this->shareHolderAliasName) && ($name = array_merge($name, ['shareHolderAliasName'])) && ($val = array_merge($val, [$this->shareHolderAliasName]));
- isset($this->shareHolderRepeatProfitSwitch) && ($name = array_merge($name, ['shareHolderRepeatProfitSwitch'])) && ($val = array_merge($val, [$this->shareHolderRepeatProfitSwitch]));
- isset($this->shareHolderJiandian) && ($name = array_merge($name, ['shareHolderJiandian'])) && ($val = array_merge($val, [$this->shareHolderJiandian]));
- isset($this->userLevel) && ($name = array_merge($name, ['userLevel'])) && ($val = array_merge($val, [$this->userLevel]));
- //滑落
- isset($this->shareHolderChangeOldParentSwitch) && ($name = array_merge($name, ['shareHolderChangeOldParentSwitch'])) && ($val = array_merge($val, [$this->shareHolderChangeOldParentSwitch]));
- isset($this->shareHolderChangeOldParentNumber) && ($name = array_merge($name, ['shareHolderChangeOldParentNumber'])) && ($val = array_merge($val, [$this->shareHolderChangeOldParentNumber]));
- isset($this->shareHolderChangeChildMinNumber) && ($name = array_merge($name, ['shareHolderChangeChildMinNumber'])) && ($val = array_merge($val, [$this->shareHolderChangeChildMinNumber]));
- isset($this->userSlippedOnceSwitch) && ($name = array_merge($name, ['userSlippedOnceSwitch'])) && ($val = array_merge($val, [$this->userSlippedOnceSwitch]));
- //提现
- isset($this->cash_price_type) && ($name = array_merge($name, ['cash_price_type'])) && ($val = array_merge($val, [$this->cash_price_type ?: '1']));
- isset($this->cash_price_amount) && ($name = array_merge($name, ['cash_price_amount'])) && ($val = array_merge($val, [$this->cash_price_amount ?? 100]));
- isset($this->cash_price_integral) && ($name = array_merge($name, ['cash_price_integral'])) && ($val = array_merge($val, [$this->cash_price_integral ?? 0]));
- isset($this->cash_price_balance) && ($name = array_merge($name, ['cash_price_balance'])) && ($val = array_merge($val, [$this->cash_price_balance ?? 0]));
- //是否开启高等级是否参与加权平均
- isset($this->high_level_join_average) && ($name = array_merge($name, ['high_level_join_average'])) && ($val = array_merge($val, [$this->high_level_join_average ?? 0]));
- // if (isset($this->cash_price_type)) {
- // $total_profit = 0;
- // $cash_price_type = explode(',', $this->cash_price_type);
- // if (in_array(CashExt::CASH_PRICE_TYPE_AMOUNT, $cash_price_type)) {
- // $total_profit = bcadd($total_profit, $this->cash_price_amount, 2);
- // }
- // if (in_array(CashExt::CASH_PRICE_TYPE_INTEGRAL, $cash_price_type)) {
- // $total_profit = bcadd($total_profit, $this->cash_price_integral, 2);
- // }
- // if (in_array(CashExt::CASH_PRICE_TYPE_BALANCE, $cash_price_type)) {
- // $total_profit = bcadd($total_profit, $this->cash_price_balance, 2);
- // }
- // if ($total_profit != 100) {
- // return [
- // 'code' => 1,
- // 'msg' => '佣金/积分/余额比例设置错误'
- // ];
- // }
- // }
- //滑落处理 start
- if (intval($this->shareHolderChangeOldParentSwitch)) {
- if (isset($this->shareHolderChangeOldParentNumber) || isset($this->shareHolderChangeChildMinNumber)) {
- if (isset($this->shareHolderChangeOldParentNumber) && isset($this->shareHolderChangeChildMinNumber)) {
- // if ($this->shareHolderChangeChildMinNumber >= $this->shareHolderChangeOldParentNumber) {
- // return [
- // 'code' => 1,
- // 'msg' => '保存失败,自推最低人数需要小于自动滑落人数'
- // ];
- // }
- $holder_level_list = ShareHolderLevel::find()->where([
- 'is_delete' => 0,
- 'status' => 1,
- 'store_id' => $this->store_id,
- ])->asArray()->all();
- // 找出符合条件的等级
- $current_level = null;
- foreach ($holder_level_list as $holder_level) {
- $condition = json_decode($holder_level['condition'], true);
- if ((bool)$condition['shareholder']['is_open'] &&
- (int)$condition['shareholder']['num'] > 0 &&
- (bool)$condition['shareholder']['independent_team']
- ) {
- $current_level = $holder_level;
- break;
- }
- }
- if ($current_level) {
- //设置滑落数量时需要判断是否大于 可助力出局人数
- $condition = json_decode($current_level['condition'], true);
- //设置滑落数量时需要判断是否大于 可助力出局人数
- if ($condition['shareholder']['num'] <= $this->shareHolderChangeChildMinNumber) {
- return [
- 'code' => 1,
- 'msg' => '保存失败,滑落自推最低人数需要小于出局人数'
- ];
- }
- }
- }
- }
- }
- //滑落处理 end
- //默认值处理
- $cycle = Option::get('cycle', $this->store_id, 'bonus_pool')['value'];
- if (is_null($cycle) && !isset($this->cycle)) {
- $name = array_merge($name, ['cycle']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $is_open_share = Option::get('is_open_share', $this->store_id, 'bonus_pool')['value'];
- if (is_null($is_open_share) && !isset($this->is_open_share)) {
- $name = array_merge($name, ['is_open_share']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $is_open_range = Option::get('is_open_range', $this->store_id, 'bonus_pool')['value'];
- if (is_null($is_open_range) && !isset($this->is_open_range)) {
- $name = array_merge($name, ['is_open_range']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $is_open_area = Option::get('is_open_area', $this->store_id, 'bonus_pool')['value'];
- if (is_null($is_open_area) && !isset($this->is_open_area)) {
- $name = array_merge($name, ['is_open_area']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $team_num = Option::get('team_num', $this->store_id, 'bonus_pool')['value'];
- if (is_null($team_num) && !isset($this->team_num)) {
- $name = array_merge($name, ['team_num']);
- $val = array_merge($val, [3]);
- }
- //默认值处理
- $shareHolderProfit = Option::get('shareHolderProfit', $this->store_id, 'bonus_pool')['value'];
- if (is_null($shareHolderProfit) && !isset($this->shareHolderProfit)) {
- $name = array_merge($name, ['shareHolderProfit']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $dividends_condition = Option::get('dividends_condition', $this->store_id, 'bonus_pool')['value'];
- if (is_null($dividends_condition) && !isset($this->dividends_condition)) {
- $name = array_merge($name, ['dividends_condition']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $shareHolderProfitSwitch = Option::get('shareHolderProfitSwitch', $this->store_id, 'bonus_pool')['value'];
- if (is_null($shareHolderProfitSwitch) && !isset($this->shareHolderProfitSwitch)) {
- $name = array_merge($name, ['shareHolderProfitSwitch']);
- $val = array_merge($val, [0]);
- }
- //默认值处理
- $shareHolderJiandian = Option::get('shareHolderJiandian', $this->store_id, 'bonus_pool')['value'];
- if (is_null($shareHolderJiandian) && !isset($this->shareHolderJiandian)) {
- $name = array_merge($name, ['shareHolderJiandian']);
- $val = array_merge($val, [0]);
- }
- $res = Option::set($name, $val, $this->store_id, 'bonus_pool');
- if ($res) {
- return [
- 'code' => 0,
- 'msg' => '保存成功'
- ];
- } else {
- return [
- 'code' => 1,
- 'msg' => '保存失败'
- ];
- }
- }
- public function fugouSave()
- {
- Option::set('fugou', \json_encode($this->fugou), $this->store_id, 'bonus_pool');
- return [
- 'code' => 0,
- 'msg' => '保存成功'
- ];
- }
- public function fugouInfo()
- {
- $shareHolderLevel = ShareHolderLevel::find()->where(['store_id' => $this->store_id, 'is_delete' => 0, 'status' => 1])->asArray()->all();
- $fugouSetting = FuGou::getSetting($this->store_id);
- foreach ($fugouSetting['fugou_goods'] as $k => $goods) {
- $g = \app\models\Goods::find()->where(['id' => $goods['id']])->select('id, name, cover_pic, price, goods_num')->one();
- $fugouSetting['fugou_goods'][$k] = [
- 'id' => $g->id,
- 'name' => $g->name,
- 'cover_pic' => $g->cover_pic,
- 'price' => $g->price,
- 'goods_num' => $g->goods_num,
- 'fugou_price' => $goods['fugou_price'],
- ];
- }
- return [
- 'code' => 0,
- 'data' => [
- 'fugou_setting' => $fugouSetting,
- 'shareHolderLevel' => $shareHolderLevel
- ]
- ];
- }
- public function search()
- {
- $shareHolderLevel = ShareHolderLevel::find()->where(['store_id' => $this->store_id, 'is_delete' => 0, 'status' => 1])->asArray()->all();
- $userLevel = Level::find()->where(['store_id' => $this->store_id, 'is_delete' => 0, 'status' => 1])->asArray()->all();
- $setting = [
- 'shareHolderTeamRewardPlatformBears' => Option::get('shareHolderTeamRewardPlatformBears', $this->store_id, 'bonus_pool', 1)['value'], //是否平台承担平级奖
- 'shareHolderRewardPointRate' => Option::get('shareHolderRewardPointRate', $this->store_id, 'bonus_pool', 0)['value'], //发放积分占比佣金百分比
- 'shareHolderFrostSendCond' => Option::get('shareHolderFrostSendCond', $this->store_id, 'bonus_pool', 0)['value'], //帮扶佣金解冻条件 0默认条件 1升级条件
- 'dividends_method' => (string)(Option::get('dividends_method', $this->store_id, 'bonus_pool', 0)['value']), //分红方式 0平均分红 1团队业绩加权分红
- 'cycle' => Option::get('cycle', $this->store_id, 'bonus_pool', 0)['value'],
- 'is_open_share' => Option::get('is_open_share', $this->store_id, 'bonus_pool', 0)['value'],
- 'is_open_range' => Option::get('is_open_range', $this->store_id, 'bonus_pool', 0)['value'],
- 'team_num' => Option::get('team_num', $this->store_id, 'bonus_pool', 0)['value'],
- 'qrcode' => Option::get('qrcode', $this->store_id, 'bonus_pool', '')['value'],
- 'range_name' => Option::get('range_name', $this->store_id, 'bonus_pool', '级差分红')['value'],
- 'holder_name' => Option::get('holder_name', $this->store_id, 'bonus_pool', '股东分红')['value'],
- 'area_name' => Option::get('area_name', $this->store_id, 'bonus_pool', '')['value'],
- 'old_range_name' => Option::get('old_range_name', $this->store_id, 'bonus_pool', '级差分红(原关系)')['value'],
- 'direct_range_name' => Option::get('direct_range_name', $this->store_id, 'bonus_pool', '直推团队收益')['value'],
- 'old_add_holder_name' => Option::get('old_add_holder_name', $this->store_id, 'bonus_pool', '直推团队收益(原关系)')['value'],
- 'is_open_area' => Option::get('is_open_area', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderProfit' => Option::get('shareHolderProfit', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderPriceMin' => Option::get('shareHolderPriceMin', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderPriceLevel' => Option::get('shareHolderPriceLevel', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderCashProfit' => Option::get('shareHolderCashProfit', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderLevel' => Option::get('shareHolderLevel', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderNumber' => Option::get('shareHolderNumber', $this->store_id, 'bonus_pool', '0,0')['value'],
- 'shareHolderHasCheck' => Option::get('shareHolderHasCheck', $this->store_id, 'bonus_pool', 0)['value'],
- 'pay_wechat' => Option::get('pay_wechat', $this->store_id, 'bonus_pool', 0)['value'],
- 'pay_alipay' => Option::get('pay_alipay', $this->store_id, 'bonus_pool', 0)['value'],
- 'bank' => Option::get('bank', $this->store_id, 'bonus_pool', 0)['value'],
- 'remaining_sum' => Option::get('remaining_sum', $this->store_id, 'bonus_pool', 0)['value'],
- 'lg' => Option::get('lg', $this->store_id, 'bonus_pool', 0)['value'],
- 'cash_max_day' => Option::get('cash_max_day', $this->store_id, 'bonus_pool', 0)['value'],
- 'cash_max_single_day' => Option::get('cash_max_single_day', $this->store_id, 'bonus_pool', 0)['value'],
- 'min_money' => Option::get('min_money', $this->store_id, 'bonus_pool', 0)['value'],
- 'auto_money' => Option::get('auto_money', $this->store_id, 'bonus_pool', 0)['value'],
- 'dividends_condition' => Option::get('dividends_condition', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderProfitSwitch' => (int)Option::get('shareHolderProfitSwitch', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderHighProfit' => Option::get('shareHolderHighProfit', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderAliasName' => Option::get('shareHolderAliasName', $this->store_id, 'bonus_pool', '股东')['value'],
- 'shareHolderRepeatProfitSwitch' => (int)Option::get('shareHolderRepeatProfitSwitch', $this->store_id, 'bonus_pool', 0)['value'],//是否开启小推大复购限制
- 'shareHolderJiandian' => (int)Option::get('shareHolderJiandian', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderChangeOldParentSwitch' => (int)Option::get('shareHolderChangeOldParentSwitch', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderChangeOldParentNumber' => (int)Option::get('shareHolderChangeOldParentNumber', $this->store_id, 'bonus_pool', 0)['value'],
- 'shareHolderChangeChildMinNumber' => (int)Option::get('shareHolderChangeChildMinNumber', $this->store_id, 'bonus_pool', 0)['value'],
- 'userSlippedOnceSwitch' => (int)Option::get('userSlippedOnceSwitch', $this->store_id, 'bonus_pool', 0)['value'],
- 'userLevel' => Option::get('userLevel', $this->store_id, 'bonus_pool', 0)['value'],
- 'cash_price_type' => Option::get('cash_price_type', $this->store_id, 'bonus_pool', '1')['value'],
- 'cash_price_amount' => Option::get('cash_price_amount', $this->store_id, 'bonus_pool', 100)['value'],
- 'cash_price_integral' => Option::get('cash_price_integral', $this->store_id, 'bonus_pool', 0)['value'],
- 'cash_price_balance' => Option::get('cash_price_balance', $this->store_id, 'bonus_pool', 0)['value'],
- //高等级是否参与加权平均
- 'high_level_join_average' => intval(Option::get('high_level_join_average', $this->store_id, 'bonus_pool', 0)['value']),
- ];
- $setting['shareHolderNumber'] = explode(',', $setting['shareHolderNumber']);
- return [
- 'code' => 0,
- 'data' => [
- 'setting' => $setting,
- 'shareHolderLevel' => $shareHolderLevel,
- 'userLevel' => $userLevel
- ]
- ];
- }
- }
|