Cate.php 471 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\shop\controller;
  3. use app\common\controller\Frontend;
  4. class Cate extends Frontend{
  5. protected $noNeedLogin = [''];
  6. protected $noNeedRight = '*';
  7. protected $layout = '';
  8. public function _initialize()
  9. {
  10. parent::_initialize();
  11. }
  12. /* 分类 */
  13. function index()
  14. {
  15. $cate=db('goods_cats')->where(['parent_id'=>0,'status'=>1])->order('id asc')->select();
  16. $this->view->assign("cate",$cate);
  17. return $this->fetch();
  18. }
  19. }