Index.php 677 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: 珣
  5. * Date: 2016/9/5
  6. * Time: 22:52
  7. */
  8. namespace app\edit\controller;
  9. use app\common\model\AdminUser;
  10. class Index extends Base
  11. {
  12. public function index(){
  13. $model=model('common/Project');
  14. $model_user = new AdminUser();
  15. $user_data = $model_user->field('project_id')->where(['id'=>$this->aid])->find();
  16. if($this->aid != 1){
  17. $where = [
  18. 'id'=>['in',$user_data['project_id']],
  19. ];
  20. }else{
  21. $where = [];
  22. }
  23. $data=$model->where($where)->select();
  24. $this->assign('data',$data);
  25. return $this->fetch('index');
  26. }
  27. }