global $_G;
$uid = intval($uid ? $uid : $_G['uid']);
$groupid = 0;
if(!$uid) return $groupid;
if($uid != $_G['uid']) {
$member = getuserbyuid($uid);
} else {
$member = $_G['member'];
}
if(empty($member)) return $groupid;
notification_add($uid, 'system', 'user_usergroup', array('usergroup' => '<a href="home.php?mod=spacecp&ac=credit&op=usergroup">'.$newgroup['grouptitle'].'</a>', 'from_id' => 0, 'from_idtype' => 'changeusergroup'), 1);
notification_add($_G['uid'],'system','system_notice',
['subject' => $subject,
'message' => $str,
]);
notification_add($authorid,'system','我发送通知啦');
$card['extcreditsval'].$extcredit['title']
22 金币
// 购买xxx主题支出 -3 积分
updatemembercount($uid,array('extcredits1'=>'-3'),true,'BTC',$tid);
// 出售xxx主题获得 +1 威望
updatemembercount($authorid,array('extcredits2'=>'+1'),true,'STC',$tid);
showmessage('购买积分成功','',[],['alert'=>'right']);
$data = [
'uid' => $uid,
'tid' => $tid,
'subject' => $subject,
'price' => $buyinfoarr[0],
'key' => $buyinfoarr[1],
'createtime' => time()
];
// 插入数据$data 到表 jb_buythead_log 中,并返回插入数据的id
$logid = DB::insert('jb_buythead_log',$data,true);
$logid = DB::result_first('select id from '.DB::table('jb_buythead_log').' where uid=%d and tid=%d',[$uid,$tid]);
if (!ismobile() || $_G['cookie']['mobile'] == 'no'){
include template('zbyun_buythead:buy');
}
|