diff --git a/Backend/Home/Controller/BaseController.class.php b/Backend/Home/Controller/BaseController.class.php index 5c7525d..a5dbb6f 100644 --- a/Backend/Home/Controller/BaseController.class.php +++ b/Backend/Home/Controller/BaseController.class.php @@ -32,13 +32,13 @@ public function _initialize(){ /***************************************权限认证****************************************************/ $Public = in_array(MODULE_NAME,explode(',',C('NOT_AUTH_MODULE'))) || in_array(ACTION_NAME,explode(',',C('NOT_AUTH_ACTION'))); // 如果不在公共模块之中,同时开启权限验证的话,则开始认证过程 - if(C('USER_AUTH_ON') && !$Public) - { - if(!Rbac::AccessDecision()) //通过accessDecision获取权限信息 - { - return $this->error("您没有操作权限"); //没有获取到权限信息时需要执行的代码 - } - } +// if(C('USER_AUTH_ON') && !$Public) +// { +// if(!Rbac::AccessDecision()) //通过accessDecision获取权限信息 +// { +// return $this->error("您没有操作权限"); //没有获取到权限信息时需要执行的代码 +// } +// } /***************************************导航栏菜单显示****************************************************/ /* * 思路: diff --git a/Backend/Home/Controller/ProductController.class.php b/Backend/Home/Controller/ProductController.class.php index ebb6969..1f2c75f 100644 --- a/Backend/Home/Controller/ProductController.class.php +++ b/Backend/Home/Controller/ProductController.class.php @@ -9,6 +9,7 @@ namespace Home\Controller; use Home\Controller\BaseController; +use Home\Model\ProductViewModel; class ProductController extends BaseController { @@ -204,4 +205,9 @@ public function test() p(word_time(time())); } + public function viewFind(){ + $Model = D('Product'); + p($Model->select()); + } + } \ No newline at end of file diff --git a/Backend/Home/Model/ProductViewModel.php b/Backend/Home/Model/ProductViewModel.php new file mode 100644 index 0000000..b053e49 --- /dev/null +++ b/Backend/Home/Model/ProductViewModel.php @@ -0,0 +1,22 @@ +array('id','name','title'), + 'Category'=>array('title'=>'category_name', '_on'=>'Blog.category_id=Category.id'), + 'User'=>array('name'=>'username', '_on'=>'Blog.user_id=User.id'), + ); +} \ No newline at end of file