/** * 收货地址编辑 */ public function actionUpdate() { $addr_id = $this->get('addr_id'); $f = isset($_REQUEST['f']) ? intval($_REQUEST['f']) : 0; $Addr = new ModelAddr(); if ($_POST) { $param['member_id'] = $this->member_id; $param['name'] = $this->post('consignee'); $param['mobile'] = $this->post('consigneeNo'); $param['area'] = $this->post('consigneeArea'); $param['addr'] = $this->post('consigneeAd'); $param['zip'] = $this->post('consigneePD'); $address_default_check = $this->post('address_default_check'); $address_default_old = $this->post('address_default_old'); $result = $Addr->AddrEdit($addr_id, $param, $address_default_check, $address_default_old); if ($result) { //清除如果是已经存在的地址缓存 $id = 'b2c-cart-product-set-' . $this->member_id; $cart_cache = Yii::app()->cache->get($id); if (!empty($cart_cache['addr'])) { if ($addr_id == $cart_cache['addr']['addr_id']) { $Addr->AddrSelect($this->member_id, $addr_id); } } } $this->redirect('/addr/index.html?f=' . $f); } $model = $Addr->AddrRow($addr_id); if (empty($model)) { $this->redirect('/addr/index.html?f=' . $f); } $model['f'] = $f; $model['province'] = $Addr->Regions(); $this->render('update', array('model' => $model)); }