用户背包
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user