示例#1
0
 $mid = $row['mid'];
 $pid = $row['pid'];
 //更新交易状态为已付款
 $dsql->ExecuteNoneQuery("Update #@__member_operation set sta=1 where buyid='{$buyid}' ");
 //-------------------------------------------
 //会员产品
 //-------------------------------------------
 if ($row['product'] == 'member') {
     $row = $dsql->GetOne(" Select rank,exptime From #@__member_type where aid='{$row['pid']}' ");
     $rank = $row['rank'];
     $exptime = $row['exptime'];
     $equery = " Update #@__member set \r\n\t\t\t\t\t\t\t\t\tmembertype='{$rank}',exptime='{$exptime}',uptime='" . time() . "' where mid='{$mid}' ";
     $dsql->ExecuteNoneQuery($equery);
     //更新交易状态为已关闭
     $dsql->ExecuteNoneQuery(" Update #@__member_operation set sta=2,oldinfo='会员升级成功!' where buyid='{$buyid}' ");
     $cfg_ml->FushCache();
     $dsql->Close();
 } else {
     if ($row['product'] == 'card') {
         $row = $dsql->GetOne("Select cardid From #@__moneycard_record where ctid='{$pid}' And isexp='0' ");
         //如果找不到某种类型的卡,直接为用户增加金币
         if (!is_array($row)) {
             $nrow = $dsql->GetOne("Select num From  #@__moneycard_type where tid='{$pid}' ");
             $dnum = $nrow['num'];
             $equery = " Update #@__member set money=money+" . $dnum . " where mid='{$mid}' ";
             $dsql->ExecuteNoneQuery($equery);
             $cfg_ml->FushCache();
             //更新交易状态为已关闭
             $dsql->ExecuteNoneQuery(" Update #@__member_operation set sta=2,oldinfo='直接充值了 {$dnum} 金币到帐号!' where buyid='{$buyid}' ");
             exit;
         } else {