TradeOrderController.php 2.1 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\Models\TradeOrderModel;
  13. use App\Services\Common\TradeOrderService;
  14. /**
  15. * 交易订单控制器
  16. * Class TradeOrderController
  17. * @package App\Http\Controllers\Admin
  18. */
  19. class TradeOrderController extends Backend
  20. {
  21. /**
  22. * 构造函数
  23. * TradeOrderController constructor.
  24. */
  25. public function __construct()
  26. {
  27. $this->model = new TradeOrderModel();
  28. $this->service = new TradeOrderService();
  29. parent::__construct();
  30. }
  31. public function index()
  32. {
  33. $params = request()->all();
  34. $pageSize = request()->post('pageSize', 15);
  35. if($this->userInfo['user_type'] == 2){
  36. $params['business_id'] = $this->userInfo['user_id'];
  37. }
  38. $list = TradeOrderService::make()->getDataList($params,$pageSize);
  39. $message = array(
  40. "msg" => '操作成功',
  41. "code" => 0,
  42. "data" => isset($list['list'])? $list['list']:[],
  43. "count" => isset($list['total'])? $list['total']:0,
  44. );
  45. return $message;
  46. }
  47. public function business()
  48. {
  49. $params = request()->all();
  50. $pageSize = request()->post('pageSize', 15);
  51. $params['business_id'] = $this->userInfo['user_id'];
  52. $list = TradeOrderService::make()->getDataList($params,$pageSize);
  53. $message = array(
  54. "msg" => '操作成功',
  55. "code" => 0,
  56. "data" => isset($list['list'])? $list['list']:[],
  57. "count" => isset($list['total'])? $list['total']:0,
  58. );
  59. return $message;
  60. }
  61. }