Showing
3 changed files
with
21 additions
and
1 deletions
@@ -4,6 +4,7 @@ namespace LibModels\Wap\Home; | @@ -4,6 +4,7 @@ namespace LibModels\Wap\Home; | ||
4 | 4 | ||
5 | use Api\Sign; | 5 | use Api\Sign; |
6 | use Api\Yohobuy; | 6 | use Api\Yohobuy; |
7 | +use Plugin\Helpers; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 购物车的数据模型 | 10 | * 购物车的数据模型 |
@@ -382,6 +383,9 @@ class CartData | @@ -382,6 +383,9 @@ class CartData | ||
382 | $param = Yohobuy::param(); | 383 | $param = Yohobuy::param(); |
383 | $param['debug'] = 'Y'; | 384 | $param['debug'] = 'Y'; |
384 | $param['client_type'] = 'h5'; // 需要ERP统计WAP的下单量 | 385 | $param['client_type'] = 'h5'; // 需要ERP统计WAP的下单量 |
386 | + if(Helpers::is_weixin()) { | ||
387 | + $param['client_type'] = 'weixin'; | ||
388 | + } | ||
385 | $param['private_key'] = Yohobuy::$privateKeyList['android']; // H5默认使用Android的私钥 | 389 | $param['private_key'] = Yohobuy::$privateKeyList['android']; // H5默认使用Android的私钥 |
386 | $param['method'] = 'app.Shopping.submit'; | 390 | $param['method'] = 'app.Shopping.submit'; |
387 | $param['address_id'] = $addressId; | 391 | $param['address_id'] = $addressId; |
@@ -4,6 +4,7 @@ namespace LibModels\Wap\Passport; | @@ -4,6 +4,7 @@ namespace LibModels\Wap\Passport; | ||
4 | 4 | ||
5 | use Api\Sign; | 5 | use Api\Sign; |
6 | use Api\Yohobuy; | 6 | use Api\Yohobuy; |
7 | +use Plugin\Helpers; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 绑定手机号 数据模型 | 10 | * 绑定手机号 数据模型 |
@@ -28,7 +29,7 @@ class BindData | @@ -28,7 +29,7 @@ class BindData | ||
28 | */ | 29 | */ |
29 | public static function bindCheck($mobile, $openId, $sourceType, $area) | 30 | public static function bindCheck($mobile, $openId, $sourceType, $area) |
30 | { | 31 | { |
31 | - $param = Yohobuy::param(); | 32 | + $param = Yohobuy::param(); |
32 | $param['method'] = 'app.passport.signCheck'; | 33 | $param['method'] = 'app.passport.signCheck'; |
33 | $param['area'] = $area; | 34 | $param['area'] = $area; |
34 | $param['mobile'] = $mobile; | 35 | $param['mobile'] = $mobile; |
@@ -85,6 +86,9 @@ class BindData | @@ -85,6 +86,9 @@ class BindData | ||
85 | { | 86 | { |
86 | $param = Yohobuy::param(); | 87 | $param = Yohobuy::param(); |
87 | 88 | ||
89 | + if(Helpers::is_weixin()) { | ||
90 | + $param['client_type'] = 'weixin'; | ||
91 | + } | ||
88 | $param['method'] = 'app.passport.bind'; | 92 | $param['method'] = 'app.passport.bind'; |
89 | $param['mobile'] = $mobile; | 93 | $param['mobile'] = $mobile; |
90 | $param['open_id'] = $openId; | 94 | $param['open_id'] = $openId; |
@@ -995,4 +995,16 @@ class Helpers | @@ -995,4 +995,16 @@ class Helpers | ||
995 | } | 995 | } |
996 | return $para_filter; | 996 | return $para_filter; |
997 | } | 997 | } |
998 | + | ||
999 | + | ||
1000 | + /** | ||
1001 | + * 判断是否是微信客户端 | ||
1002 | + * @return boolean | ||
1003 | + */ | ||
1004 | + public static function is_weixin(){ | ||
1005 | + if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false ) { | ||
1006 | + return true; | ||
1007 | + } | ||
1008 | + return false; | ||
1009 | + } | ||
998 | } | 1010 | } |
-
Please register or login to post a comment