Example #1
0
 public function index()
 {
     //\Core\View::$title = '我的订单';
     $this->user = \Model\Authorize\Oauth::login_user();
     if (empty($this->user)) {
         redirect(\Core\URI::a2p(array('main' => 'home')));
     }
     $this->view->content = view('trade/index.php');
     $this->view->content->address = \DB\Account\Address::fetch(array('user_id' => $this->user->user_id));
     $goods_id = \Core\URI::kv('id');
     $nums = \Core\URI::kv('nums');
     $nums = abs(intval($nums));
     if (!empty($goods_id)) {
         $goods = \DB\Mall\Goods::row(array('goods_id' => $goods_id));
         if (empty($goods) || $nums < 1) {
             redirect(\Core\URI::a2p(array('main' => 'index')));
         } else {
             $this->view->content->count = array('total_fee' => $goods->goods_discount_price * $nums, 'total_nums' => $nums);
         }
     } else {
         $this->view->content->count = \Db\Trade\Cart::count_cart($this->user->user_id);
         if ($this->view->content->count['total_nums'] < 1) {
             redirect(\Core\URI::a2p(array('main' => 'index')));
         }
     }
 }
Example #2
0
 /**
  * 列表
  */
 public function index()
 {
     //\Core\View::$title = '我的地址';
     $this->view->content = view('address/index.php');
     $this->view->content->rows = \DB\Account\Address::fetch(array('user_id' => $this->user->user_id));
 }