| 1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\shop\controller;
- use app\common\controller\Frontend;
- class Cart extends Frontend{
-
- protected $noNeedLogin = [''];
- protected $noNeedRight = '*';
- protected $layout = '';
-
- public function _initialize()
- {
- parent::_initialize();
- }
- /* 分类 */
- function index()
- {
- $cart=db('goods_cart')->where(['userid'=>$this->auth->id])->order('id asc')->select();
- if(empty($cart))
- {
- return $this->fetch('emptycart');
- }
- db('goods_cart')->where(['userid'=>$this->auth->id])->update(['isselected'=>0]);
-
- $this->view->assign("cart",$cart);
- return $this->fetch();
- }
- }
|