root пре 3 година
родитељ
комит
4d761b7f38
2 измењених фајлова са 4 додато и 157 уклоњено
  1. 4 18
      common/helpers/bonus/CalcServeBonusCalc.php
  2. 0 139
      common/models/ResendQY.php

+ 4 - 18
common/helpers/bonus/CalcServeBonusCalc.php

@@ -264,12 +264,11 @@ class CalcServeBonusCalc extends BaseObject {
         $this->_empLevelConfig = Cache::getEmpLevelConfig();
         $this->_starCrownLevelConfig = Cache::getStarCrownLevelConfig();
         $this->_decRoleConfig = CalcCache::getDecRoleConfig($this->_periodNum);
-        $periodNum = $this->_periodNum;
         $this->_periodId = $periodDataArr['ID'];
-        $this->_isCalcMonth = $periodObj->isCalcMonth($periodNum);
-        $this->_calcYear = $periodObj->getYear($periodNum);
-        $this->_calcMonth = $periodObj->getMonth($periodNum);
-        $this->_calcYearMonth = $periodObj->getYearMonth($periodNum);
+        $this->_isCalcMonth = $periodObj->isCalcMonth($this->_periodNum);
+        $this->_calcYear = $periodObj->getYear($this->_periodNum);
+        $this->_calcMonth = $periodObj->getMonth($this->_periodNum);
+        $this->_calcYearMonth = $periodObj->getYearMonth($this->_periodNum);
     }
 
     /**
@@ -1058,22 +1057,9 @@ class CalcServeBonusCalc extends BaseObject {
             ->all();
         if ($allData) {
             foreach ($allData as $user) {
-                // 添加到有奖励信息的数据中
-                CalcCache::addHasBonusUsers($user['USER_ID'], $this->_periodNum);
                 $fxStatus = $this->_isMonthPerfLimit($user['USER_ID']);
                 if ($fxStatus) {
-                    // //扣除相应的复消积分和管理费
-                    // $deductData = $this->deduct($user['USER_ID'], $user['ORI_BONUS']);
-                    // // 把对碰后的奖金存入缓存中
-                    // CalcCache::bonus($user['USER_ID'], $this->_periodNum, 'BONUS_BS', $user['ORI_BONUS'], $deductData);
                     CalcCache::bonus($user['USER_ID'], $this->_periodNum, 'BONUS_BS', $user['ORI_BONUS']);
-                    // $realBonusBs = $user['ORI_BONUS']; // 扣除管理费和复消积分后的实发蓝星奖金
-                    // $manageTax = $deductData['manageTax']; // 管理费
-                    // $point = $deductData['reConsumePoints'];// 复消积分
-                    // // 更新蓝星奖金存储过程的实发金额数据
-                    // CalcBonusBS::updateAll(['AMOUNT' => $realBonusBs, 'MANAGE_TAX' => $manageTax, 'RECONSUME_POINTS' => $point],
-                    // 'USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM',
-                    // [':USER_ID' => $user['USER_ID'], ':PERIOD_NUM' => $this->_periodNum]);
                 }  
             }
             return $this->calcBonusBsGL($offset + $this->_limit);

+ 0 - 139
common/models/ResendQY.php

@@ -1,139 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%RESEND_QY}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $LAST_SUB_COM_ID 结算时所属分公司
- * @property int $LAST_PROVINCE 结算时所属省份
- * @property int $LAST_CITY 结算时所属城市
- * @property int $LAST_COUNTY 结算时所属地区
- * @property string $LAST_SYSTEM_ID 结算时体系
- * @property string $BONUS_QY 区域津贴
- * @property string $SHOULD_QY 应发区域津贴
- * @property string $QY_1L 一市场区域业绩
- * @property string $SURPLUS_1L 一市场结余业绩
- * @property string $QY_2L 二市场区域业绩
- * @property string $SURPLUS_2L 二市场结余业绩
- * @property string $QY_3L 三市场区域业绩
- * @property string $SURPLUS_3L 三市场结余业绩
- * @property string $QY_4L 四市场区域业绩
- * @property string $SURPLUS_4L 四市场结余业绩
- * @property string $QY_5L 五市场区域业绩
- * @property string $SURPLUS_5L 五市场结余业绩
- * @property string $QY_LS 虚拟零售区区域业绩
- * @property string $SURPLUS_LS 虚拟零售区结余
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property int $RESEND_STATUS 补发状态
- * @property string $RESEND_AUDIT_ID 审核对应ID
- * @property int $RESEND_AUDIT_STATUS 审核状态
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- */
-class ResendQY extends \common\components\ActiveRecord
-{
-    const STATUS_WAIT = 0;
-    const STATUS_HAS = 1;
-    const STATUS_NAME = [
-        self::STATUS_WAIT => '待申请补发',
-        self::STATUS_HAS => '已申请补发',
-    ];
-
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%RESEND_QY}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'LAST_SYSTEM_ID', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'LAST_PROVINCE', 'LAST_CITY', 'LAST_COUNTY', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'RESEND_STATUS', 'RESEND_AUDIT_STATUS', 'CREATED_AT'], 'integer'],
-            [['BONUS_QY', 'SHOULD_QY', 'QY_1L', 'SURPLUS_1L', 'QY_2L', 'SURPLUS_2L', 'QY_3L', 'SURPLUS_3L', 'QY_4L', 'SURPLUS_4L', 'QY_5L', 'SURPLUS_5L', 'QY_LS', 'SURPLUS_LS'], 'number'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'LAST_SUB_COM_ID', 'LAST_SYSTEM_ID', 'RESEND_AUDIT_ID'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'safe'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'LAST_SUB_COM_ID' => '结算时所属分公司',
-            'LAST_PROVINCE' => '结算时所属省份',
-            'LAST_CITY' => '结算时所属城市',
-            'LAST_COUNTY' => '结算时所属地区',
-            'LAST_SYSTEM_ID' => '结算时体系',
-            'BONUS_QY' => '区域津贴',
-            'SHOULD_QY' => '应发区域津贴',
-            'QY_1L' => '一市场区域业绩',
-            'SURPLUS_1L' => '一市场结余业绩',
-            'QY_2L' => '二市场区域业绩',
-            'SURPLUS_2L' => '二市场结余业绩',
-            'QY_3L' => '三市场区域业绩',
-            'SURPLUS_3L' => '三市场结余业绩',
-            'QY_4L' => '四市场区域业绩',
-            'SURPLUS_4L' => '四市场结余业绩',
-            'QY_5L' => '五市场区域业绩',
-            'SURPLUS_5L' => '五市场结余业绩',
-            'QY_LS' => '虚拟零售区区域业绩',
-            'SURPLUS_LS' => '虚拟零售区结余',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'RESEND_STATUS' => '补发状态',
-            'RESEND_AUDIT_ID' => '审核对应ID',
-            'RESEND_AUDIT_STATUS' => '审核状态',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'USER_ID' => '会员ID',
-            'BONUS_QY' => '区域津贴',
-            'SHOULD_QY' => '应发区域津贴',
-            'RESEND_STATUS' => [
-                'label' => '补发状态',
-                'type' => function($data){
-                    $value = $data['value'];
-                    return self::STATUS_NAME[$value];
-                },
-            ],
-            'RESEND_AUDIT_STATUS' => [
-                'label' => '审核状态',
-                'type' => ValueTypeConfig::AUDIT_STATUS_TYPE,
-            ],
-        ];
-    }
-}