123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace JinDouYun\Controller\Order;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\Order\MSupplierOrderDetails;
- use Mall\Framework\Core\ErrorCode;
- use Mall\Framework\Core\ResultWrapper;
- use Mall\Framework\Core\StatusCode;
- class SupplierOrder extends BaseController
- {
- /**
- * @var MSupplierOrderDetails
- */
- private $objMSupplierOrderDetails;
- /**
- * SupplierOrder 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->objMSupplierOrderDetails = new MSupplierOrderDetails($this->onlineEnterpriseId,$this->onlineUserId);
- }
- /**
- * Doc: (des="")
- * User: XMing
- * Date: 2020/12/22
- * Time: 5:20 下午
- */
- public function getAll()
- {
- $params = $this->request->getRawJson();
- $page = getArrayItem($params,'page',1);
- $pageSize = getArrayItem($params,'pageSize',10);
- $pageParams = pageToOffset($page, $pageSize);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- !empty($this->supplierId) && $params['supplierId'] = $this->supplierId;
- $params['auditStatus'] = StatusCode::$auditStatus['auditPass'];
- $result = $this->objMSupplierOrderDetails->getAll($params);
- if ($result->isSuccess()) {
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $page,
- 'pageSize' => $pageSize,
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- /**
- * Doc: (des="")
- * User: XMing
- * Date: 2020/12/22
- * Time: 6:14 下午
- * @throws \Exception
- */
- public function get()
- {
- $id = $this->request->param('request_id');
- if (empty($id)) {
- parent::sendOutput('id参数错误', ErrorCode::$paramError);
- }
- $result = $this->objMSupplierOrderDetails->get($id);
- if (!$result->isSuccess()) {
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
- }
|