YunSwitchController.php 1.2 KB

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