51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace app\store\controller\user;
|
|
|
|
use app\store\controller\BaseAdminController;
|
|
use app\api\lists\user\UserAddressList;
|
|
use app\api\logic\user\AddressLogic;
|
|
use app\api\validate\UserAddressValidate;
|
|
|
|
|
|
class AddressController extends BaseAdminController
|
|
{
|
|
public function lists(){
|
|
return $this->dataLists(new UserAddressList());
|
|
}
|
|
/**
|
|
* @notes 编辑地址
|
|
* @return \support\Response
|
|
* @author likeadmin
|
|
* @date 2024/4/24 10:37
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new UserAddressValidate())->post()->goCheck('edit');
|
|
AddressLogic::edit($params);
|
|
if(AddressLogic::hasError()){
|
|
return $this->fail(AddressLogic::getError());
|
|
}else{
|
|
return $this->success('编辑成功');
|
|
}
|
|
}
|
|
/**
|
|
* @notes 获取地址详情
|
|
* @return \support\Response
|
|
* @author likeadmin
|
|
* @date 2024/4/24 10:37
|
|
*/
|
|
public function detail()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$uid = $this->request->get('uid');
|
|
if($id){
|
|
$params = ['id' => $id];
|
|
}
|
|
if($uid){
|
|
$params = ['uid' => $uid];
|
|
}
|
|
return $this->success('获取成功',AddressLogic::info($params));
|
|
}
|
|
}
|