ShopController.php 1.7 KB

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