|
@@ -9,11 +9,22 @@
|
|
|
namespace app\edit\controller;
|
|
|
|
|
|
|
|
|
+use app\common\model\AdminUser;
|
|
|
+
|
|
|
class Index extends Base
|
|
|
{
|
|
|
public function index(){
|
|
|
$model=model('common/Project');
|
|
|
- $data=$model->select();
|
|
|
+ $model_user = new AdminUser();
|
|
|
+ $user_data = $model_user->field('project_id')->where(['id'=>$this->aid])->find();
|
|
|
+ if($this->aid != 1){
|
|
|
+ $where = [
|
|
|
+ 'id'=>['in',$user_data['project_id']],
|
|
|
+ ];
|
|
|
+ }else{
|
|
|
+ $where = [];
|
|
|
+ }
|
|
|
+ $data=$model->where($where)->select();
|
|
|
$this->assign('data',$data);
|
|
|
return $this->fetch('index');
|
|
|
}
|