|
@@ -255,12 +255,18 @@ class Model_logic_order extends Lin_Model {
|
|
|
|
|
|
//根据提交信息 校验一下客户下单是否正确
|
|
|
public function checkEditCustomer($post){
|
|
|
- if($post['express'] == 2 && strlen($post['zipcode']) != 5)//如果usps 邮编不是5位
|
|
|
+
|
|
|
+ if($post['country'] == 192 )
|
|
|
{
|
|
|
- return [
|
|
|
- 'code'=>-1,
|
|
|
- "msg"=>"USPS-USA的邮编需按5位数格式提交!"
|
|
|
- ];
|
|
|
+ //如果国家是美国 邮编只能是字符串为5位的数字
|
|
|
+ $pattern = '/^\d{5}$/';
|
|
|
+ if(!preg_match($pattern, $post['zipcode'])){
|
|
|
+ return [
|
|
|
+ 'code'=>-1,
|
|
|
+ "msg"=>"美国的邮编需按5位数格式提交!"
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if($post['type'] != 5 && in_array($post['express'],[2,63,64]))
|
|
|
{
|