助购获得的那些数据
This commit is contained in:
parent
fadce0e804
commit
312790a635
@ -35,6 +35,23 @@ class UserLevel extends Base
|
||||
return $User;
|
||||
}
|
||||
|
||||
public function stats()
|
||||
{
|
||||
$userId = get_my_id();
|
||||
$goodsType = 3;
|
||||
return [
|
||||
'zgTimes'=>Db::name('orders')->where(compact('userId','goodsType'))->count(),
|
||||
'zgAmounts'=>Db::name('orders')->where(compact('userId','goodsType'))->sum('helpGetCount'),
|
||||
'zgYhYhq'=>Db::name('log_moneys')->where([
|
||||
'targetId'=>$userId,
|
||||
'remark'=>'预获产品券转换所得',
|
||||
'moneyType'=>'1',
|
||||
])->where('dataId', 'in', Db::name('orders')
|
||||
->where(compact('userId','goodsType'))->column('orderId')
|
||||
)->where('dataId', '>', 0)->sum('money'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* TreeList
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
@ -64,7 +81,6 @@ class UserLevel extends Base
|
||||
$treeArr[$newLevel]['userId'] = $userId;
|
||||
$treeArr[$newLevel]['userName'] = '';
|
||||
}else{$newLevel--;}
|
||||
if ($userId <= 1)break;
|
||||
} while (($newLevel <= $max) && ($newLevel <= (int)dataConf("helpSaleMaxLevel")));
|
||||
// pd($treeArr);
|
||||
return $treeArr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user