| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\modules\admin\controllers;
- use app\models\UserLabel;
- use app\modules\admin\models\UserLabelForm;
- class UserLabelController extends BaseController
- {
- //用户标签列表
- public function actionList() {
- $form = new UserLabelForm();
- $form->attributes = get_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->list());
- }
- //添加修改用户标签
- public function actionSave() {
- $form = new UserLabelForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->save());
- }
- //删除用户标签
- public function actionDelete() {
- $form = new UserLabelForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->delete());
- }
- //修改用户标签状态
- public function actionSetStatus() {
- $form = new UserLabelForm();
- $form->attributes = post_params();
- $form->store_id = get_store_id();
- return $this->asJson($form->setStatus());
- }
- //获取无页码的标签
- public function actionGetUserLabel() {
- $store_id = get_store_id();
- return $this->asJson([
- 'code' => 0,
- 'msg' => '',
- 'data' => UserLabel::getList($store_id)
- ]);
- }
- }
|