objMMerchantWithdraw = new MMerchantWithdraw($this->onlineEnterpriseId,$this->onlineUserId); } /** * Doc: (des="商户结算页面数据") * User: XMing * Date: 2020/12/8 * Time: 11:44 上午 */ public function get() { $objMMerchant = new MMerchant($this->onlineEnterpriseId,$this->onlineUserId); $modelResult = $objMMerchant->getWithdraw($this->shopId); if(!$modelResult->isSuccess()){ parent::sendOutput($modelResult->getData(), $modelResult->getErrorCode()); } parent::sendOutput($modelResult->getData()); } /** * 添加提现记录 * @throws \Exception */ public function add() { $paramsData = $this->request->getRawJson(); $params = [ 'merchantId' => getArrayItem($paramsData,'merchantId',''), 'type' => isset($paramsData['type']) ? $paramsData['type'] : '', 'accountContent' => isset($paramsData['accountContent']) ? $paramsData['accountContent'] : '', 'money' => isset($paramsData['money']) ? $paramsData['money'] : '', 'orderNum' => isset($paramsData['orderNum']) ? $paramsData['orderNum'] : null, //'nowMoney' => isset($paramsData['nowMoney']) ? $paramsData['nowMoney'] : '', 'createTime' => time(), 'updateTime' => time(), ]; foreach ($params as $k => $v) { if (empty($v) && $v !== 0) { parent::sendOutput($k . '参数错误', ErrorCode::$paramError); } } $merchantId = $params['merchantId']; unset($params['merchantId']); $result = $this->objMMerchantWithdraw->add($params,$merchantId); if ($result->isSuccess()) { parent::sendOutput($result->getData()); } parent::sendOutput($result->getData(), $result->getErrorCode()); } /** * Doc: (des="更新提现记录状态") * User: XMing * Date: 2020/12/8 * Time: 3:55 下午 * @throws \Exception */ public function updateAuditStatus() { $id = $this->request->param('request_id'); if (!$id) { parent::sendOutput('请指定要审核的数据id', ErrorCode::$paramError); } $status = $this->request->param('status'); if(!$status){ parent::sendOutput('请指定要修改的状态', ErrorCode::$paramError); } $result = $this->objMMerchantWithdraw->updateAuditStatus($id,$status); if ($result->isSuccess()) { parent::sendOutput($result->getData()); } parent::sendOutput($result->getData(), ErrorCode::$dberror); } /** * Doc: (des="提现记录") * User: XMing * Date: 2020/12/8 * Time: 3:54 下午 */ public function getAll() { $params = $this->request->getRawJson(); if (empty($params)) { $this->sendOutput('参数为空', ErrorCode::$paramError); } $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10); $params['limit'] = $pageParams['limit']; $params['offset'] = $pageParams['offset']; $params['merchantId'] = getArrayItem($params,'merchantId',""); $params['type'] = getArrayItem($params,'type',""); $params['auditStatus'] = getArrayItem($params,'auditStatus',""); $params['startTime'] = getArrayItem($params,'startTime',""); $params['end'] = getArrayItem($params,'end',""); $params['no'] = getArrayItem($params,'no',""); $result = $this->objMMerchantWithdraw->getAll($params); if ($result->isSuccess()) { $returnData = $result->getData(); $pageData = [ 'pageIndex' => getArrayItem($params,'page',1), 'pageSize' => getArrayItem($params,'pageSize',10), 'pageTotal' => $returnData['total'], ]; parent::sendOutput($returnData['data'], 0, $pageData); } parent::sendOutput($result->getData(), ErrorCode::$dberror); } }