Example #1
0
function get_friendmoney($money)
{
    $sql = "select b.name as gfname,a.name,a.uid from get_friend as a left join user as b on a.uid=b.id where a.status=0 and a.name='" . $_SESSION['usnamese'] . "' limit 1";
    $result = mysql_query($sql);
    $gcount = mysql_num_rows($result);
    $row = mysql_fetch_assoc($result);
    if ($row['uid'] != 0 && $gcount > 0) {
        $friendmoney = $money * GETFRIENDMONEY;
        $bfmoney = GETFRIENDMONEY * 100;
        if ($friendmoney > 0) {
            Zbkupdate('get_friend', array('status' => 1, 'f_meney' => $friendmoney), "name='" . $row['name'] . "'");
            $mingxi = "您推荐的会员" . $row['name'] . "升级为VIP,共支付" . $money . "元,给你返" . $bfmoney . "%会员费!";
            Kmoney($row['gfname'], $friendmoney, $mingxi, 'recharge', 0, 1, 0);
        }
    }
}
Example #2
0
function autosybg($user_shiyongid, $gtime)
{
    global $CCtimes;
    $usname = $_SESSION['usnamese'];
    $sql = "select a.name,b.name as buy_name,b.userid,b.step5_time,c.coupon_price,c.pt_meney,c.shiyongtype,c.hs_price,c.id from user_shiyong as b left join shiyong as c on b.shiyongid=c.id left join user as a on b.userid=a.id where b.id={$user_shiyongid}";
    $result = mysql_query($sql);
    $usrow = mysql_fetch_assoc($result);
    if (checkReoprtUser2($usrow['userid'], $user_shiyongid, 'status=5')) {
        if (time() - 3600 * $gtime > $usrow['step5_time']) {
            if ($usrow['shiyongtype'] == 2) {
                $usrow['coupon_price'] = $usrow['coupon_price'] - $usrow['hs_price'];
            }
            $mingxiA = "您试用编号ID为:" . $usrow['id'] . "的产品完成,平台给您退款" . $usrow['coupon_price'] . "元";
            $mingxiB = "用户" . $usrow['name'] . "试用您发布编号ID为:" . $usrow['id'] . "的产品完成,给该用户退款" . $usrow['coupon_price'] . "元";
            $count1 = Kmoney($usrow['name'], $usrow['coupon_price'], $mingxiA, 'transfer', 0, 1, 0);
            $count2 = Jsmoney($usrow['buy_name'], -$usrow['coupon_price'], $mingxiB, 'debited', 0, 1, 0, '', 0);
            if ($usrow['pt_meney'] > 0) {
                $mingxiC = "用户" . $usrow['name'] . "试用您发布编号ID为:" . $usrow['id'] . "的产品完成,给平台支付" . $usrow['pt_meney'] . "元佣金";
                $count2 = Jsmoney($usrow['buy_name'], -$usrow['pt_meney'], $mingxiC, 'debited', 0, 1, 0, '', 0);
            }
            $count = EditstatusT('user_shiyong', "status=6", "step6_time={$CCtimes},lasttime={$CCtimes}", "name='" . $usrow['buy_name'] . "'", $user_shiyongid);
        }
    }
}
Example #3
0
                    $endtype = $mnamexx['endtype'] + 365 * 24 * 3600;
                } else {
                    $endtype = $mnamexx['endtype'] + 31 * 24 * 3600;
                }
                if (Kmoney($name, $money, $mingxi, $dataName, $dataarr['dongjie'], 1) > 2) {
                    $sql = "update user set type={$type},starttype={$CCtimes},endtype={$endtype} where name='{$name}'";
                    mysql_query($sql);
                    $count = mysql_affected_rows();
                }
                if ($count > 0) {
                    $updateMessage = "操作成功";
                } else {
                    $updateMessage = "操作失败,用户金额不足";
                }
            } else {
                $count = Kmoney($name, $money, $mingxi, $dataName, $dataarr['dongjie'], 1);
                if ($count > 0) {
                    $updateMessage = "操作成功";
                } else {
                    $updateMessage = "操作失败,用户金额不足";
                }
            }
        } else {
            $updateMessage = "操作金额、操作说明、金额操作类型不能为空";
        }
    }
}
if (isset($_GET['id'])) {
    $id = $_GET['id'];
}
$mnamexx = Getlmname('*', 'user', "id={$id}");
Example #4
0
                }
                $CYren = GetCount('user_shiyong', "shiyongid={$aid} and status=6 and name='" . $usname . "'");
                $cymoney = ($usrow['coupon_price'] + $usrow['hongbao'] + $usrow['pt_meney']) * $usrow['num'] - $CYren * ($usrow['coupon_price'] + $usrow['hongbao'] + $usrow['pt_meney']);
                if ($usrow['pt_meney'] > 0) {
                    $mingxiC = "您发布编号ID为:" . $usrow['id'] . "的产品结算完成,共给" . $CYren . "位用户及平台支付" . $CYren * ($usrow['coupon_price'] + $usrow['hongbao'] + $usrow['pt_meney']) . "元,余下的" . $cymoney . "元全部解冻";
                } else {
                    $mingxiC = "您发布编号ID为:" . $usrow['id'] . "的产品结算完成,共给" . $CYren . "位用户支付" . $CYren * ($usrow['coupon_price'] + $usrow['hongbao'] + $usrow['pt_meney']) . "元,余下的" . $cymoney . "元全部解冻";
                }
                if ($usrow['shiyongtype'] == 2) {
                    $cymoney = ($usrow['hongbao_1'] + $usrow['coupon_price_1'] + $usrow['pt_meney']) * $usrow['num'] - $CYren * ($usrow['hongbao_1'] + $usrow['coupon_price_1'] + $usrow['pt_meney'] - $usrow['hs_price']);
                    if ($usrow['pt_meney'] > 0) {
                        $mingxiC = "您发布编号ID为:" . $usrow['id'] . "的产品结算完成,共给" . $CYren . "位用户及平台支付" . $CYren * ($usrow['hongbao_1'] + $usrow['coupon_price_1'] + $usrow['pt_meney'] - $usrow['hs_price']) . "元,余下的" . $cymoney . "元全部解冻";
                    } else {
                        $mingxiC = "您发布编号ID为:" . $usrow['id'] . "的产品结算完成,共给" . $CYren . "位用户支付" . $CYren * ($usrow['hongbao_1'] + $usrow['coupon_price_1'] + $usrow['pt_meney'] - $usrow['hs_price']) . "元,余下的" . $cymoney . "元全部解冻";
                    }
                }
                $countjs = Kmoney($usname, $cymoney, $mingxiC, 'balance', 1, 1, 0);
                if (Zbkupdate('shiyong', array('xianshi' => 5, 'lasttime' => $CCtimes), "create_user_id={$usidse} and id={$aid}")) {
                    $arry['id'] = 219;
                    //终止成功
                    $arry['msg'] = "结算成功";
                } else {
                    $arry['id'] = 0;
                    //终止失败
                    $arry['msg'] = "失败";
                }
            }
        }
        echo json_encode($arry);
        exit;
}
Example #5
0
$ali_price = trim($_POST[PayJe]);
//订单价格
$ali_title = trim($_POST[PayMore]);
//订单标题(这里一般都是网站提交的订单号即支付宝的付款说明中的内容)
$pno = trim($_POST[PayNo]);
//支付宝交易号
$sign = trim($_POST[Key]);
//返回KEYS身份
//-------------------------------------------------------
if ($sign == $key) {
    //验证KEY和UID通过后执行即时到帐功能
    //--------------这里加入你自己的网站订单处理SQL语句-------------------
    //-----查询你的订单系统中$ali_title(支付宝付款说明中显示的订单号或者用户名)
    $out_trade_no = $ali_title;
    $trade_no = $pno;
    if (Zbkupdate('alipay_log', array('trade_no' => $trade_no, 'status' => 1, 'lasttime' => time()), "out_trade_no='{$out_trade_no}' and status=0")) {
        $alireturn = Getlmname('name,money,body,shouxufei', 'alipay_log', "out_trade_no='{$out_trade_no}'");
        $ali_rename = $alireturn['name'];
        $ali_remoney = $alireturn['money'];
        $ali_rebody = $alireturn['body'];
        $ali_reshouxufei = $alireturn['shouxufei'];
        $cmoney = $ali_remoney - $ali_reshouxufei;
        Kmoney($ali_rename, $cmoney, $ali_rebody, 'recharge', 0, 1, $ali_reshouxufei);
    }
    //----------------------SQL执行结束-------------------------------------
    exit("Success");
    //该值不得修改,否则软件无法获取信息
} else {
    exit("error");
    //该值不得修改,否则软件无法获取信息
}
Example #6
0
     echo json_encode($arry);
     exit;
 }
 $usjifen = Getlmnameseo('jifen', 'user', "name='" . $_SESSION['usnamese'] . "'");
 if ($jifen > $usjifen) {
     $arry['id'] = 0;
     //
     $arry['msg'] = "您帐户上的税分不足" . $jifen . "分,您怎么能提交" . $jifen . "分?";
     echo json_encode($arry);
     exit;
 }
 $money = $jifen * ZBK_JF_MO_PR;
 $hl = 1 / ZBK_JF_MO_PR;
 $mingxi = "用" . $jifen . "税分兑换" . $money . "元,兑换汇率是" . $hl . "积分:1元。";
 if (Kjifen($_SESSION['usnamese'], -$jifen, $mingxi) > 2) {
     if (Kmoney($_SESSION['usnamese'], $money, $mingxi, 'recharge', 0, 1, 0) > 2) {
         $arry['id'] = 123;
         //
         $arry['msg'] = "兑换成功,兑换金额为" . $money . "元";
         echo json_encode($arry);
         exit;
     } else {
         $arry['id'] = 0;
         //
         $arry['msg'] = "兑换失败";
         echo json_encode($arry);
         exit;
     }
 } else {
     $arry['id'] = 0;
     //
 $pass == 1 ? $pass = 6 : ($pass = -3);
 $aidarr = explode(',', $bs_id);
 foreach ($aidarr as $value) {
     $sql = "select a.name,b.userid,c.coupon_price,c.hongbao,c.pt_meney,c.shiyongtype,c.hs_price,c.id from user_shiyong as b left join shiyong as c on b.shiyongid=c.id left join user as a on b.userid=a.id where b.id={$value}";
     $result = mysql_query($sql);
     $usrow = mysql_fetch_assoc($result);
     if (checkReoprtUser($usrow['userid'], $value, 'status=5')) {
         if ($pass == 6) {
             if ($usrow['shiyongtype'] == 2) {
                 $usrow['coupon_price'] = $usrow['coupon_price'] + $usrow['hongbao'] - $usrow['hs_price'];
             }
             $mingxiA = "您试用编号ID为:" . $usrow['id'] . "的产品完成,平台给您退款" . ($usrow['coupon_price'] + $usrow['hongbao']) . "元";
             //商家流动资金提示
             $mingxiB = "用户" . $usrow['name'] . "试用您发布编号ID为:" . $usrow['id'] . "的产品完成,给该用户退款" . ($usrow['coupon_price'] + $usrow['hongbao']) . "元";
             //商家流动资金提示
             $count1 = Kmoney($usrow['name'], $usrow['coupon_price'] + $usrow['hongbao'], $mingxiA, 'transfer', 0, 1, 0);
             //审核时用户返款
             $count2 = Jsmoney($usname, -($usrow['coupon_price'] + $usrow['hongbao']), $mingxiB, 'debited', 0, 1, 0, '', 0);
             //审核时商家扣押金
             if ($usrow['pt_meney'] > 0) {
                 $mingxiC = "用户" . $usrow['name'] . "试用您发布编号ID为:" . $usrow['id'] . "的产品完成,给平台支付" . $usrow['pt_meney'] . "元佣金";
                 $count2 = Jsmoney($usname, -$usrow['pt_meney'], $mingxiC, 'debited', 0, 1, 0, '', 0);
             }
         }
         $count = EditstatusT('user_shiyong', "status={$pass}", "step6_time={$CCtimes},lasttime={$CCtimes}", "name='{$usname}'", $value);
     }
 }
 if ($count > 0) {
     $arry['id'] = 216;
     //提交成功
     $arry['msg'] = "提交成功";