用户背包

This commit is contained in:
2025-12-29 12:39:04 +08:00
parent 2ab9208236
commit 6cde21fe2d
2 changed files with 19 additions and 1 deletions

View File

@@ -27,4 +27,22 @@ class Xxiaoshi extends Controllers
}
}
//测试数据
public function testData()
{
$res = db::name('vs_user_gift_pack_log')->alias('a')
->join('user b','a.user_id = b.id')
->field('a.gid,b.nickname,a.user_id,a.gid')
->where(['updatetime'=> ['<=', 1766332800]])->group('user_id')->select();
$total_price = 0;
if($res){
foreach ($res as $v){
$gft_price = db::name('vs_gift')->where('gid',$v['gid'])->value('gift_price');
$total_price += $gft_price * $v['after_num'];
}
}
echo $total_price;
}
}