diff --git a/app/api/logic/user/AddressLogic.php b/app/api/logic/user/AddressLogic.php index e7861c3e5..9b54b1692 100644 --- a/app/api/logic/user/AddressLogic.php +++ b/app/api/logic/user/AddressLogic.php @@ -35,7 +35,13 @@ class AddressLogic extends BaseLogic 'uid' => $params['uid'], 'real_name' => $params['real_name'], 'phone' => $params['phone'], - 'detail' => $params['detail'], + 'province'=> $params['province'], + 'city' => $params['city'], + 'area' => $params['area'], + 'street' => $params['street'], + 'village' => $params['village'], + 'brigade' => $params['brigade'], + 'detail' => '', 'is_default' => $params['is_default'], ]); Db::commit(); diff --git a/app/api/validate/UserAddressValidate.php b/app/api/validate/UserAddressValidate.php index b7911da0e..0dbf68f86 100644 --- a/app/api/validate/UserAddressValidate.php +++ b/app/api/validate/UserAddressValidate.php @@ -21,7 +21,11 @@ class UserAddressValidate extends BaseValidate protected $rule = [ 'real_name' => 'require', 'phone' => 'require', - 'detail' => 'require', + 'city' => 'require', + 'area' => 'require', + 'street' => 'require', + 'village' => 'require', + 'brigade' => 'require', 'address_id' => 'require', "is_default"=>"require|in:0,1" @@ -38,7 +42,12 @@ class UserAddressValidate extends BaseValidate 'phone' => '收货人电话', 'detail' => '收货人详细地址', 'address_id' => '地址id', - "is_default"=>"默认地址" + "is_default"=>"默认地址", + 'city'=>'城市', + 'area'=>'区', + 'street'=>'街道', + 'village'=>'村', + 'brigade'=>'队' ]; @@ -51,7 +60,7 @@ class UserAddressValidate extends BaseValidate */ public function sceneAdd() { - return $this->only(['real_name','phone','detail']); + return $this->only(['real_name','phone','city','area','street','village','brigade']); } @@ -63,7 +72,7 @@ class UserAddressValidate extends BaseValidate */ public function sceneEdit() { - return $this->only(['real_name','phone','id']); + return $this->only(['real_name','phone','id','city','area','street','village','brigade']); }