CommissionOrder.Class.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace JinDouYun\Controller\Commission;
  3. use JinDouYun\Controller\BaseController;
  4. use JinDouYun\Model\Commission\MCommissionOrder;
  5. use Mall\Framework\Core\ErrorCode;
  6. /**
  7. * Description:
  8. * Class CommissionOrder
  9. * @package JinDouYun\Controller\Commission
  10. */
  11. class CommissionOrder extends BaseController
  12. {
  13. /**
  14. * @var MCommissionOrder
  15. */
  16. private $objMCommissionOrder;
  17. /**
  18. * CommissionOrder constructor.
  19. * @param bool $isCheckAcl
  20. * @param bool $isMustLogin
  21. * @param bool $checkToken
  22. * @param bool $getAreaCode
  23. * @throws \Exception
  24. */
  25. public function __construct($isCheckAcl = true, $isMustLogin = true, $checkToken = true, $getAreaCode = false)
  26. {
  27. parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
  28. $this->objMCommissionOrder = new MCommissionOrder($this->onlineEnterpriseId,$this->onlineUserId);
  29. }
  30. /**
  31. * Doc: (des="获取分销订单")
  32. * User: XMing
  33. * Date: 2020/7/24
  34. * Time: 4:26 下午
  35. */
  36. public function getAll()
  37. {
  38. $params = $this->request->getRawJson();
  39. $page = isset($params['page']) ? $params['page'] : 1;
  40. $pageSize = isset($params['pageSize']) ? $params['pageSize'] : 10;
  41. $offset = ($page - 1) * $pageSize;
  42. $params['limit'] = $pageSize;
  43. $params['offset'] = $offset;
  44. $dbResult = $this->objMCommissionOrder->getAll($params);
  45. if ($dbResult->isSuccess()) {
  46. $returnData = $dbResult->getData();
  47. $pageData = [
  48. 'pageIndex' => $page,
  49. 'pageSize' => $pageSize,
  50. 'pageTotal' => $returnData['total']
  51. ];
  52. parent::sendOutput($returnData['data'], 0, $pageData);
  53. }
  54. parent::sendOutput($dbResult->getData(), ErrorCode::$dberror);
  55. }
  56. }