| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * 服务商分红 定时任务
- */
- namespace console\controllers;
- use addons\ServeBonus\common\logic\CommissionLogLogic;
- use yii\console\Controller;
- use yii\console\ExitCode;
- class ServeBonusCrontabController extends Controller
- {
- /**
- * 自动发放服务商分红佣金定时任务
- * 0 20 1 * * * *
- * @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('Error: ' . ExitCode::getReason(ExitCode::UNSPECIFIED_ERROR));
- return ExitCode::UNSPECIFIED_ERROR;
- }
- }
- public function actionFix(){
- try {
- $logic = new CommissionLogLogic();
- // $res = $logic->fix(3,'20230108');
- // if($res == true) {
- // echo '操作成功';
- // return ExitCode::OK;
- // }
- } catch (\Exception $e) {
- echo $e->getMessage();
- $this->stderr('Error: ' . ExitCode::getReason(ExitCode::UNSPECIFIED_ERROR));
- return ExitCode::UNSPECIFIED_ERROR;
- }
- }
- }
|