|
@@ -12,7 +12,9 @@ namespace frontendApi\modules\v1\controllers;
|
|
|
|
|
|
|
|
use common\helpers\Cache;
|
|
use common\helpers\Cache;
|
|
|
use common\helpers\Date;
|
|
use common\helpers\Date;
|
|
|
|
|
+use common\helpers\Form;
|
|
|
use common\helpers\Tool;
|
|
use common\helpers\Tool;
|
|
|
|
|
+use common\helpers\user\Balance;
|
|
|
use common\helpers\user\Info;
|
|
use common\helpers\user\Info;
|
|
|
use common\helpers\user\Perf;
|
|
use common\helpers\user\Perf;
|
|
|
use common\models\CalcBonus;
|
|
use common\models\CalcBonus;
|
|
@@ -28,17 +30,28 @@ use common\models\FlowReconsumePoints;
|
|
|
use common\models\FlowTourismPoints;
|
|
use common\models\FlowTourismPoints;
|
|
|
use common\models\FlowVillaPoints;
|
|
use common\models\FlowVillaPoints;
|
|
|
use common\models\FlowWallet;
|
|
use common\models\FlowWallet;
|
|
|
|
|
+use common\models\forms\TransferForm;
|
|
|
|
|
+use common\models\forms\UploadForm;
|
|
|
|
|
+use common\models\forms\WithdrawForm;
|
|
|
|
|
+use common\models\InvoiceAudit;
|
|
|
use common\models\PerfMonth;
|
|
use common\models\PerfMonth;
|
|
|
use common\models\PerfPeriod;
|
|
use common\models\PerfPeriod;
|
|
|
use common\models\Period;
|
|
use common\models\Period;
|
|
|
use common\models\DecRole;
|
|
use common\models\DecRole;
|
|
|
use common\models\EmployLevel;
|
|
use common\models\EmployLevel;
|
|
|
use common\models\FlowExchangePoints;
|
|
use common\models\FlowExchangePoints;
|
|
|
|
|
+use common\models\RegType;
|
|
|
use common\models\ScoreMonth;
|
|
use common\models\ScoreMonth;
|
|
|
|
|
+use common\models\Transfer;
|
|
|
|
|
+use common\models\Uploads;
|
|
|
use common\models\UserBonus;
|
|
use common\models\UserBonus;
|
|
|
|
|
+use common\models\UserInfo;
|
|
|
use common\models\UserWallet;
|
|
use common\models\UserWallet;
|
|
|
use common\models\UserRelation;
|
|
use common\models\UserRelation;
|
|
|
|
|
+use common\models\Withdraw;
|
|
|
use frontendApi\modules\v1\models\User;
|
|
use frontendApi\modules\v1\models\User;
|
|
|
|
|
+use Yii;
|
|
|
|
|
+use yii\web\UploadedFile;
|
|
|
|
|
|
|
|
class BonusController extends BaseController {
|
|
class BonusController extends BaseController {
|
|
|
public $modelClass = CalcBonus::class;
|
|
public $modelClass = CalcBonus::class;
|
|
@@ -75,13 +88,13 @@ class BonusController extends BaseController {
|
|
|
// $showCFLX = true;
|
|
// $showCFLX = true;
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
- $wallet[] = ['walletType' => 'bonus', 'walletName' => 'Member Bonus', 'amount' => Tool::formatPrice($data['BONUS'])];//会员奖金
|
|
|
|
|
- $wallet[] = ['walletType' => 'cash', 'walletName' => 'Member Ecoin', 'amount' => Tool::formatPrice($data['CASH'])];//会员余额
|
|
|
|
|
|
|
+ $wallet[] = ['walletType' => 'bonus', 'walletName' => Yii::t('app', 'memberBonus'), 'amount' => Tool::formatPrice($data['BONUS'])];//会员奖金
|
|
|
|
|
+ $wallet[] = ['walletType' => 'cash', 'walletName' => Yii::t('app', 'memberEcoin'), 'amount' => Tool::formatPrice($data['CASH'])];//会员余额
|
|
|
// $wallet[] = ['walletType' => 'point', 'walletName' => '会员积分', 'amount' => Tool::formatPrice($data['RECONSUME_POINTS'])];
|
|
// $wallet[] = ['walletType' => 'point', 'walletName' => '会员积分', 'amount' => Tool::formatPrice($data['RECONSUME_POINTS'])];
|
|
|
// $wallet[] = ['walletType' => 'exchange', 'walletName' => 'Exchange points', 'amount' => Tool::formatPrice($data['EXCHANGE_POINTS'])];//兑换点数
|
|
// $wallet[] = ['walletType' => 'exchange', 'walletName' => 'Exchange points', 'amount' => Tool::formatPrice($data['EXCHANGE_POINTS'])];//兑换点数
|
|
|
// $wallet[] = ['walletType' => 'tourism_points', 'walletName' => 'Travel points', 'amount' => Tool::formatPrice($data['TOURISM_POINTS'])];//旅游积分
|
|
// $wallet[] = ['walletType' => 'tourism_points', 'walletName' => 'Travel points', 'amount' => Tool::formatPrice($data['TOURISM_POINTS'])];//旅游积分
|
|
|
- $wallet[] = ['walletType' => 'garage_points', 'walletName' => 'Car Points', 'amount' => Tool::formatPrice($data['GARAGE_POINTS'])];//车奖积分
|
|
|
|
|
- $wallet[] = ['walletType' => 'villa_points', 'walletName' => 'Villa Points', 'amount' => Tool::formatPrice($data['VILLA_POINTS'])];//房奖积分
|
|
|
|
|
|
|
+ $wallet[] = ['walletType' => 'garage_points', 'walletName' => Yii::t('app', 'carPoints'), 'amount' => Tool::formatPrice($data['GARAGE_POINTS'])];//车奖积分
|
|
|
|
|
+ $wallet[] = ['walletType' => 'villa_points', 'walletName' => Yii::t('app', 'villaPoints'), 'amount' => Tool::formatPrice($data['VILLA_POINTS'])];//房奖积分
|
|
|
// if ($showCFLX) {
|
|
// if ($showCFLX) {
|
|
|
// $wallet[] = ['walletType' => 'cf', 'walletName' => '福利积分一', 'amount' => Tool::formatPrice($data['CF'])];
|
|
// $wallet[] = ['walletType' => 'cf', 'walletName' => '福利积分一', 'amount' => Tool::formatPrice($data['CF'])];
|
|
|
// $wallet[] = ['walletType' => 'lx', 'walletName' => '福利积分二', 'amount' => Tool::formatPrice($data['LX'])];
|
|
// $wallet[] = ['walletType' => 'lx', 'walletName' => '福利积分二', 'amount' => Tool::formatPrice($data['LX'])];
|
|
@@ -296,7 +309,7 @@ class BonusController extends BaseController {
|
|
|
if($walletType != 'cash') {
|
|
if($walletType != 'cash') {
|
|
|
foreach ($data['list'] as $key => $value) {
|
|
foreach ($data['list'] as $key => $value) {
|
|
|
if ($value['DEAL_TYPE_IS_PRESET'] == 0) {
|
|
if ($value['DEAL_TYPE_IS_PRESET'] == 0) {
|
|
|
- $data['list'][$key]['DEAL_TYPE_NAME'] = $value['AMOUNT'] > 0 ? 'increase' : 'reduce'; // 增加 减少
|
|
|
|
|
|
|
+ $data['list'][$key]['DEAL_TYPE_NAME'] = $value['AMOUNT'] > 0 ? Yii::t('app', 'increase') : Yii::t('app', 'reduce');
|
|
|
} else {
|
|
} else {
|
|
|
$data['list'][$key]['DEAL_TYPE_NAME'] = DealType::getAllTypesForShow()[$value['DEAL_TYPE_ID']]['TYPE_NAME'] ?? '';
|
|
$data['list'][$key]['DEAL_TYPE_NAME'] = DealType::getAllTypesForShow()[$value['DEAL_TYPE_ID']]['TYPE_NAME'] ?? '';
|
|
|
}
|
|
}
|
|
@@ -313,8 +326,8 @@ class BonusController extends BaseController {
|
|
|
if(!$value['DEAL_TYPE_ID']) continue;
|
|
if(!$value['DEAL_TYPE_ID']) continue;
|
|
|
$dealType = DealType::getAllTypesForShow()[$value['DEAL_TYPE_ID']];
|
|
$dealType = DealType::getAllTypesForShow()[$value['DEAL_TYPE_ID']];
|
|
|
if($dealType['IS_PRESET']==0){
|
|
if($dealType['IS_PRESET']==0){
|
|
|
- $dealTypes['1'] = 'increase';// 增加
|
|
|
|
|
- $dealTypes['2'] = 'reduce';// 扣除
|
|
|
|
|
|
|
+ $dealTypes['1'] = Yii::t('app', 'increase');// 增加
|
|
|
|
|
+ $dealTypes['2'] = Yii::t('app', 'reduce');// 扣除
|
|
|
}else{
|
|
}else{
|
|
|
$dealLists[$key]['DEAL_TYPE_NAME'] = $dealType['TYPE_NAME']??'';
|
|
$dealLists[$key]['DEAL_TYPE_NAME'] = $dealType['TYPE_NAME']??'';
|
|
|
$dealTypes[$value['DEAL_TYPE_ID']] = $dealLists[$key]['DEAL_TYPE_NAME'];
|
|
$dealTypes[$value['DEAL_TYPE_ID']] = $dealLists[$key]['DEAL_TYPE_NAME'];
|
|
@@ -339,11 +352,11 @@ class BonusController extends BaseController {
|
|
|
//是否近期期数
|
|
//是否近期期数
|
|
|
$showFlowPeriodNum = Cache::getSystemConfig()['showFlowPeriodNum']['VALUE'];
|
|
$showFlowPeriodNum = Cache::getSystemConfig()['showFlowPeriodNum']['VALUE'];
|
|
|
$periodArr = Period::getNearlySendPeriodNum($showFlowPeriodNum);
|
|
$periodArr = Period::getNearlySendPeriodNum($showFlowPeriodNum);
|
|
|
- if(!in_array($periodNum,$periodArr)) return static::notice('Cannot view this period',400); // 该期不能查看
|
|
|
|
|
|
|
+ if(!in_array($periodNum,$periodArr)) return static::notice(Yii::t('app', 'cannotViewThisPeriod'), 400);
|
|
|
//增加明细开关控制(0 只显示总奖金 1 全部显示)
|
|
//增加明细开关控制(0 只显示总奖金 1 全部显示)
|
|
|
$flowBonusSwitch = Cache::getSystemConfig()['flowBonusSwitch']['VALUE'];
|
|
$flowBonusSwitch = Cache::getSystemConfig()['flowBonusSwitch']['VALUE'];
|
|
|
$data = $this->_periodBonus($periodNum,$flowBonusSwitch);
|
|
$data = $this->_periodBonus($periodNum,$flowBonusSwitch);
|
|
|
- if(!$data) return static::notice('当期无奖金记录',400);
|
|
|
|
|
|
|
+ if(!$data) return static::notice(Yii::t('app', 'bonusRecordDoesNotExists'), 400);
|
|
|
return static::notice($data);
|
|
return static::notice($data);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -712,13 +725,13 @@ class BonusController extends BaseController {
|
|
|
$condition = '';
|
|
$condition = '';
|
|
|
$params = [];
|
|
$params = [];
|
|
|
if (!$periodNum) {
|
|
if (!$periodNum) {
|
|
|
- return static::notice('请选择期数',400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'pleaseSelectThePeriod'), 400);
|
|
|
}
|
|
}
|
|
|
if ($periodNum) {
|
|
if ($periodNum) {
|
|
|
$showDecPeriodNum = Cache::getSystemConfig()['showDecPeriodNum']['VALUE'];
|
|
$showDecPeriodNum = Cache::getSystemConfig()['showDecPeriodNum']['VALUE'];
|
|
|
$periodNums = Period::find()->where('IS_SENT=:IS_SENT',[':IS_SENT' => Period::SEND_FINISH])->select('PERIOD_NUM')->limit($showDecPeriodNum)->orderBy('PERIOD_NUM DESC')->asArray()->all();
|
|
$periodNums = Period::find()->where('IS_SENT=:IS_SENT',[':IS_SENT' => Period::SEND_FINISH])->select('PERIOD_NUM')->limit($showDecPeriodNum)->orderBy('PERIOD_NUM DESC')->asArray()->all();
|
|
|
if(!in_array($periodNum,array_column($periodNums,'PERIOD_NUM'))){
|
|
if(!in_array($periodNum,array_column($periodNums,'PERIOD_NUM'))){
|
|
|
- return static::notice('该期无法查看',400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'cannotViewThisPeriod'), 400);
|
|
|
}
|
|
}
|
|
|
$condition .= ' AND PERIOD_NUM=:PERIOD_NUM';
|
|
$condition .= ' AND PERIOD_NUM=:PERIOD_NUM';
|
|
|
$params[':PERIOD_NUM'] = $periodNum;
|
|
$params[':PERIOD_NUM'] = $periodNum;
|
|
@@ -752,13 +765,13 @@ class BonusController extends BaseController {
|
|
|
$condition = '';
|
|
$condition = '';
|
|
|
$params = [];
|
|
$params = [];
|
|
|
if (!$periodNum) {
|
|
if (!$periodNum) {
|
|
|
- return static::notice('请选择期数',400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'pleaseSelectThePeriod'), 400);
|
|
|
}
|
|
}
|
|
|
if ($periodNum) {
|
|
if ($periodNum) {
|
|
|
$showDecPeriodNum = Cache::getSystemConfig()['showDecPeriodNum']['VALUE'];
|
|
$showDecPeriodNum = Cache::getSystemConfig()['showDecPeriodNum']['VALUE'];
|
|
|
$periodNums = Period::find()->where('IS_SENT=:IS_SENT',[':IS_SENT' => Period::SEND_FINISH])->select('PERIOD_NUM')->limit($showDecPeriodNum)->orderBy('PERIOD_NUM DESC')->asArray()->all();
|
|
$periodNums = Period::find()->where('IS_SENT=:IS_SENT',[':IS_SENT' => Period::SEND_FINISH])->select('PERIOD_NUM')->limit($showDecPeriodNum)->orderBy('PERIOD_NUM DESC')->asArray()->all();
|
|
|
if(!in_array($periodNum,array_column($periodNums,'PERIOD_NUM'))){
|
|
if(!in_array($periodNum,array_column($periodNums,'PERIOD_NUM'))){
|
|
|
- return static::notice('该期无法查看',400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'cannotViewThisPeriod'), 400);
|
|
|
}
|
|
}
|
|
|
$condition .= ' AND PERIOD_NUM=:PERIOD_NUM';
|
|
$condition .= ' AND PERIOD_NUM=:PERIOD_NUM';
|
|
|
$params[':PERIOD_NUM'] = $periodNum;
|
|
$params[':PERIOD_NUM'] = $periodNum;
|
|
@@ -789,7 +802,7 @@ class BonusController extends BaseController {
|
|
|
$periodInfo = $period->setPeriodNum($periodNum);
|
|
$periodInfo = $period->setPeriodNum($periodNum);
|
|
|
$yearMonth = $period->getYearMonth($periodNum);
|
|
$yearMonth = $period->getYearMonth($periodNum);
|
|
|
if (!$period->isSent($periodNum)) {
|
|
if (!$period->isSent($periodNum)) {
|
|
|
- return static::notice('Cannot view this period',400); // 该期不能查看
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'cannotViewThisPeriod'), 400);
|
|
|
}
|
|
}
|
|
|
$data = CalcBonus::findUseSlaves()->yearMonth($yearMonth)->select('BONUS_QY,BONUS_YC,BONUS_FX,BONUS_LS,BONUS_CF,BONUS_LX,BONUS_FL')->where('PERIOD_NUM=:PERIOD_NUM AND USER_ID=:USER_ID', [':PERIOD_NUM' => $periodNum, ':USER_ID' => \Yii::$app->user->id])->asArray()->one();
|
|
$data = CalcBonus::findUseSlaves()->yearMonth($yearMonth)->select('BONUS_QY,BONUS_YC,BONUS_FX,BONUS_LS,BONUS_CF,BONUS_LX,BONUS_FL')->where('PERIOD_NUM=:PERIOD_NUM AND USER_ID=:USER_ID', [':PERIOD_NUM' => $periodNum, ':USER_ID' => \Yii::$app->user->id])->asArray()->one();
|
|
|
return static::notice(['period' => $periodInfo, 'bonus' => $data]);
|
|
return static::notice(['period' => $periodInfo, 'bonus' => $data]);
|
|
@@ -804,7 +817,7 @@ class BonusController extends BaseController {
|
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
|
if ($yearMonth) {
|
|
if ($yearMonth) {
|
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
|
- return static::notice('无效参数', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'invalidParameter'), 400);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
$period = Period::instance();
|
|
$period = Period::instance();
|
|
@@ -832,7 +845,7 @@ class BonusController extends BaseController {
|
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
|
if ($yearMonth) {
|
|
if ($yearMonth) {
|
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
|
- return static::notice('无效参数', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'invalidParameter'), 400);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
$period = Period::instance();
|
|
$period = Period::instance();
|
|
@@ -871,12 +884,12 @@ class BonusController extends BaseController {
|
|
|
$formModel = new WithdrawForm();
|
|
$formModel = new WithdrawForm();
|
|
|
$formModel->scenario = 'addByUser';
|
|
$formModel->scenario = 'addByUser';
|
|
|
if ($formModel->load(\Yii::$app->request->post(), '') && $formModel->add()) {
|
|
if ($formModel->load(\Yii::$app->request->post(), '') && $formModel->add()) {
|
|
|
- return static::notice('Withdrawal application has been submitted, please wait for review.'); // 提现申请已提交,请等待审核
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawalApplicationHasBeenSubmitted'), 400);
|
|
|
} else {
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- return static::notice('Illegal request', 400); // 非法请求
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'illegalRequest'), 400);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -891,12 +904,12 @@ class BonusController extends BaseController {
|
|
|
$formModel = new WithdrawForm();
|
|
$formModel = new WithdrawForm();
|
|
|
$formModel->scenario = 'backByUser';
|
|
$formModel->scenario = 'backByUser';
|
|
|
if ($formModel->load(\Yii::$app->request->post(), '') && $formModel->backByUser()) {
|
|
if ($formModel->load(\Yii::$app->request->post(), '') && $formModel->backByUser()) {
|
|
|
- return static::notice('提现已退回');
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawHasBeenBacked'));
|
|
|
} else {
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- return static::notice('Illegal request', 400); // 非法请求
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'illegalRequest'), 400);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -908,23 +921,23 @@ class BonusController extends BaseController {
|
|
|
public function actionChkWithdrawUser() {
|
|
public function actionChkWithdrawUser() {
|
|
|
$uid = \Yii::$app->user->id;
|
|
$uid = \Yii::$app->user->id;
|
|
|
if (!Info::isVerified($uid)) {
|
|
if (!Info::isVerified($uid)) {
|
|
|
- return static::notice('未实名验证无法提现', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawDoesNotAllowedOfAuthentication'), 400);
|
|
|
}
|
|
}
|
|
|
$userInfo = UserInfo::findOneAsArray('USER_ID=:USER_ID', [':USER_ID' => $uid], 'IS_BIND,IS_BIND_MAIN,IS_AUTO_WITHDRAW,REG_TYPE,TRANSFER_PROP');
|
|
$userInfo = UserInfo::findOneAsArray('USER_ID=:USER_ID', [':USER_ID' => $uid], 'IS_BIND,IS_BIND_MAIN,IS_AUTO_WITHDRAW,REG_TYPE,TRANSFER_PROP');
|
|
|
if ($userInfo['IS_BIND'] == 1 && $userInfo['IS_BIND_MAIN'] == 0) {
|
|
if ($userInfo['IS_BIND'] == 1 && $userInfo['IS_BIND_MAIN'] == 0) {
|
|
|
- return static::notice('附属会员无法提现', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawDoesNotAllowedOfSubsidiaryMember'), 400);
|
|
|
}
|
|
}
|
|
|
if ($userInfo['IS_AUTO_WITHDRAW'] == 1) {
|
|
if ($userInfo['IS_AUTO_WITHDRAW'] == 1) {
|
|
|
- return static::notice('已开启自动提现,如需手动提现请关闭自动提现', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'autoWithdrawHasBeenOpened'), 400);
|
|
|
}
|
|
}
|
|
|
if (!Withdraw::allowWithdraw()) {
|
|
if (!Withdraw::allowWithdraw()) {
|
|
|
- return static::notice('未到提现日期,请在每月挂网后第一周申请提现', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawNotAllowOfDate'), 400);
|
|
|
}
|
|
}
|
|
|
if (Withdraw::hasThisMonthWithdraw($uid)) {
|
|
if (Withdraw::hasThisMonthWithdraw($uid)) {
|
|
|
- return static::notice('提现失败,每月只可以提现一次', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawAllowOnceOfMonth'), 400);
|
|
|
}
|
|
}
|
|
|
if (Withdraw::existWaitAudit($uid)) {
|
|
if (Withdraw::existWaitAudit($uid)) {
|
|
|
- return static::notice('提现失败,您存在未审核的提现记录', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawRecordHasNotVerify'), 400);
|
|
|
}
|
|
}
|
|
|
//是否显示服务协议
|
|
//是否显示服务协议
|
|
|
$regType = RegType::findOneAsArray('ID=:ID', [':ID' => $userInfo['REG_TYPE']], 'IS_PACT');
|
|
$regType = RegType::findOneAsArray('ID=:ID', [':ID' => $userInfo['REG_TYPE']], 'IS_PACT');
|
|
@@ -952,10 +965,10 @@ class BonusController extends BaseController {
|
|
|
public function actionCollectBind() {
|
|
public function actionCollectBind() {
|
|
|
$transferBonusForm = new TransferBonusForm();
|
|
$transferBonusForm = new TransferBonusForm();
|
|
|
if ($totals=$transferBonusForm->collectBind(\Yii::$app->user->id)) {
|
|
if ($totals=$transferBonusForm->collectBind(\Yii::$app->user->id)) {
|
|
|
- return static::notice('归集完成,归集金额'.$totals);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'notionalPoolingAmountFinished') . $totals);
|
|
|
} else {
|
|
} else {
|
|
|
if($totals==0){
|
|
if($totals==0){
|
|
|
- return static::notice('归集完成,归集金额'.$totals);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'notionalPoolingAmountFinished') . $totals);
|
|
|
}else{
|
|
}else{
|
|
|
return static::notice(Form::formatErrorsForApi($transferBonusForm->getErrors()), 400);
|
|
return static::notice(Form::formatErrorsForApi($transferBonusForm->getErrors()), 400);
|
|
|
}
|
|
}
|
|
@@ -971,13 +984,13 @@ class BonusController extends BaseController {
|
|
|
$id = \Yii::$app->request->get('id');
|
|
$id = \Yii::$app->request->get('id');
|
|
|
$withdraw = Withdraw::findOneAsArray('ID=:ID', [':ID' => $id]);
|
|
$withdraw = Withdraw::findOneAsArray('ID=:ID', [':ID' => $id]);
|
|
|
if (!$withdraw) {
|
|
if (!$withdraw) {
|
|
|
- return static::notice('The data does not exist', 400); // 数据不存在
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'dataDoesNotExists'), 400);
|
|
|
}
|
|
}
|
|
|
$uploadInvoiceTip = Cache::getSystemConfig()['uploadInvoiceTip']['VALUE'];
|
|
$uploadInvoiceTip = Cache::getSystemConfig()['uploadInvoiceTip']['VALUE'];
|
|
|
if ($withdraw['AUDIT_STATUS'] == Withdraw::STATUS_APPLIED) {
|
|
if ($withdraw['AUDIT_STATUS'] == Withdraw::STATUS_APPLIED) {
|
|
|
return static::notice(['addInvoiceTips' => $uploadInvoiceTip]);
|
|
return static::notice(['addInvoiceTips' => $uploadInvoiceTip]);
|
|
|
} else {
|
|
} else {
|
|
|
- return static::notice('该提现记录无法上传发票', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'withdrawDoesNotUploadInvoice'), 400);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -991,7 +1004,7 @@ class BonusController extends BaseController {
|
|
|
$id = \Yii::$app->request->get('id');
|
|
$id = \Yii::$app->request->get('id');
|
|
|
$withdraw = Withdraw::findOneAsArray('ID=:ID', [':ID' => $id]);
|
|
$withdraw = Withdraw::findOneAsArray('ID=:ID', [':ID' => $id]);
|
|
|
if (!$withdraw) {
|
|
if (!$withdraw) {
|
|
|
- return static::notice('The data does not exist', 400); // 数据不存在
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'dataDoesNotExists'), 400);
|
|
|
}
|
|
}
|
|
|
if (\Yii::$app->request->isPost) {
|
|
if (\Yii::$app->request->isPost) {
|
|
|
$formModel = new UploadForm();
|
|
$formModel = new UploadForm();
|
|
@@ -1002,7 +1015,7 @@ class BonusController extends BaseController {
|
|
|
//$formModel->token = \Yii::$app->request->post('uploadToken');
|
|
//$formModel->token = \Yii::$app->request->post('uploadToken');
|
|
|
$formModel->token = \Yii::$app->request->request('uploadToken');
|
|
$formModel->token = \Yii::$app->request->request('uploadToken');
|
|
|
if ($formModel->file && $formModel->upload()) {
|
|
if ($formModel->file && $formModel->upload()) {
|
|
|
- return static::notice('Successful');
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'successfully'));
|
|
|
} else {
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
|
}
|
|
}
|
|
@@ -1018,7 +1031,7 @@ class BonusController extends BaseController {
|
|
|
$id = \Yii::$app->request->get('id');
|
|
$id = \Yii::$app->request->get('id');
|
|
|
$uploads = Uploads::findOneAsArray('ID=:ID', [':ID' => $id],'URL');
|
|
$uploads = Uploads::findOneAsArray('ID=:ID', [':ID' => $id],'URL');
|
|
|
if (!$uploads) {
|
|
if (!$uploads) {
|
|
|
- return static::notice('The data does not exist', 400); // 数据不存在
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'dataDoesNotExists'), 400);
|
|
|
}
|
|
}
|
|
|
return static::notice($uploads['URL']);
|
|
return static::notice($uploads['URL']);
|
|
|
}
|
|
}
|
|
@@ -1041,7 +1054,7 @@ class BonusController extends BaseController {
|
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
|
if ($yearMonth) {
|
|
if ($yearMonth) {
|
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
|
- return static::notice('无效参数', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'invalidParameter'), 400);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
$period = Period::instance();
|
|
$period = Period::instance();
|
|
@@ -1095,7 +1108,7 @@ class BonusController extends BaseController {
|
|
|
if (\Yii::$app->request->isPost) {
|
|
if (\Yii::$app->request->isPost) {
|
|
|
$formModel = new TransferForm();
|
|
$formModel = new TransferForm();
|
|
|
if ($formModel->load(\Yii::$app->request->post(), '') && $formModel->transfer()) {
|
|
if ($formModel->load(\Yii::$app->request->post(), '') && $formModel->transfer()) {
|
|
|
- return static::notice('Transfer success'); // 转账成功
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'successfully'));
|
|
|
} else {
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
|
}
|
|
}
|
|
@@ -1110,11 +1123,11 @@ class BonusController extends BaseController {
|
|
|
public function actionChkTransferUser() {
|
|
public function actionChkTransferUser() {
|
|
|
$uid = \Yii::$app->user->id;
|
|
$uid = \Yii::$app->user->id;
|
|
|
if (!Info::isVerified($uid)) {
|
|
if (!Info::isVerified($uid)) {
|
|
|
- return static::notice('未实名验证无法转账', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'transferDoesNotAllowedOfAuthentication'), 400);
|
|
|
}
|
|
}
|
|
|
$userInfo = UserInfo::findOneAsArray('USER_ID=:USER_ID', [':USER_ID' => $uid], 'ALLOW_TRANSFER,TRANSFER_PROP');
|
|
$userInfo = UserInfo::findOneAsArray('USER_ID=:USER_ID', [':USER_ID' => $uid], 'ALLOW_TRANSFER,TRANSFER_PROP');
|
|
|
if($userInfo['ALLOW_TRANSFER']==0){
|
|
if($userInfo['ALLOW_TRANSFER']==0){
|
|
|
- return static::notice('您不允许转账', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'transferDoesNotAllowed'), 400);
|
|
|
}
|
|
}
|
|
|
$isCanTransferProp = Cache::getSystemConfig()['isCanTransferProp']['VALUE'];
|
|
$isCanTransferProp = Cache::getSystemConfig()['isCanTransferProp']['VALUE'];
|
|
|
if($isCanTransferProp==0){
|
|
if($isCanTransferProp==0){
|
|
@@ -1135,7 +1148,7 @@ class BonusController extends BaseController {
|
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
$yearMonth = \Yii::$app->request->get('yearMonth');
|
|
|
if ($yearMonth) {
|
|
if ($yearMonth) {
|
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
if (!Date::isYearMonth($yearMonth)) {
|
|
|
- return static::notice('无效参数', 400);
|
|
|
|
|
|
|
+ return static::notice(Yii::t('app', 'invalidParameter'), 400);
|
|
|
}
|
|
}
|
|
|
$condition .= ' AND CALC_MONTH=:CALC_MONTH';
|
|
$condition .= ' AND CALC_MONTH=:CALC_MONTH';
|
|
|
$params['CALC_MONTH'] = $yearMonth;
|
|
$params['CALC_MONTH'] = $yearMonth;
|