|
@@ -621,6 +621,26 @@ if (!function_exists('do_request')) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (!function_exists('get_downlines')){
|
|
|
+ //所有下级
|
|
|
+ function get_downlines($members,$id){
|
|
|
+ $arr=array();
|
|
|
+ foreach ($members as $key => $v) {
|
|
|
+ if($v['spread_uid']==$id){ //pid为0的是顶级分类
|
|
|
+ $arr[]= [
|
|
|
+ 'nickname' => $v['nickname'],
|
|
|
+ 'uid' => $v['uid'],
|
|
|
+ 'price' => \app\models\store\StoreOrder::where('uid', $v['uid'])->where('paid', 1)->sum('pay_price'),
|
|
|
+ 'count' => \app\models\store\StoreOrder::where('uid', $v['uid'])->where('paid', 1)->sum('total_num')
|
|
|
+ ];
|
|
|
+ $arr = array_merge($arr,get_downlines($members,$v['uid']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $arr;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!function_exists('getParent')){
|
|
|
//获取指定级别的所有上级
|
|
|
function getParent($p_id,$array) {
|