| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace addons\QiShangTong\backend\controllers;
- use addons\QiShangTong\common\service\CategoryService;
- use Yii;
- class CategoryController extends BaseController
- {
- public $enableCsrfValidation = false;
- /**
- * 首页
- *
- * @return string
- */
- public function actionIndex()
- {
- if (\Yii::$app->request->isAjax && \Yii::$app->request->isGet) {
- $data = Yii::$app->request->get();
- $valid = Yii::$app->services->validate->validate($data, [
- [['limit', 'page'], 'integer'],
- [['keyword'], 'string'],
- ]);
- if ($valid === false) return $this->error(Yii::$app->services->validate->getErrorMessage());
- return $this->success();
- }
- return $this->render('index',[]);
- }
- public function actionImport()
- {
- $ret = (new CategoryService())->find($this->mall_id);
- return is_string($ret) ? $this->error($ret) : $this->success('后台导入中...');
- }
- }
|