优化:Give_Gift 表查询处理
This commit is contained in:
@@ -75,7 +75,7 @@ class Lottery extends adminApi
|
||||
$lists_data = db::name('bb_lottery_winner_record')->field('id,uid as user_id,prize_type,prize_amount,pool_amount,ratio,release_amount,status,create_time as createtime')->where($where)->page($page, $page_limit)->order("id desc")->select();
|
||||
foreach ($lists_data as $k=>$v){
|
||||
$user_info = db::name('user')->where(['id'=>$v['user_id']])->find();
|
||||
$lists_data[$k]['user_code'] = $user_info['user_code'];
|
||||
$lists_data[$k]['user_code'] = $user_info['user_code']??"";
|
||||
$lists_data[$k]['nickname'] = $user_info['user_code']."-".$user_info['nickname'];
|
||||
//奖项类型:1-小奖 2-大奖
|
||||
$lists_data[$k]['prize_type_str'] = $v['prize_type']==1?"小奖":"大奖";
|
||||
|
||||
@@ -33,7 +33,7 @@ class Lottery extends Model
|
||||
//送给所有人的总价格
|
||||
$all_gift_price = $gift_info['gift_price'] * $num * count($toarray);
|
||||
//判断是否有足够的金币
|
||||
$user_waller = db::name('user_wallet')->where(['user_id'=>$send_uid])->find();
|
||||
$user_waller = db::name('user_wallet_coin')->where(['user_id'=>$send_uid])->find();
|
||||
if ($user_waller['coin'] < $all_gift_price) {
|
||||
return ['code' => 0, 'msg' => '用户金币不足', 'data' => null];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user