MemberController.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Http\Controllers\Admin;
  12. use App\Services\Common\MemberService;
  13. /**
  14. * 会员管理-控制器
  15. * @author laravel开发员
  16. * @since 2020/11/11
  17. * Class MemberController
  18. * @package App\Http\Controllers
  19. */
  20. class MemberController extends Backend
  21. {
  22. /**
  23. * 构造函数
  24. * @author laravel开发员
  25. * @since 2020/11/11
  26. * MemberController constructor.
  27. */
  28. public function __construct()
  29. {
  30. parent::__construct();
  31. $this->service = new MemberService();
  32. }
  33. /**
  34. * 列表
  35. * @return array
  36. */
  37. public function index()
  38. {
  39. $pageSize = request()->get('limit', 15);
  40. $params = request()->all();
  41. if($this->userInfo['user_type'] != 1){
  42. $params['admin_uid'] = $this->userId;
  43. }
  44. $list = $this->service->getDataList($params, $pageSize);
  45. $message = array(
  46. "msg" => '操作成功',
  47. "code" => 0,
  48. "data" => isset($list['list'])? $list['list']:[],
  49. "count" => isset($list['total'])? $list['total']:0,
  50. );
  51. return $message;
  52. }
  53. public function edit()
  54. {
  55. $result = $this->service->edit($this->userId);
  56. if(isset($result['success']) && $result['success']){
  57. return message('操作成功');
  58. }else{
  59. return $result;
  60. }
  61. }
  62. }