|
@@ -68,6 +68,7 @@ class Custom extends Api{
|
|
'username'=>$custom['username'],
|
|
'username'=>$custom['username'],
|
|
'userpic'=>$custom['userpic'],
|
|
'userpic'=>$custom['userpic'],
|
|
'phone'=>$custom['phone'],
|
|
'phone'=>$custom['phone'],
|
|
|
|
+ 'is_manager'=>$custom['is_manager'],
|
|
'company_id'=>1, // 无需验证资质
|
|
'company_id'=>1, // 无需验证资质
|
|
'show_price'=>$cityId?1:0, // 是否选择了城市处理
|
|
'show_price'=>$cityId?1:0, // 是否选择了城市处理
|
|
'city_id'=>$cityId,
|
|
'city_id'=>$cityId,
|
|
@@ -103,5 +104,30 @@ class Custom extends Api{
|
|
return json_send(['code'=>'success','msg'=>'保存成功','data'=>['city_id'=>$cityId]]);
|
|
return json_send(['code'=>'success','msg'=>'保存成功','data'=>['city_id'=>$cityId]]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 设置信息 /api/custom/get_city
|
|
|
|
+ *
|
|
|
|
+ * @param string $code 授权码
|
|
|
|
+ *
|
|
|
|
+ * */
|
|
|
|
+ public function get_city(Request $request,Model $Model,City $City){
|
|
|
|
+ // 接口验签
|
|
|
|
+ // $this->verify_sign();
|
|
|
|
+ // 验证参数
|
|
|
|
+ $request->scene('get_city')->validate();
|
|
|
|
+ // 检查登录
|
|
|
|
+ $uid = $this->checkLogin();
|
|
|
|
+ // 查询用户
|
|
|
|
+ $custom = $Model->getOne($uid);
|
|
|
|
+ // 用户不存在
|
|
|
|
+ if( empty($custom) ) return json_send(['code'=>'success','msg'=>'获取成功','data'=>['province'=>'','city'=>'']]);
|
|
|
|
+ // 获取城市ID
|
|
|
|
+ $cityId = $custom['city_id'];
|
|
|
|
+ $cityName = $City->getOne($cityId,'name');
|
|
|
|
+ $pid = $City->getOne($cityId,'pid');
|
|
|
|
+ $province = $City->getOne($pid,'name');
|
|
|
|
+ // 返回结果
|
|
|
|
+ return json_send(['code'=>'success','msg'=>'获取成功','data'=>['province'=>(string)$province,'city'=>(string)$cityName]]);
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|