|
@@ -32,116 +32,11 @@ class User extends Api
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * @title 收货地址列表
|
|
|
- * @desc 我的收货地址
|
|
|
- * @url /api/User/my_address
|
|
|
- * @method POST
|
|
|
- * @tag 基础
|
|
|
- * @header name:Authorization require:1 default: desc:验证token
|
|
|
-
|
|
|
- * @param name:page type:int require:0 default:1 desc:
|
|
|
- * @param name:limit type:int require:0 default:10 desc:
|
|
|
- */
|
|
|
- public function my_address(){
|
|
|
- $user_id = $this->check_login();
|
|
|
- $Nowpage = input('page',1);
|
|
|
- $limits = input("limit",10);
|
|
|
- $result = Users::MyAddress($user_id,$Nowpage,$limits);
|
|
|
- $this->success('成功',$result['data']);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * @title 添加、修改收货地址
|
|
|
- * @desc 添加、修改收货地址
|
|
|
- * @url /api/User/add_edit_address
|
|
|
- * @method POST
|
|
|
- * @tag 基础
|
|
|
- * @header name:Authorization require:1 default: desc:验证token
|
|
|
-
|
|
|
- * @param name:name type:string require:1 default: desc:收货人姓名
|
|
|
- * @param name:phone type:string require:1 default: desc:手机号
|
|
|
- * @param name:province type:string require:1 default: desc:省
|
|
|
- * @param name:city type:string require:1 default: desc:市
|
|
|
- * @param name:area type:string require:1 default: desc:区
|
|
|
- * @param name:address type:string require:1 default: desc:具体地址
|
|
|
- * @param name:is_default type:int require:0 default:0 desc:默认地址1:默认0:否
|
|
|
- * @param name:jd type:string require:0 default:0 desc:经度
|
|
|
- * @param name:wd type:string require:0 default:0 desc:纬度
|
|
|
- * @param name:address_id type:int require:0 default:0 desc:收货地址ID,有则修改,无则添加
|
|
|
- */
|
|
|
- public function add_edit_address(){
|
|
|
- $user_id = $this->check_login();
|
|
|
- $data['name'] = input('name'); //收货人姓名
|
|
|
- $data['phone'] = input('phone'); //手机号
|
|
|
- $data['province'] = input('province'); //省
|
|
|
- $data['city'] = input('city'); //市
|
|
|
- $data['area'] = input('area'); //区
|
|
|
- $data['address'] = input('address'); //具体地址
|
|
|
- $data['is_default'] = input('is_default',0); //默认地址 1:默认
|
|
|
- $data['jd'] = input('jd'); //经度
|
|
|
- $data['wd'] = input('wd'); //纬度
|
|
|
- $address_id = intval(input('address_id')); //收货地址ID 有则修改,无则添加
|
|
|
- if (!$data['name'] || !$data['phone'] || !$data['province'] || !$data['city'] || !$data['area'] || !$data['address']) $this->error('参数错误');
|
|
|
- if (!Validate::regex($data['phone'], "^1\d{10}$")) $this->error('手机号格式错误');
|
|
|
- $result = Users::AddEditAddress($user_id,$data,$address_id);
|
|
|
- if ($result['code']){
|
|
|
- $this->success($result['msg']);
|
|
|
- }else{
|
|
|
- $this->error($result['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * @title 设为默认地址
|
|
|
- * @desc 设为默认地址
|
|
|
- * @url /api/User/set_address_default
|
|
|
- * @method POST
|
|
|
- * @tag 基础
|
|
|
- * @header name:Authorization require:1 default: desc:验证token
|
|
|
-
|
|
|
- * @param name:address_id type:int require:1 default:1 desc:地址ID
|
|
|
- */
|
|
|
- public function set_address_default(){
|
|
|
- $user_id = $this->check_login();
|
|
|
- $address_id = intval(input('address_id')); //地址ID
|
|
|
- if (!$address_id) $this->error('地址ID为空');
|
|
|
- $result = Users::SetAddressDefault($user_id,$address_id);
|
|
|
- if ($result['code']){
|
|
|
- $this->success($result['msg']);
|
|
|
- }else{
|
|
|
- $this->error($result['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @title 删除地址
|
|
|
- * @desc 删除地址
|
|
|
- * @url /api/User/del_address
|
|
|
- * @method POST
|
|
|
- * @tag 基础
|
|
|
- * @header name:Authorization require:1 default: desc:验证token
|
|
|
-
|
|
|
- * @param name:address_id type:int require:1 default:1 desc:地址ID
|
|
|
- */
|
|
|
- public function del_address(){
|
|
|
- $user_id = $this->check_login();
|
|
|
- $address_id = intval(input('address_id')); //地址ID
|
|
|
- if (!$address_id) $this->error('地址ID为空');
|
|
|
- $result = Users::DelAddress($user_id,$address_id);
|
|
|
- if ($result['code']){
|
|
|
- $this->success($result['msg']);
|
|
|
- }else{
|
|
|
- $this->error($result['msg']);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
- * @title 修改个人资料
|
|
|
- * @desc 修改个人资料
|
|
|
- * @url /api/User/edit_user_info
|
|
|
+ * @title 提交个人资料
|
|
|
+ * @desc 提交个人资料
|
|
|
+ * @url /api/User/info_submit_audit
|
|
|
* @method POST
|
|
|
* @tag 基础
|
|
|
* @header name:Authorization require:1 default: desc:验证token
|
|
@@ -149,10 +44,10 @@ class User extends Api
|
|
|
* @param name:headimg type:string require:0 default:1 desc:头像
|
|
|
* @param name:nickname type:string require:0 default:1 desc:昵称
|
|
|
*/
|
|
|
- public function edit_user_info(){
|
|
|
+ public function info_submit_audit(){
|
|
|
$user_id = $this->check_login();
|
|
|
$data = input();
|
|
|
- $result = Users::EditUserInfo($user_id,$data);
|
|
|
+ $result = Users::InfoSubmitAudit($user_id,$data);
|
|
|
if ($result['code']){
|
|
|
$this->success($result['msg']);
|
|
|
}else{
|