Files
addons
app_download_files
extend
hyhproject
admin
app
common
home
home2
mobile2
wechat2
behavior
common
conf
controller
Areas.php
Base.php
Brands.php
Carts.php
Cashconfigs.php
Cashdraws.php
Error.php
Favorites.php
Goods.php
Goodsappraises.php
Goodscats.php
Goodsconsult.php
Index.php
Invoices.php
Logmoneys.php
Messages.php
News.php
Ordercomplains.php
Orderrefunds.php
Orders.php
Shops.php
Switchs.php
Unionpays.php
Useraddress.php
Users.php
Userscores.php
Wallets.php
Weixin.php
Weixinpays.php
model
validate
view
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5436787D.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
qlg.tsgz.moe/hyhproject/wechat2/controller/Useraddress.php
2019-09-06 23:53:10 +08:00

62 lines
1.4 KiB
PHP
Executable File

<?php
namespace wstmart\wechat\controller;
use wstmart\common\model\UserAddress as M;
/**
* ============================================================================
* 用户地址控制器
*/
class UserAddress extends Base{
// 前置方法执行列表
protected $beforeActionList = [
'checkAuth'
];
/**
* 地址管理
*/
public function index(){
$m = new M();
$userId = session('WST_USER.userId');
$addressList = $m->listQuery($userId);
//获取省级地区信息
$area = model('WeChat/Areas')->listQuery(0);
$this->assign('area',$area);
$this->assign('list', $addressList);
$this->assign('type', (int)input('type'));
$this->assign('addressId', (int)input('addressId'));//结算选中的地址
return $this->fetch('users/useraddress/list');
}
/**
* 获取地址信息
*/
public function getById(){
$m = new M();
return $m->getById(input('post.addressId/d'));
}
/**
* 设置为默认地址
*/
public function setDefault(){
$m = new M();
return $m->setDefault();
}
/**
* 新增/编辑地址
*/
public function edits(){
$m = new M();
if((int)input('addressId')>0){
$rs = $m->edit();
}else{
$rs = $m->add();
}
return $rs;
}
/**
* 删除地址
*/
public function del(){
$m = new M();
return $m->del();
}
}