CatalogController.class.php 843 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Home\Controller;
  3. use Think\Controller;
  4. class CatalogController extends BaseController {
  5. //编辑页面
  6. public function edit(){
  7. $cat_id = I("cat_id/d");
  8. $Catalog = D("Catalog")->where(" cat_id = '$cat_id' ")->find();
  9. if ($Catalog) {
  10. $this->assign("Catalog" , $Catalog);
  11. }
  12. if ($Catalog['parent_cat_id']) {
  13. $this->assign("default_parent_cat_id" , $Catalog['parent_cat_id']);
  14. }
  15. $item_id = $Catalog['item_id'] ? $Catalog['item_id'] : I("item_id");
  16. $login_user = $this->checkLogin();
  17. if (!$this->checkItemPermn($login_user['uid'] , $item_id)) {
  18. $this->message(L('no_permissions'));
  19. return;
  20. }
  21. $this->assign("item_id" , $item_id);
  22. $this->display();
  23. }
  24. }