CogController.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020-09-10
  6. * Time: 9:05
  7. */
  8. namespace app\back\controller;
  9. use cmf\controller\AdminBaseController;
  10. class CogController extends AdminBaseController
  11. {
  12. /**
  13. * @return mixed
  14. * 微信支付
  15. */
  16. public function wx()
  17. {
  18. $info = cmf_get_option('wxpay');
  19. if($this->request->isPost()){
  20. $data = $this->request->param();
  21. cmf_set_option('wxpay',$data,false);
  22. $this->success('保存成功');
  23. }
  24. $this->assign($info);
  25. return $this->fetch();
  26. }
  27. /**
  28. * 技师端
  29. */
  30. /**
  31. * @return mixed
  32. * 支付宝支付配置
  33. */
  34. public function aly()
  35. {
  36. $info = cmf_get_option('alipay');
  37. if($this->request->isPost()){
  38. $data = $this->request->param();
  39. cmf_set_option('alipay',$data,false);
  40. $this->success('保存成功');
  41. }
  42. $this->assign($info);
  43. return $this->fetch();
  44. }
  45. /**
  46. * @return mixed
  47. * 阿里云短信配置
  48. */
  49. public function alysms()
  50. {
  51. $info = cmf_get_option('alisms');
  52. if($this->request->isPost()){
  53. $data = $this->request->param();
  54. cmf_set_option('alisms',$data,false);
  55. $this->success('保存成功');
  56. }
  57. $this->assign($info);
  58. return $this->fetch();
  59. }
  60. /**
  61. * 极光推送配置
  62. */
  63. public function jspus()
  64. {
  65. $info = cmf_get_option('jspus');
  66. if($this->request->isPost()){
  67. $data = $this->request->param();
  68. cmf_set_option('jspus',$data,false);
  69. $this->success('保存成功');
  70. }
  71. $this->assign($info);
  72. return $this->fetch();
  73. }
  74. public function xiadan()
  75. {
  76. $info = cmf_get_option('xiadan');
  77. if($this->request->isPost()){
  78. $data = $this->request->param();
  79. cmf_set_option('xiadan',$data,false);
  80. $this->success('保存成功');
  81. }
  82. $this->assign($info);
  83. return $this->fetch();
  84. }
  85. public function jiedan()
  86. {
  87. $info = cmf_get_option('jiedan');
  88. if($this->request->isPost()){
  89. $data = $this->request->param();
  90. cmf_set_option('jiedan',$data,false);
  91. $this->success('保存成功');
  92. }
  93. $this->assign($info);
  94. return $this->fetch();
  95. }
  96. /**
  97. * @return mixed
  98. * @throws \think\Exception
  99. * @throws \think\db\exception\DataNotFoundException
  100. * @throws \think\db\exception\ModelNotFoundException
  101. * @throws \think\exception\DbException
  102. * @throws \think\exception\PDOException
  103. * 接单距离设置
  104. */
  105. public function distance()
  106. {
  107. $info = cmf_get_option('distance');
  108. if($this->request->isPost()){
  109. $data = $this->request->param();
  110. cmf_set_option('distance',$data,false);
  111. $this->success('保存成功');
  112. }
  113. $this->assign($info);
  114. return $this->fetch();
  115. }
  116. /**
  117. * @return mixed
  118. * @throws \think\Exception
  119. * @throws \think\db\exception\DataNotFoundException
  120. * @throws \think\db\exception\ModelNotFoundException
  121. * @throws \think\exception\DbException
  122. * @throws \think\exception\PDOException
  123. * 下载设置
  124. */
  125. public function dow()
  126. {
  127. $info = cmf_get_option('dow');
  128. if($this->request->isPost()){
  129. $data = $this->request->param();
  130. cmf_set_option('dow',$data,false);
  131. $this->success('保存成功');
  132. }
  133. $this->assign($info);
  134. return $this->fetch();
  135. }
  136. /**
  137. * 订单自动取消时长
  138. */
  139. public function duration()
  140. {
  141. $info = cmf_get_option('duration');
  142. if($this->request->isPost()){
  143. $data = $this->request->param();
  144. cmf_set_option('duration',$data,false);
  145. $this->success('保存成功');
  146. }
  147. $this->assign($info);
  148. return $this->fetch();
  149. }
  150. }