Пример #1
0
    $tempcost = $db->get_value("SELECT SUM(totalcash) as sum FROM pw_activitymembers WHERE isrefund=1 AND fupid=" . S::sqlEscape($actuid));
    if ($refund_fee > number_format($memberdb['totalcash'] - $tempcost, 2, '.', '')) {
        paymsg("read.php?tid={$tid}", 'act_refund_cost_error');
    }
    $sqlarray = array('fupid' => $actuid, 'tid' => $tid, 'uid' => $memberdb['uid'], 'actmid' => $memberdb['actmid'], 'username' => $memberdb['username'], 'totalcash' => $refund_fee, 'signuptime' => $timestamp, 'isrefund' => 1, 'refundreason' => $memberdb['refundreason']);
    $db->update("INSERT INTO pw_activitymembers SET " . S::sqlSingle($sqlarray));
    $db->update("UPDATE {$defaultValueTableName} SET updatetime=" . S::sqlEscape($timestamp) . " WHERE tid=" . S::sqlEscape($tid));
    //报名列表动态时间
    $newactuid = $db->insert_id();
    /*支付成功费用流通日志
    	退款成功
    	*/
    $data = array();
    L::loadClass('ActivityForBbs', 'activity', false);
    $postActForBbs = new PW_ActivityForBbs($data);
    $statusValue = $postActForBbs->getActivityStatusValue($tid);
    $postActForBbs->UpdatePayLog($tid, $newactuid, $statusValue);
    /*支付成功费用流通日志*/
    /*短消息通知 退款 发起人*/
    $msgContentText = $memberdb['isadditional'] ? 'activity_refund2_content' : 'activity_refund_content';
    M::sendNotice(array($memberdb['author']), array('title' => getLangInfo('writemsg', 'activity_refund_title', array('uid' => $memberdb['uid'], 'username' => $memberdb['username'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee)), 'content' => getLangInfo('writemsg', $msgContentText, array('uid' => $memberdb['uid'], 'username' => $memberdb['username'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee))), 'notice_active', 'notice_active');
    /*短消息通知 退款 参与人*/
    $msgContentText = $memberdb['isadditional'] ? 'activity_refund2_signuper_content' : 'activity_refund_signuper_content';
    M::sendNotice(array($memberdb['username']), array('title' => getLangInfo('writemsg', 'activity_refund_signuper_title', array('uid' => $memberdb['authorid'], 'username' => $memberdb['author'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee)), 'content' => getLangInfo('writemsg', $msgContentText, array('uid' => $memberdb['authorid'], 'username' => $memberdb['author'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee))), 'notice_active', 'notice_active');
    paymsg("read.php?tid={$tid}", 'act_refund_success');
} else {
    paymsg("index.php", 'undefined_action');
}
function paymsg($url, $msg, $notify = 'success')
{
    if (empty($_POST)) {
Пример #2
0
function RevertActivityTopic($activityDb)
{
    global $db;
    $defaultValueTableName = getActivityValueTableNameByActmid();
    $newActivityDb = array();
    $query = $db->query("SELECT actmid,tid FROM {$defaultValueTableName} WHERE tid IN(" . S::sqlImplode($activityDb) . ")");
    while ($rt = $db->fetch_array($query)) {
        $newActivityDb[$rt['actmid']][] = $rt['tid'];
    }
    /*支付成功费用流通日志*/
    L::loadClass('ActivityForBbs', 'activity', false);
    $postActForBbs = new PW_ActivityForBbs($data);
    $data = array();
    /*支付成功费用流通日志*/
    foreach ($newActivityDb as $key => $value) {
        $tids = S::sqlImplode($value);
        $userDefinedValueTableName = getActivityValueTableNameByActmid($key, 1, 1);
        $db->update("UPDATE {$defaultValueTableName} SET ifrecycle='0' WHERE tid IN({$tids})");
        $db->update("UPDATE {$userDefinedValueTableName} SET ifrecycle='0' WHERE tid IN({$tids})");
        /*支付成功费用流通日志*/
        foreach ($value as $tid) {
            $statusValue = $postActForBbs->getActivityStatusValue($tid);
            $postActForBbs->UpdatePayLog($tid, 0, $statusValue);
        }
        /*支付成功费用流通日志*/
    }
}