123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- /**
- * 示例接口
- */
- class Crontab extends Api
- {
- // 无需登录的接口,*表示全部
- protected $noNeedLogin = ['user_path'];
- public function user_path($pid=0){
- $list=Db::table('fa_user')->where('pid',$pid)->select();
- foreach ($list as $k=>$v){
- if($pid==0){
- $path=$pid.'/';
- }else{
- $path=$v['path'].$v['id'].'/';
- }
- Db::table('fa_user')->where('id',$v['id'])->update(['path'=>$path]);
- $this->user_path($v['id']);
- }
- }
- }
|