ShopController.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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\ShopService;
  13. /**
  14. * 店铺管理-控制器
  15. * @author laravel开发员
  16. * @since 2020/11/11
  17. * Class ShopController
  18. * @package App\Http\Controllers
  19. */
  20. class ShopController extends Backend
  21. {
  22. /**
  23. * 构造函数
  24. * @author laravel开发员
  25. * @since 2020/11/11
  26. * ShopController constructor.
  27. */
  28. public function __construct()
  29. {
  30. parent::__construct();
  31. $this->service = new ShopService();
  32. }
  33. public function index()
  34. {
  35. $pageSize = request()->get('limit', 15);
  36. $list = $this->service->getDataList(request()->all(), $pageSize);
  37. $message = array(
  38. "msg" => '操作成功',
  39. "code" => 0,
  40. "data" => isset($list['list'])? $list['list']:[],
  41. "count" => isset($list['total'])? $list['total']:0,
  42. );
  43. return $message;
  44. }
  45. /**
  46. * 获取推荐人
  47. * @return mixed
  48. */
  49. public function parents(){
  50. $result = $this->service->parents();
  51. return message(1002,true, $result);
  52. }
  53. /**
  54. * 选项列表
  55. * @return mixed
  56. */
  57. public function options(){
  58. $result = $this->service->options();
  59. return message(1002,true, $result);
  60. }
  61. }