本帖最后由 ss668888 于 2021-11-9 02:44 编辑
综合整理了下安装反馈,修复了部分功能,相关的配置文件也打包在新的项目文件里了,只需手动将网站目录定向到public目录下即可
蓝奏云:https://wwa.lanzoui.com/iB5RMwb4h1a 主题的包不要再下载了,已经下载部署上去的只需将application/modules/Member/controllers/Pay.php下payajax函数替换成以下代码即可,已经部署成功无需再替换其他文件
[PHP] 纯文本查看 复制代码 public function payajaxAction()
{
if ($this->login==FALSE AND !$this->userid) {
$this->redirect("/member/login");
return FALSE;
}
$price = $this->getPost('price');
$paymethod = $this->getPost('paymethod');
if($price AND is_numeric($price) AND $price>0 AND $paymethod AND isset($paymethod)){
$payments = $this->m_payment->getConfig();
if(isset($payments[$paymethod]) AND !empty($payments[$paymethod])){
$payconfig = $payments[$paymethod];
if($payconfig['active']>0){
$user = $this->m_user->SelectByID('username',$this->userid);
//生成充值订单
$prefix = isset($this->config['orderprefix'])?$this->config['orderprefix']:'lwapi';
$orderid = $prefix. date('Y') . date('m') . date('d') . date('H') . date('i') . date('s') . mt_rand(10000, 99999);
try{
$payclass = "\\Pay\\".$paymethod."\\".$paymethod;
$PAY = new $payclass();
$params =array('orderid'=>$orderid,'money'=>$price,'webname'=>$this->config['webname'],'weburl'=>$this->config['weburl'],'qrserver'=>$this->config['qrserver'],'productname'=>$this->config['webname'].'余额充值');
$data = $PAY->pay($payconfig,$params);
} catch (\Exception $e) {
$data = array('code' => 1005, 'msg' => $e->getMessage());
}
if($data['code'] == 1){
$order = [
'username'=>$user['username'],
'oid'=>$orderid,
'price'=>$price,
'status'=>0,
'payment'=>$paymethod,
'addtime'=>time()
];
$u = $this->m_buypay->Insert($order);
if(!$u) $data = array('code' => 1003, 'msg' => '充值订单创建失败,请重试');
}
}else{
$data = array('code' => 1002, 'msg' => '支付渠道已关闭');
}
}else{
$data = array('code' => 1001, 'msg' => '支付渠道异常');
}
}else {
$data = array('code' => 1000, 'msg' => '丢失参数');
}
Helper::response($data);
}
|