SetAuthController.php 988 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace pt\controllers;
  3. use bizHd\saas\services\SetAuthService;
  4. use Yii;
  5. use common\components\util;
  6. class SetAuthController extends BaseController
  7. {
  8. //套餐列表 ssh 2019.12.8
  9. public function actionUpdate()
  10. {
  11. $post = Yii::$app->request->post();
  12. $setId = isset($post['setId']) ? $post['setId'] : 0;
  13. $endId = isset($post['endId']) ? $post['endId'] : 0;
  14. $auth = isset($post['auth']) ? $post['auth'] : '*';
  15. SetAuthService::updateByCondition(['setId' => $setId, 'endId' => $endId], ['auth' => $auth]);
  16. util::complete('修改成功');
  17. }
  18. public function actionDetail()
  19. {
  20. $get = Yii::$app->request->get();
  21. $setId = isset($get['setId']) ? $get['setId'] : 0;
  22. $endId = isset($get['endId']) ? $get['endId'] : 0;
  23. $return = SetAuthService::getByCondition(['setId' => $setId, 'endId' => $endId]);
  24. $authList = [];
  25. if (isset($return['auth']) && !empty($return['auth'])) {
  26. $authList = explode(',', $return['auth']);
  27. }
  28. util::success($authList);
  29. }
  30. }