迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
想写一个执行文件,,,
目标:小程序返回的用户组ID后查询该组下的所有用户;
各位大哥,帮忙!!!help
<?php //gid 希望从小程序返回 $return = []; $user_gourp_id=\Phpcmf\Service::M()->table('member_group_index')->where('gid', 1)->select(['uid'])->get(); $data = \Phpcmf\Service::M()->where('id',$user_gourp_id['uid'])->table('member')->getAll(); if ($user_gourp_id) { foreach ($user_gourp_id as $r) { $return[] = [ 'id' => $r['id'], ]; } }
$return = []; $data = \Phpcmf\Service::M()->table('member')->where('id in (select uid from dr_member_group_index where gid=1)')->getAll(); // dr_改成自己的表前缀 if ($user_gourp_id) { foreach ($user_gourp_id as $r) { $return[] = [ 'id' => $r['id'], ]; } }
<?php //gid 希望从小程序返回 $gid=$_GET['g_id']; $return = []; $rt = \Phpcmf\Service::M()->where('id in (select uid from dr_member_group_index where gid='.$gid.')')->table('member')->getAll(); // dr_改成自己的表前缀 if ($rt) { foreach ($rt as $r) { $return[] = [ 'id' => $r['id'], 'username' => $r['username'], 'score' => $r['score'], 'avatar' => $r['avatar'],//用户头像 ]; } }
'avatar' => dr_avatar($r['id']),//用户头像
大佬这样写orderby 好像错了,怎么写
<?php //gid 希望从小程序返回 $gid=$_GET['g_id']; $return = []; $rt = \Phpcmf\Service::M()->where('id in (select uid from dr_member_group_index where gid='.$gid.')')->limit(10, 0)->table('member')->getAll(); // dr_改成自己的表前缀 if ($rt) { foreach ($rt as $r) { $return[] = [ 'id' => $r['id'], 'username' => $r['username'], 'score' => $r['score'], 'avatar' => dr_avatar($r['id']), ]; } }
$rt = \Phpcmf\Service::M()->table('member')->where('id in (select uid from dr_member_group_index where gid='.$gid.')')->order_by('id ASC')->getAll(10); // dr_改成自己的表前缀
大佬这样写orderby 好像错了,怎么写