| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace addons\ReservationService\backend\controllers;
- use addons\ReservationService\common\services\BackendService;
- use addons\ReservationService\common\services\CommissionService;
- /**
- * 数据概况
- *
- * Class SettingController
- * @package addons\ReservationService\backend\controllers
- */
- class CommissionController extends BaseController
- {
- public $enableCsrfValidation = false;
- /**
- * 首页
- *
- * @return string
- */
- public function actionIndex()
- {
- $request = \Yii::$app->request;
- if ($request->isAjax && $request->isGet) {
- $params = $request->get();
- $res = \Yii::$app->services->validate->validate($params, [
- [['page', 'limit', 'list_type', 'status'],'integer'],
- [['keyword', 'date_start', 'date_end', 'order_no'], 'string'],
- ]);
- if ($res === false) return $this->error(\Yii::$app->services->validate->getErrorMessage());
- $ret = (new CommissionService())->page($this->mall_id, $params);
- $custom_text = BackendService::getCustomText($this->mall_id);
- foreach ($ret['list'] as &$item) {
- $item['desc'] = BackendService::replaceTextToCustomText($item['desc'], $custom_text);
- }
- return is_string($ret) ? $this->error($ret) : $this->success('获取成功', $ret);
- }
- return $this->render($this->action->id);
- }
- }
|