用户背包
This commit is contained in:
@@ -698,7 +698,7 @@ class User extends adminApi
|
||||
$gift_total = 0;
|
||||
$gift_count = 0;
|
||||
foreach ($list as $key => &$value) {
|
||||
$value['createtime'] = date('Y-m-d H:i:s',$value['createtime']);
|
||||
$value['createtime'] = date('Y-m-d H:i:s',$value['updatetime']);
|
||||
$value['nickname'] = $value['nickname'].'-'.$value['user_code'];
|
||||
$value['gift_id_name'] = $value['gift_name'].'-'.$value['gid'];
|
||||
}
|
||||
|
||||
@@ -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