|
|
@@ -353,42 +353,6 @@ class BonusController extends BaseController {
|
|
|
return static::notice($result);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 期数对应的奖金
|
|
|
- * @param $periodNum
|
|
|
- * @param $detailSwitch
|
|
|
- * @return array
|
|
|
- * @throws \yii\db\Exception
|
|
|
- */
|
|
|
- private function _periodBonus($periodNum) {
|
|
|
- $data = User::find()
|
|
|
- ->from(User::tableName().' AS U')
|
|
|
- ->join('LEFT JOIN', CalcBonus::tableName() . ' AS B','B.USER_ID = U.ID')
|
|
|
- ->select('U.ID AS USER_ID, U.USER_NAME, B.LAST_DEC_LV, B.LAST_EMP_LV, B.LAST_ELITE_LV, B.IS_ACTIVE, B.BONUS_E, B.BONUS_PE, B.BONUS_SE, B.BONUS_LB, B.BONUS_ST, B.BONUS_WB, B.BONUS_CAR, B.BONUS_TOTAL, B.BONUS_PB')
|
|
|
- ->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM', [':USER_ID' => \Yii::$app->user->id,' :PERIOD_NUM'=>$periodNum])
|
|
|
- ->asArray()
|
|
|
- ->one();
|
|
|
-
|
|
|
- return [
|
|
|
- ['name' => 'userName', 'value' => $data['USER_NAME']],
|
|
|
- ['name' => 'period', 'value' => $periodNum],
|
|
|
- ['name' => 'decLevel', 'value' => Cache::getDecLevelConfig()[$data['LAST_DEC_LV']]['LEVEL_NAME']],
|
|
|
- ['name' => 'empLevel', 'value' => Cache::getEmpLevelConfig()[$data['LAST_EMP_LV']]['LEVEL_NAME']],
|
|
|
- ['name' => 'eliteLevel', 'value' => Cache::getEliteLevelConfig()[($data['LAST_ELITE_LV'] ?: EliteLevel::getDefaultLevelId())]['LEVEL_NAME']],
|
|
|
- ['name' => 'isActive', 'value' => $data['IS_ACTIVE'] ?? 0],
|
|
|
- ['name' => 'eliteBonus', 'value' => Tool::formatPrice($data['BONUS_E'])],
|
|
|
- ['name' => 'proEliteBonus', 'value' => Tool::formatPrice($data['BONUS_PE'])],
|
|
|
- ['name' => 'superEliteBonus', 'value' => Tool::formatPrice($data['BONUS_SE'])],
|
|
|
- ['name' => 'leaderShipBonus', 'value' => Tool::formatPrice($data['BONUS_LB'])],
|
|
|
- ['name' => 'stockistBonus', 'value' => Tool::formatPrice($data['BONUS_ST'])],
|
|
|
- ['name' => 'welcomeBonus', 'value' => Tool::formatPrice($data['BONUS_WB'])],
|
|
|
- ['name' => 'carBonus', 'value' => Tool::formatPrice($data['BONUS_CAR'])],
|
|
|
- ['name' => 'totalBonus', 'value' => Tool::formatPrice($data['BONUS_TOTAL'])],
|
|
|
- ['name' => 'userPerformanceBonus', 'value' => Tool::formatPrice($data['BONUS_PB'])],
|
|
|
-
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 往期奖金
|
|
|
* @return mixed
|