YunSwitchController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: weifeng
  5. * Date: 2021-03-29
  6. * Time: 14:42
  7. *
  8. * .--, .--,
  9. * ( ( \.---./ ) )
  10. * '.__/o o\__.'
  11. * {= ^ =}
  12. * > - <
  13. * / \
  14. * // \\
  15. * //| . |\\
  16. * "'\ /'"_.-~^`'-.
  17. * \ _ /--' `
  18. * ___)( )(___
  19. * (((__) (__))) 梦之所想,心之所向.
  20. */
  21. namespace app\platform\controllers;
  22. use app\common\models\Option;
  23. use app\common\models\SwitchModel;
  24. class YunSwitchController extends BaseController
  25. {
  26. public function index()
  27. {
  28. $switch = SwitchModel::where('switch_platform', 1)->first();
  29. if ($switch) {
  30. $plugin_is_open = Option::where(['uniacid'=>$switch->uniacid,'option_name'=>'yun-sign'])->first();
  31. if (!$plugin_is_open || $plugin_is_open->enabled == 0) {
  32. return $this->errorJson('指定平台芸签插件未开启');
  33. }
  34. return $this->successJson('ok', [
  35. 'uniacid' => $switch->uniacid,
  36. ]);
  37. } else {
  38. return $this->errorJson('无平台开启功能');
  39. }
  40. }
  41. }