123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace JinDouYun\Controller\Commission;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\Commission\MCommissionOrder;
- use Mall\Framework\Core\ErrorCode;
- /**
- * Description:
- * Class CommissionOrder
- * @package JinDouYun\Controller\Commission
- */
- class CommissionOrder extends BaseController
- {
- /**
- * @var MCommissionOrder
- */
- private $objMCommissionOrder;
- /**
- * CommissionOrder constructor.
- * @param bool $isCheckAcl
- * @param bool $isMustLogin
- * @param bool $checkToken
- * @param bool $getAreaCode
- * @throws \Exception
- */
- public function __construct($isCheckAcl = true, $isMustLogin = true, $checkToken = true, $getAreaCode = false)
- {
- parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
- $this->objMCommissionOrder = new MCommissionOrder($this->onlineEnterpriseId,$this->onlineUserId);
- }
- /**
- * Doc: (des="获取分销订单")
- * User: XMing
- * Date: 2020/7/24
- * Time: 4:26 下午
- */
- public function getAll()
- {
- $params = $this->request->getRawJson();
- $page = isset($params['page']) ? $params['page'] : 1;
- $pageSize = isset($params['pageSize']) ? $params['pageSize'] : 10;
- $offset = ($page - 1) * $pageSize;
- $params['limit'] = $pageSize;
- $params['offset'] = $offset;
- $dbResult = $this->objMCommissionOrder->getAll($params);
- if ($dbResult->isSuccess()) {
- $returnData = $dbResult->getData();
- $pageData = [
- 'pageIndex' => $page,
- 'pageSize' => $pageSize,
- 'pageTotal' => $returnData['total']
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- parent::sendOutput($dbResult->getData(), ErrorCode::$dberror);
- }
- }
|