123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?php
- namespace JInDouYun\Controller\Cashier;
- use JinDouYun\Controller\BaseController;
- use JinDouYun\Model\Cashier\MCashierPushMoneyDetail;
- use Mall\Framework\Core\ErrorCode;
- class PushMoney extends BaseController
- {
-
- private $objMCashierPushMoneyDetail;
-
- public function __construct($isCheckAcl = false, $isMustLogin = true, $checkToken = true, $getAreaCode = false)
- {
- parent::__construct($isCheckAcl, $isMustLogin, $checkToken, $getAreaCode);
- $this->objMCashierPushMoneyDetail = new MCashierPushMoneyDetail($this->onlineUserId,$this->onlineEnterpriseId);
- }
-
- public function getAll()
- {
- $params = $this->request->getRawJson();
- if (empty($params)) {
- parent::sendOutput('参数为空', ErrorCode::$paramError);
- }
- if (!isset($params['pushType']) || empty($params['pushType'])){
- parent::sendOutput('pushType参数错误',ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCashierPushMoneyDetail->getAll($params);
- if (!$result->isSuccess()) {
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
-
- public function getRecordList()
- {
- $params = $this->request->getRawJson();
- if (empty($params)) {
- parent::sendOutput('参数为空', ErrorCode::$paramError);
- }
- $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
- $params['limit'] = $pageParams['limit'];
- $params['offset'] = $pageParams['offset'];
- $result = $this->objMCashierPushMoneyDetail->getRecordList($params);
- if (!$result->isSuccess()) {
- parent::sendOutput($result->getData(), $result->getErrorCode());
- }
- $returnData = $result->getData();
- $pageData = [
- 'pageIndex' => $params['page'],
- 'pageSize' => $params['pageSize'],
- 'pageTotal' => $returnData['total'],
- ];
- parent::sendOutput($returnData['data'], 0, $pageData);
- }
-
- public function getRecordInfo()
- {
- $id = $this->request->param('request_id');
- if (empty($id)){
- parent::sendOutput('id参数错误',ErrorCode::$paramError);
- }
- $result = $this->objMCashierPushMoneyDetail->getRecordInfo($id);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
-
- public function connectDetails()
- {
- $shopId = $this->request->param('shopId');
- if (empty($shopId)){
- parent::sendOutput('shopId参数错误',ErrorCode::$paramError);
- }
- $result = $this->objMCashierPushMoneyDetail->connectDetails($shopId);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
-
- public function confirmConnect()
- {
- $id = $this->request->param('request_id');
- if (empty($id)){
- parent::sendOutput('缺少id参数',ErrorCode::$paramError);
- }
- $offDutyTime = $this->request->param('offDutyTime');
- if (empty($offDutyTime) || !is_numeric($offDutyTime)){
- parent::sendOutput('offDutyTime参数错误',ErrorCode::$paramError);
- }
- $remark = $this->request->param('remark');
- $result = $this->objMCashierPushMoneyDetail->confirmConnect($id,$offDutyTime,$remark);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
-
- public function loggerConnect()
- {
- $params = $this->request->getRawJson();
-
- if (!isset($params['shopId']) || empty($params['shopId'])){
- parent::sendOutput('shopId参数错误',ErrorCode::$paramError);
- }
- $result = $this->objMCashierPushMoneyDetail->loggerConnect($params);
- if (!$result->isSuccess()){
- parent::sendOutput($result->getData(),$result->getErrorCode());
- }
- parent::sendOutput($result->getData());
- }
- }
|