public function save() { //$user_id $user_id = 2; if (IS_POST){ $shipping = D('Shipping'); if (!$shipping->create()){ $this->error($shipping->getError(),'',true); }else{ if (is_numeric($_POST['id'])){ if ($shipping->editAddress($_POST['id'])){ $this->success('地址修改成功','',true); }else{ $this->error('地址修改失败','',true); } }else{ if ($shipping->addAddress($user_id)){ $this->success('添加地址成功','',true); }else{ $this->error('添加地址失败','',true); } } } } }
微信小程序 增、删、改、查操作实例详解(4)
内容版权声明:除非注明,否则皆为本站原创文章。