|
|
@@ -1,25 +1,14 @@
|
|
|
<?php
|
|
|
namespace backendApi\modules\v1\models\lists\bonus;
|
|
|
|
|
|
-use backendApi\modules\v1\models\Admin;
|
|
|
use common\helpers\Cache;
|
|
|
use common\helpers\Tool;
|
|
|
use common\helpers\user\Info;
|
|
|
use common\libs\dataList\column\Price;
|
|
|
-use common\libs\dataList\column\YesNo;
|
|
|
use common\libs\dataList\DataListInterface;
|
|
|
use common\models\CalcBonus;
|
|
|
-use common\models\PerfOrder;
|
|
|
-use common\models\Period;
|
|
|
-use common\models\Region;
|
|
|
-use common\models\User as modelUser;
|
|
|
-use common\models\UserBind;
|
|
|
-use common\models\UserBonus;
|
|
|
use common\models\UserInfo;
|
|
|
use common\libs\dataList\column\DateTime;
|
|
|
-use common\models\UserPerf;
|
|
|
-use common\models\UserSystem;
|
|
|
-use common\models\Withdraw;
|
|
|
use Yii;
|
|
|
|
|
|
class PeriodBonusList extends \common\libs\dataList\DataList implements DataListInterface
|
|
|
@@ -43,7 +32,7 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
|
|
|
'select'=>'CB.*,UI.CON_UID,UI.REC_UID',
|
|
|
'from' => CalcBonus::tableName().' AS CB',
|
|
|
'join' => [
|
|
|
- ['LEFT JOIN', UserInfo::tableName() . ' AS UI', 'CB.USER_ID=UI.USER_ID'],
|
|
|
+ ['INNER JOIN', UserInfo::tableName() . ' AS UI', 'CB.USER_ID=UI.USER_ID'],
|
|
|
],
|
|
|
'yearMonth' => $yearMonth,
|
|
|
'orderBy' => 'CB.CREATED_AT DESC, CB.ID DESC',
|
|
|
@@ -55,6 +44,7 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
|
|
|
foreach ($this->listData['list'] as $key => $value) {
|
|
|
$this->listData['list'][$key]['LAST_DEC_LV_NAME'] = Cache::getDecLevelConfig()[$value['LAST_DEC_LV']]['LEVEL_NAME'];
|
|
|
$this->listData['list'][$key]['LAST_EMP_LV_NAME'] = Cache::getEmpLevelConfig()[$value['LAST_EMP_LV']]['LEVEL_NAME'];
|
|
|
+ $this->listData['list'][$key]['LAST_ELITE_LV_NAME'] = Cache::getEliteLevelConfig()[$value['LAST_ELITE_LV']]['LEVEL_NAME'];
|
|
|
$this->listData['list'][$key]['LAST_STATUS_NAME'] = Tool::paramConvert(Yii::$app->params['userStatus'])[$value['LAST_STATUS']]['label'];
|
|
|
$this->listData['list'][$key]['LAST_REC_USER_NAME'] = Info::getUserNameByUserId($value['REC_UID']);
|
|
|
$this->listData['list'][$key]['LAST_REC_REAL_NAME'] = Info::getUserRealNameByUserId($value['REC_UID']);
|
|
|
@@ -120,6 +110,12 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
|
|
|
'width' => '140',
|
|
|
],
|
|
|
],
|
|
|
+ 'LAST_ELITE_LV_NAME' => [
|
|
|
+ 'header' => \Yii::t('ctx', 'latestElite'), // 结算时会员最新ELite
|
|
|
+ 'headerOther' => [
|
|
|
+ 'width' => '140',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
'LAST_MOBILE' => [
|
|
|
'header' => \Yii::t('ctx', 'phoneNumber'),//手机号码
|
|
|
'headerOther' => [
|
|
|
@@ -153,126 +149,6 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
|
|
|
'width' => '120',
|
|
|
],
|
|
|
],
|
|
|
-// 'LAST_CON_USER_NAME' => [
|
|
|
-// 'header' => Yii::t('ctx', 'superiorCode'), // 上级编号
|
|
|
-// 'headerOther' => [
|
|
|
-// 'width' => '150',
|
|
|
-// ],
|
|
|
-// ],
|
|
|
-// 'LAST_CON_REAL_NAME' => [
|
|
|
-// 'header' => Yii::t('ctx', 'superiorName'), // 上级姓名
|
|
|
-// 'headerOther' => [
|
|
|
-// 'width' => '120',
|
|
|
-// ],
|
|
|
-// ],
|
|
|
- 'BONUS_TG' => [
|
|
|
- 'header' => Yii::t('ctx', 'welcomeBonus'), // 销售奖金
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_TG'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '130',
|
|
|
- 'prop'=>'BONUS_TG',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_QY' => [
|
|
|
- 'header' => Yii::t('ctx', 'teamBonus'), // 绩效奖金
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_QY'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '120',
|
|
|
- 'prop'=>'BONUS_QY',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'ORI_CAPPED_BONUS_QY' => [
|
|
|
- 'header' => Yii::t('ctx', 'uncappedTeamBonus'), // 绩效奖未封顶金额
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['ORI_CAPPED_BONUS_QY'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '170',
|
|
|
- 'prop'=>'ORI_CAPPED_BONUS_QY',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_BS' => [
|
|
|
- 'header' => Yii::t('ctx', 'directorBonus'),// 管理奖/蓝星奖
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_BS'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '120',
|
|
|
- 'prop'=>'BONUS_BS',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_BD' => [
|
|
|
- 'header' => Yii::t('ctx', 'stockistCommission'), // 服务奖
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_BD'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '150',
|
|
|
- 'prop'=>'BONUS_BD',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_QUARTER' => [
|
|
|
- 'header' => Yii::t('ctx', 'quarterlyBonus'), // 季度分红
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_QUARTER'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '130',
|
|
|
- 'prop'=>'BONUS_QUARTER',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_REAL' => [
|
|
|
- 'header' => Yii::t('ctx', 'actualBonus'), // 实发奖金
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_REAL'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '120',
|
|
|
- 'prop'=>'BONUS_REAL',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_TOTAL' => [
|
|
|
- 'header' => Yii::t('ctx', 'totalBonus'), // 总奖金
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_TOTAL'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '120',
|
|
|
- 'prop'=>'BONUS_TOTAL',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'BONUS_INCOME' => [
|
|
|
- 'header' => Yii::t('ctx', 'totalRevenue'), // 总收入
|
|
|
- 'value' => function($row) {
|
|
|
- return (new Price([
|
|
|
- 'value' => $row['BONUS_INCOME'],
|
|
|
- ]))->result();
|
|
|
- },
|
|
|
- 'headerOther' => [
|
|
|
- 'width' => '120',
|
|
|
- 'prop'=>'BONUS_INCOME',
|
|
|
- ],
|
|
|
- ],
|
|
|
'CALC_MONTH' => [
|
|
|
'header' => Yii::t('ctx', 'bonusMonth'), // 结算月
|
|
|
'headerOther' => [
|
|
|
@@ -296,6 +172,7 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
|
|
|
'LAST_REAL_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'memberName')], // 会员姓名
|
|
|
'LAST_DEC_LV_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'PCMemberLevel'), 'other'=> 'decLevel'], // 结算时会员级别
|
|
|
'LAST_EMP_LV_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'latestDirector'), 'other'=> 'empLevel'], // 结算时会员管理星级
|
|
|
+ 'LAST_ELITE_LV_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'latestElite'), 'other'=> 'elite'], // 结算时会员Elite
|
|
|
'LAST_MOBILE'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'phoneNumber')], // 手机号
|
|
|
'LAST_PERIOD_AT'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'joiningPeriod')], // 加入期数
|
|
|
'LAST_CREATED_AT'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'joiningDate'), 'other'=> 'date'], // 加入时间
|
|
|
@@ -304,13 +181,6 @@ class PeriodBonusList extends \common\libs\dataList\DataList implements DataList
|
|
|
'LAST_REC_REAL_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'sponsorName')], // 开拓者姓名
|
|
|
'LAST_CON_USER_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'superiorNumber')], // 上级编号
|
|
|
'LAST_CON_REAL_NAME'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'superiorName')], // 上级姓名
|
|
|
- 'PV_1L'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'oneNewMarketPerformance')], // 一市场新增业绩
|
|
|
- 'SURPLUS_1L'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'oneMarketBalancePerformance')], // 一市场结余业绩
|
|
|
- 'PV_2L'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'twoNewMarketPerformance')], // 二市场新增业绩
|
|
|
- 'SURPLUS_2L'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'twoMarketBalancePerformance')], // 二市场结余业绩
|
|
|
- 'BONUS_BD'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'stockistCommission')], // 服务奖
|
|
|
- 'BONUS_GL'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'managementAward')], // 管理奖
|
|
|
- 'BONUS_QY'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'teamBonus')], // 团队奖
|
|
|
'CALC_MONTH'=> ['isUserTable'=> false, 'name'=> Yii::t('ctx', 'bonusMonth')], // 结算月
|
|
|
];
|
|
|
}
|