最近新开发了一款NFT链购系统,该系统是一款涉及众多门类,用户可以根据自己的喜好进行选择性购买。NFT链购作为一类数字资产,资产属性决定了必然有多种方式可以对其进行评估。
NFT链购系统商业模式:
NFT链购系统开发部分源码分享:
<?php
set_time_limit(0);
include '../includes/config.php';
include '../includes/functions.php';
$settings = current(getCacheFileByFront("settings"));
$isrunning = $ds->setnx('dealassetunlock',1);
if($isrunning==0){
ehaoyu_log("解押结果处理中......","dealassetunlock");
die();
}
$ds->expire('dealassetunlock',600);
$curtime = time()-86400;
$sql = "select * from `crypto_assetlock`
where `status` = 3 and `unlocktime`<'".$curtime."' order by `addtime` asc limit 100
";
$unlockList = getAll($sql);
if($unlockList){
foreach($unlockList as $k=>$v){
$iszhixing = $ds->setnx('assetunlock_'.$v['id'],1);
if($iszhixing==0){
ehaoyu_log("ASSETLOCK ID=>[".$v['id']."]其它操作中","dealassetunlock");
continue;
}
$locksecondtime = empty($CONF['locksecondtimenotify'])?20:$CONF['locksecondtimenotify'];
$ds->expire('assetunlock_'.$v['id'],$locksecondtime);
$sql = "update `crypto_users_coins`
set ".$v['coin']."=".$v['coin']."+".$v['num'].
" where uid='".$v['uid']."'";
$re = $db->query($sql);
if($re){
$sql = "update `crypto_assetlock`
set `status` = '2'
where id='".$v['id']."'
";
$db->query($sql);
$sql = "
insert into `crypto_userfinance`(
uid,
coin,
num,
profit,
type,
gametype,
memo,
addtime
)values(
'".$v['uid']."',
'".$v['coin']."',
'".$v['num']."',
1,
12,
4,
'解押资产[".$v['id']."]',
'".time()."'
)
";
$db->query($sql);
}else{
ehaoyu_log("会员ID:".$v['uid'].",质押ID=>".$v['id'].",质押币种:".$v['coin'].",数量:".numF($v['num']).",解押处理失败","dealassetunlockerror");
}
$ds->del('assetunlock_'.$v['id']);
}
}else{
echo "nodata";
}
$ds->del('dealassetunlock');
?
|