Index.php 626 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\model\AdminUser;
  4. use think\Controller;
  5. class Index extends Base
  6. {
  7. public function index()
  8. {
  9. $model=model('common/Project');
  10. $model_user = new AdminUser();
  11. $user_data = $model_user->field('project_id')->where(['id'=>$this->aid])->find();
  12. if($this->aid != 1){
  13. $where = [
  14. 'id'=>['in',$user_data['project_id']],
  15. ];
  16. }else{
  17. $where = [];
  18. }
  19. $data=$model->where($where)->select();
  20. $this->assign('data',$data);
  21. return $this->fetch('index');
  22. }
  23. }