12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace JinDouYun\Controller\Market;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\Market\MComBinPackage;
- use Mall\Framework\Core\ErrorCode;
- /**
- * @copyright Copyright (c) https://www.qianniaovip.com All rights reserved
- * Description:
- * Class ApiComBinPackage
- * @package JinDouYun\Controller\Market
- */
- class ApiComBinPackage extends BaseController
- {
- private $objMComBinPackage;
- /**
- * ApiComBinPackage constructor.
- * @param bool $isCheckAcl
- * @param false $isMustLogin
- * @param bool $checkToken
- * @param false $getAreaCode
- * @param bool $checkShopToken
- * @param bool $checkSupplierToken
- * @throws \Exception
- */
- public function __construct($isCheckAcl = true, $isMustLogin = false, $checkToken = true, $getAreaCode = false, $checkShopToken = true, $checkSupplierToken = true)
- {
- parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode, $checkShopToken, $checkSupplierToken);
- $this->objMComBinPackage = new MComBinPackage($this->onlineEnterpriseId,$this->onlineUserId);
- }
- /**
- * Doc: (des="")
- * User: XMing
- * Date: 2021/1/22
- * Time: 10:25 上午
- * @throws \Exception
- */
- public function lists()
- {
- $params = $this->request->getRawJson();
- $pageParams = pageToOffset(isset($params['page']) ? $params['page'] : 1, isset($params['pageSize']) ? $params['pageSize'] : 10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMComBinPackage->lists($params);
- if ($result->isSuccess()) {
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => isset($params['page']) ? $params['page'] : 1,
- 'pageSize' => isset($params['pageSize']) ? $params['pageSize'] : 10,
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- /**
- * Doc: (des="组合套餐详情")
- * User: XMing
- * Date: 2021/1/22
- * Time: 1:00 下午
- * @throws \Exception
- */
- public function details()
- {
- $id = $this->request->param('request_id');
- if (empty($id)) {
- $this->sendOutput('参数错误', ErrorCode::$paramError );
- }
- $result = $this->objMComBinPackage->details($id);
- if($result->isSuccess()){
- $this->sendOutput($result->getData());
- }
- $this->sendOutput($result->getData(), $result->getErrorCode());
- }
- }
|