getOtherState($param); //其他支付是否开启 if ($otherStateResult['status'] != 1) { return $otherStateResult; } if (!empty($param['id'])) { $infoResult = $this->basisIdGetInfo([ 'merchant_id' => $param['merchant_id'], 'id' => $param['id'] ]); return $infoResult; } else { return callBack(statusCode()['success'], "未设置其他支付详情", []); } } /** * 依据id获取信息 * @param $param * [ * merchant_id * id 其他支付id * ] * @return mixed */ public function basisIdGetInfo($param) { if (empty($param['merchant_id']) || empty($param['id'])) { return callBack(statusCode()['error'], "缺少必要参数"); } try { $OtherPayModel = new RetailOtherPayModel(); $where = [ 'state' => 1, 'status' => 1, 'id' => $param['id'], 'merchant_id' => $param['merchant_id'] ]; $otherPay = $OtherPayModel->getFind($where); if (empty($otherPay)) { return callBack(statusCode()['error'], "该支付方式不存在"); } else { return callBack(statusCode()['success'], "查询成功", $otherPay); } } catch (\Exception $e) { return callBack(statusCode()['error'], "该支付方式不存在"); } } /** * 查询商户是否开启其他支付 * @param $param * [ * merchant_id * ] * @return mixed */ public function getOtherState($param) { try { $MerchantConfigModel = new RetailMerchantConfigModel(); $merchantSet = $MerchantConfigModel->getFind(['merchant_id' => $param['merchant_id']]); if (!empty($merchantSet) && $merchantSet['other_pay'] != 1) { return callBack(statusCode()['error'], "商家已关闭其他支付,请重新登录"); }else{ return callBack(statusCode()['success'], "开启", $merchantSet); } } catch (\Exception $e) { return callBack(statusCode()['error'], "商家已关闭其他支付,请重新登录"); } } }