@@ -207,8 +207,17 @@ else if ($dopost == "memberlogin") { | |||||
$nid = explode(',', $nid); | $nid = explode(',', $nid); | ||||
if (is_array($nid)) { | if (is_array($nid)) { | ||||
foreach ($nid as $var) { | foreach ($nid as $var) { | ||||
$query = "UPDATE `#@__member_operation` SET sta = '2' WHERE aid = '$var'"; | |||||
$dsql->ExecuteNoneQuery($query); | |||||
$moRow = $dsql->GetOne("SELECT * FROM `#@__member_operation` WHERE aid='$var'"); | |||||
if ($moRow['sta'] == 1) { | |||||
if ($moRow['product'] === "card") { | |||||
//点卡 | |||||
$proRow = $dsql->GetOne("SELECT * FROM `#@__moneycard_type` WHERE tid={$moRow['pid']}"); | |||||
$query = "UPDATE `#@__member` SET money = money+{$proRow['num']} WHERE mid = '{$moRow['mid']}'"; | |||||
$dsql->ExecuteNoneQuery($query); | |||||
} | |||||
$query = "UPDATE `#@__member_operation` SET sta = '2' WHERE aid = '$var'"; | |||||
$dsql->ExecuteNoneQuery($query); | |||||
} | |||||
ShowMsg("设置成功", "member_operations.php"); | ShowMsg("设置成功", "member_operations.php"); | ||||
exit(); | exit(); | ||||
} | } | ||||
@@ -33,14 +33,14 @@ if ($dopost === "get_payments") { | |||||
foreach($config as $key => $item) { | foreach($config as $key => $item) { | ||||
$status = 0; | $status = 0; | ||||
$sortrank = 0; | $sortrank = 0; | ||||
$configItem = array(); | |||||
$configItem = new stdClass; | |||||
foreach($item as $kk => $ii) { | foreach($item as $kk => $ii) { | ||||
if ($kk === "Enabled") { | if ($kk === "Enabled") { | ||||
$status = $ii === true ? 1 : 0; | $status = $ii === true ? 1 : 0; | ||||
} else if ($kk === "Sortrank") { | } else if ($kk === "Sortrank") { | ||||
$sortrank = intval($ii); | $sortrank = intval($ii); | ||||
} else { | } else { | ||||
$configItem[$kk] = $ii; | |||||
$configItem->$kk = $ii; | |||||
} | } | ||||
} | } | ||||
$cfg = json_encode($configItem); | $cfg = json_encode($configItem); | ||||
@@ -100,8 +100,8 @@ | |||||
<tr> | <tr> | ||||
<td colspan="8"> | <td colspan="8"> | ||||
<button type="button" onclick="ReSel();" class="btn btn-success btn-sm">反选</button> | <button type="button" onclick="ReSel();" class="btn btn-success btn-sm">反选</button> | ||||
<button type="button" onclick="UpSel();" class="btn btn-success btn-sm">设为已付款状态</button> | |||||
<button type="button" onclick="OkSel();" class="btn btn-success btn-sm">设为已完成状态</button> | |||||
<button type="button" onclick="UpSel();" class="btn btn-success btn-sm">设为已付款</button> | |||||
<button type="button" onclick="OkSel();" class="btn btn-success btn-sm">设为已完成</button> | |||||
<button type="button" onclick="DelSel();" class="btn btn-danger btn-sm">删除</button> | <button type="button" onclick="DelSel();" class="btn btn-danger btn-sm">删除</button> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
@@ -10,6 +10,7 @@ require_once(dirname(__FILE__).'/config.php'); | |||||
CheckRank(0, 0); | CheckRank(0, 0); | ||||
$menutype = 'mydede'; | $menutype = 'mydede'; | ||||
$menutype_son = 'op'; | $menutype_son = 'op'; | ||||
$_menu_buy = true; | |||||
$myurl = $cfg_basehost.$cfg_member_dir.'/index.php?uid='.$cfg_ml->M_LoginID; | $myurl = $cfg_basehost.$cfg_member_dir.'/index.php?uid='.$cfg_ml->M_LoginID; | ||||
$moneycards = ''; | $moneycards = ''; | ||||
$membertypes = ''; | $membertypes = ''; | ||||
@@ -8,6 +8,7 @@ | |||||
*/ | */ | ||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
CheckRank(0, 0); | CheckRank(0, 0); | ||||
$dopost = isset($dopost)? $dopost : ''; | |||||
$menutype = 'mydede'; | $menutype = 'mydede'; | ||||
$menutype_son = 'op'; | $menutype_son = 'op'; | ||||
require_once DEDEINC.'/dedetemplate.class.php'; | require_once DEDEINC.'/dedetemplate.class.php'; | ||||
@@ -18,6 +19,21 @@ $pname = ''; | |||||
$price = ''; | $price = ''; | ||||
$mtime = time(); | $mtime = time(); | ||||
$paytype = isset($paytype)? intval($paytype) : 0; | $paytype = isset($paytype)? intval($paytype) : 0; | ||||
if ($dopost === "bank_ok") { | |||||
$moRow = $dsql->GetOne("SELECT * FROM `#@__member_operation` WHERE buyid='$buyid' AND mid={$mid}"); | |||||
if (empty($moRow)) { | |||||
ShowMsg("订单查询错误,请确保是您自己发起的订单", "javascript:;"); | |||||
exit; | |||||
} | |||||
if ($moRow['sta'] == 2) { | |||||
ShowMsg("已完成支付,无需重复付款", "javascript:;"); | |||||
exit; | |||||
} | |||||
$query = "UPDATE `#@__member_operation` SET sta = '1' WHERE buyid = '{$moRow['buyid']}'"; | |||||
$dsql->ExecuteNoneQuery($query); | |||||
ShowMsg("已经完成付款,等待管理员审核", "operation.php"); | |||||
exit; | |||||
} | |||||
if (isset($pd_encode) && isset($pd_verify) && md5("payment".$pd_encode.$cfg_cookie_encode) == $pd_verify) { | if (isset($pd_encode) && isset($pd_verify) && md5("payment".$pd_encode.$cfg_cookie_encode) == $pd_verify) { | ||||
$result = json_decode(mchStrCode($pd_encode, 'DECODE')); | $result = json_decode(mchStrCode($pd_encode, 'DECODE')); | ||||
$product = preg_replace("#[^0-9a-z]#i", "", $result->product); | $product = preg_replace("#[^0-9a-z]#i", "", $result->product); | ||||
@@ -102,7 +118,56 @@ if ($paytype === 0) { | |||||
ShowMsg("已完成支付,无需重复付款", "javascript:;"); | ShowMsg("已完成支付,无需重复付款", "javascript:;"); | ||||
exit; | exit; | ||||
} | } | ||||
if($paytype === 4) { | |||||
if($paytype === 1) { | |||||
//微信支付 | |||||
include_once(DEDEINC.'/sdks/include.php'); | |||||
$pInfo = $dsql->GetOne("SELECT * FROM `#@__sys_payment` WHERE id = $paytype"); | |||||
$pData = (array)json_decode($pInfo['config']); | |||||
$config = array( | |||||
"appid" => $pData['AppID'], | |||||
"mch_id" => $pData['MchID'], | |||||
"mch_key" => $pData['AppSecret'], | |||||
); | |||||
$wechat = new \WeChat\Pay($config); | |||||
$options = array( | |||||
'product_id' => $buyid, | |||||
'body' => '测试商品', | |||||
'out_trade_no' => time(), | |||||
'total_fee' => '1', | |||||
'trade_type' => 'NATIVE', | |||||
'notify_url' => 'http://a.com/text.html', | |||||
'spbill_create_ip' => '127.0.0.1', | |||||
); | |||||
try { | |||||
// 生成预支付码 | |||||
$result = $wechat->createOrder($options); | |||||
var_dump($result); | |||||
// 创建JSAPI参数签名 | |||||
$options = $wechat->createParamsForRuleQrc($buyid); | |||||
var_dump($options);exit; | |||||
} catch (Exception $e) { | |||||
// 出错啦,处理下吧 | |||||
echo $e->getMessage() . PHP_EOL; | |||||
} | |||||
} elseif ($paytype === 3) { | |||||
include_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
//银行转账 | |||||
$pInfo = $dsql->GetOne("SELECT * FROM `#@__sys_payment` WHERE id = $paytype"); | |||||
$pData = (array)json_decode($pInfo['config']); | |||||
$msg = "请汇款至如下账户:<br><b>账户名:</b>{$pData['AccountName']}<br><b>账号:</b>{$pData['AccountNO']}<br><b>开户行:</b>{$pData['Name']}<br/><b>备注:</b>{$buyid}<br/>如您已经完成转账,请点击下面按钮,等待管理员确认后即可完成充值<br><br><a href='buy_action.php?dopost=bank_ok&buyid={$buyid}' class='btn btn-success btn-sm'>已完成银行转账</a> <a href='operation.php' class='btn btn-outline-success btn-sm'>返回订单管理</a>"; | |||||
$wintitle = "银行转账"; | |||||
$wecome_info = " ";//这个空格不要去 | |||||
$win = new OxWindow(); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(DEDEMEMBER."/templets/win_templet.htm"); | |||||
} elseif ($paytype === 4) { | |||||
//余额付款 | |||||
if ($cfg_ml->M_UserMoney < $row['money']) { | if ($cfg_ml->M_UserMoney < $row['money']) { | ||||
ShowMsg("余额不足,请确保当前账户有足够金币支付", "javascript:;"); | ShowMsg("余额不足,请确保当前账户有足够金币支付", "javascript:;"); | ||||
exit; | exit; | ||||
@@ -115,6 +180,10 @@ if ($paytype === 0) { | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg("成功使用余额付款", "javascript:;"); | ShowMsg("成功使用余额付款", "javascript:;"); | ||||
exit; | exit; | ||||
} elseif ($paytype === 5) { | |||||
//货到付款 | |||||
ShowMsg("虚拟物品,不支持货到付款", "javascript:;"); | |||||
exit; | |||||
} | } | ||||
} | } | ||||
/** | /** | ||||
@@ -151,4 +220,3 @@ function mchStrCode($string, $operation = 'ENCODE') | |||||
} | } | ||||
} | } | ||||
} | } | ||||
?> |
@@ -36,7 +36,7 @@ while ($channel = $dsql->GetArray('addmod')) { | |||||
</div> | </div> | ||||
</li> | </li> | ||||
<li class="list-group-item justify-content-between align-items-center rounded <?php echo (isset($_menu_stow) && $_menu_stow===true)? ' active' : '';?>"><a href="<?php echo $cfg_memberurl;?>/mystow.php">我的收藏</a></li> | <li class="list-group-item justify-content-between align-items-center rounded <?php echo (isset($_menu_stow) && $_menu_stow===true)? ' active' : '';?>"><a href="<?php echo $cfg_memberurl;?>/mystow.php">我的收藏</a></li> | ||||
<li class="list-group-item justify-content-between align-items-center"><a href="<?php echo $cfg_memberurl;?>/buy.php">积分钱包</a></li> | |||||
<li class="list-group-item justify-content-between align-items-center <?php echo (isset($_menu_buy) && $_menu_buy===true)? ' active' : '';?>"><a href="<?php echo $cfg_memberurl;?>/buy.php">积分钱包</a></li> | |||||
<li class="list-group-item justify-content-between align-items-center"> | <li class="list-group-item justify-content-between align-items-center"> | ||||
<div data-toggle="collapse" data-target="#collapseOrder">订单详情<span class="dropdown ml-2"></span></div> | <div data-toggle="collapse" data-target="#collapseOrder">订单详情<span class="dropdown ml-2"></span></div> | ||||
<div id="collapseOrder" class="collapse mt-3<?php echo (isset($_menu_order) && $_menu_order===true)? ' show' : '';?>"> | <div id="collapseOrder" class="collapse mt-3<?php echo (isset($_menu_order) && $_menu_order===true)? ' show' : '';?>"> | ||||