Exemple #1
0
 //初始化变量全局返回
 $oid = GetNum($oid);
 $value = $Table->getone($oid);
 $arrayadd = $value;
 unset($arrayadd['oid']);
 unset($arrayadd['sid']);
 $arrayadd['uid'] = $_USERS['uid'];
 $arrayadd['uname'] = $_USERS['uname'];
 $arrayadd['goodsnum'] = GetNum($pieceNum);
 $arrayadd['type'] = 2;
 $arrayadd['goodsremark'] = Char_cv(pieceRemark);
 $arrayadd['addtime'] = time();
 $arrayadd['uptime'] = time();
 $arrayadd['state'] = 1;
 $arrayadd['pinoid'] = GetNum($oid);
 $info = $Table->add($arrayadd);
 if (GetNum($info)) {
     include_once INC_PATH . "/member.class.php";
     $m = new memberclass();
     $note = lang('Buy') . "<a href=\\'" . $value['goodsurl'] . "\\' target=\\'_blank\\'>《" . $value['goodsname'] . "》</a> " . GetNum($pieceNum) . lang('Pieces_order_ID') . $info;
     $tempmoney = $value['goodsprice'] * GetNum($pieceNum);
     $m->moneyedit($_USERS['uname'], -$tempmoney, 1, $note);
     //扣去账户余额
     addfield("order", "pinnum", "oid={$oid}", 1);
     //更改状态操作
     showmsg(lang('fight_sucess'), PHP_SELF);
     //出错!
 } else {
     showmsg(lang('fight_lose'), "-1");
     //出错!
 }