码迷,mamicode.com
首页 > 其他好文 > 详细

tp5限制横向传递(同一体系相互传递)

时间:2018-08-07 18:53:21      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:init   getchild   用户数   getch   ast   error   userinfo   数组   each   

1.use fast\Tree;  

2. 

// 判断同线账号

$alluser = Userinfo::all();  //查询所有用户数据
$tree = Tree::instance();
$tree->init($alluser);
$myteam = $tree->getChildren($miner_id);  // 得出下线的pid集
$myteampid = $tree->getParent($miner_id);// 得出上线的pid集
// 合并数组
$arr = array_merge($myteam,$myteampid);
foreach($arr as $key => $row){
$aaa[] = $row[‘pid‘];
}
// 判断受赠者的pid是否存在该数组中
if (!in_array($touser[‘pid‘], $aaa)){
return $this->error(‘非同线账号‘);
}
// 判断同线账号end

tp5限制横向传递(同一体系相互传递)

标签:init   getchild   用户数   getch   ast   error   userinfo   数组   each   

原文地址:https://www.cnblogs.com/roseY/p/9438533.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!