| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace addons\BusinessActivity\api\modules\v1\controllers;
- use addons\BusinessActivity\common\service\CommissionService;
- use api\controllers\OnAuthController;
- use Yii;
- class CommissionController extends OnAuthController
- {
- public $modelClass = '';
- /**
- * 不用进行登录验证的方法
- *
- * 例如: ['index', 'update', 'create', 'view', 'delete']
- * 默认全部需要验证
- *
- * @var array
- */
- protected $authOptional = [
- 'index'
- ];
- /**
- * 用户佣金列表
- * @return mixed|null
- */
- public function actionIndex()
- {
- $data = Yii::$app->request->get();
- if (!Yii::$app->services->validate->validate($data, [
- [['activity_id', 'page', 'limit'], 'integer'],
- [['start_date', 'end_date'], 'string']
- ])) {
- return $this->error(Yii::$app->services->validate->getErrorMessage());
- }
- if (empty($this->user_id)) return $this->success('请登录');
- $ret = (new CommissionService())->frontPage($this->mall_id, $this->user_id, $data);
- return is_string($ret) ? $this->error($ret) : $this->success('获取成功', $ret);
- }
- }
|