| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- /**
- * BossWeight股东分红加权分红 定时任务
- */
- namespace addons\BossWeight\console\controllers;
- use addons\BossWeight\common\logic\CommissionLogLogic;
- use addons\BossWeight\common\logic\WeightRuleLogic;
- use yii\console\Controller;
- use yii\console\ExitCode;
- class BossWeightCrontabController extends Controller
- {
- /**
- * 自动发放股东分红佣金定时任务
- * 0 20 0 * * * *
- * @Author: lun
- * @DateTime: 2021/11/17 0017 20:38
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @return int
- */
- public function actionSendCommission(){
- try {
- $logic = new CommissionLogLogic();
- $res = $logic->execute();
- if($res == true) {
- echo '操作成功';
- return ExitCode::OK;
- }
- } catch (\Exception $e) {
- echo $e->getMessage();
- $this->stderr('BossWeightCrontab Error: ' . ExitCode::getReason(ExitCode::UNSPECIFIED_ERROR));
- return ExitCode::UNSPECIFIED_ERROR;
- }
- }
- /**
- * 股东加权分红状态每天更新定时任务
- * 0 20 0 * * * *
- * @Author: lun
- * @DateTime: 2021/11/17 0017 20:38
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @return int
- */
- public function actionUpdateWeightRule(){
- try {
- $logic = new WeightRuleLogic();
- $res = $logic->execute();
- if($res == true) {
- echo '操作成功';
- return ExitCode::OK;
- }
- } catch (\Exception $e) {
- echo $e->getMessage();
- $this->stderr('BossWeightCrontab Error: ' . ExitCode::getReason(ExitCode::UNSPECIFIED_ERROR));
- return ExitCode::UNSPECIFIED_ERROR;
- }
- }
- }
|