Withdraw.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace addons\withdraw;
  3. use app\common\library\Menu;
  4. use think\Addons;
  5. use think\Request;
  6. /**
  7. * 余额提现插件
  8. */
  9. class Withdraw extends Addons
  10. {
  11. /**
  12. * 插件安装方法
  13. * @return bool
  14. */
  15. public function install()
  16. {
  17. $menu = [
  18. [
  19. 'name' => 'user/withdraw',
  20. 'title' => '会员提现管理',
  21. 'icon' => 'fa fa-money',
  22. 'sublist' => [
  23. ['name' => 'user/withdraw/index', 'title' => '查看'],
  24. ['name' => 'user/withdraw/add', 'title' => '添加'],
  25. ['name' => 'user/withdraw/edit', 'title' => '修改'],
  26. ['name' => 'user/withdraw/del', 'title' => '删除'],
  27. ['name' => 'user/withdraw/multi', 'title' => '批量更新'],
  28. ]
  29. ]
  30. ];
  31. Menu::create($menu, 'user');
  32. return true;
  33. }
  34. /**
  35. * 插件卸载方法
  36. * @return bool
  37. */
  38. public function uninstall()
  39. {
  40. Menu::delete('user/withdraw');
  41. return true;
  42. }
  43. /**
  44. * 插件启用方法
  45. * @return bool
  46. */
  47. public function enable()
  48. {
  49. Menu::enable('user/withdraw');
  50. return true;
  51. }
  52. /**
  53. * 插件禁用方法
  54. * @return bool
  55. */
  56. public function disable()
  57. {
  58. Menu::disable('user/withdraw');
  59. return true;
  60. }
  61. /**
  62. * 会员中心边栏后
  63. * @return mixed
  64. * @throws \Exception
  65. */
  66. public function userSidenavAfter()
  67. {
  68. $request = Request::instance();
  69. $actionname = strtolower($request->action());
  70. $data = [
  71. 'actionname' => $actionname
  72. ];
  73. return $this->fetch('view/hook/user_sidenav_after', $data);
  74. }
  75. }