request->params([ ["type",""] ]); return success((new AddressService())->getList($data)); } /** * 会员收货地址详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new AddressService())->getInfo($id)); } /** * 添加会员收货地址 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["name",""], ["mobile",""], ["province_id",0], ["city_id",0], ["district_id",0], ["address",""], ["address_name", ""], ["full_address",""], ["lng",""], ["lat",""], ["is_default",0], ["type",''] ]); $this->validate($data, 'app\validate\member\Address.add'); $id = (new AddressService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 会员收货地址编辑 * @param $id 会员收货地址id * @return \think\Response */ public function edit($id){ $data = $this->request->params([ ["name",""], ["mobile",""], ["province_id",0], ["city_id",0], ["district_id",0], ["address",""], ["address_name", ""], ["full_address",""], ["lng",""], ["lat",""], ["is_default",0], ["type",''] ]); $this->validate($data, 'app\validate\member\Address.edit'); (new AddressService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 会员收货地址删除 * @param $id 会员收货地址id * @return \think\Response */ public function del(int $id){ (new AddressService())->del($id); return success('DELETE_SUCCESS'); } }