供应商\经销商入驻地址省市区绑定
This commit is contained in:
parent
4c17b52852
commit
6ddac08056
@ -45,6 +45,17 @@ class IndexController extends BaseApiController{
|
|||||||
$shop_user_id= $this->get_x_token();
|
$shop_user_id= $this->get_x_token();
|
||||||
$post['shop_user_id']=$shop_user_id;
|
$post['shop_user_id']=$shop_user_id;
|
||||||
$find=Db::name('user_auth_shop')->where('shop_uid',$post['shop_user_id'])->find();
|
$find=Db::name('user_auth_shop')->where('shop_uid',$post['shop_user_id'])->find();
|
||||||
|
$city = Db::name('geo_city')->field('province_code,city_code')->where('city_name', 'like', '%' . $post['city_name'] . '%')->find();
|
||||||
|
if(empty($city)){
|
||||||
|
$post['province_id'] = '';
|
||||||
|
$post['city_id'] = '';
|
||||||
|
$post['area_id'] = '';
|
||||||
|
}else{
|
||||||
|
$post['province_id'] = $city['province_code'];
|
||||||
|
$post['city_id'] = $city['city_code'];
|
||||||
|
$area = Db::name('geo_area')->field('area_code')->where('city_code', $city['city_code'])->where('area_name', 'like', '%' . $post['area_name'] . '%')->find();
|
||||||
|
$post['area_id'] = !empty($area) ? $area['area_code'] : '';
|
||||||
|
}
|
||||||
if($post['is_merchant_type']==1){
|
if($post['is_merchant_type']==1){
|
||||||
if($find){
|
if($find){
|
||||||
$res=MerchantLogic::edit($post);
|
$res=MerchantLogic::edit($post);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user