|
|
@@ -766,6 +766,54 @@ $data=$user->toArray();
|
|
766
|
766
|
$count = Db::query($sql);
|
|
767
|
767
|
return count(explode(",",$count[0]['count'])) - 1;
|
|
768
|
768
|
}
|
|
|
769
|
+
|
|
|
770
|
+
|
|
|
771
|
+
|
|
|
772
|
+ /**
|
|
|
773
|
+ * 整合用户登录token
|
|
|
774
|
+ * @return mixed
|
|
|
775
|
+ * @author xaboy
|
|
|
776
|
+ * @day 2020/6/1
|
|
|
777
|
+ */
|
|
|
778
|
+ public function tokenList()
|
|
|
779
|
+ {
|
|
|
780
|
+ $user = $this->request->userInfo()->hidden(['account','label_id', 'group_id', 'pwd', 'card_id', 'last_time', 'last_ip', 'status', 'spread_time', 'real_name']);
|
|
|
781
|
+ $user->append(['service', 'user_group','total_consume', 'total_collect_product', 'total_collect_store', 'total_coupon', 'total_visit_product', 'total_unread']);
|
|
|
782
|
+ $userInfo = $user->toArray();
|
|
|
783
|
+
|
|
|
784
|
+ $data['mweb_info'] = $this->curl_java_login($userInfo['phone'])['data'];
|
|
|
785
|
+ $data['merchant_info'] = [];
|
|
|
786
|
+
|
|
|
787
|
+ return app('json')->success($data);
|
|
|
788
|
+ }
|
|
|
789
|
+
|
|
|
790
|
+
|
|
|
791
|
+
|
|
|
792
|
+ function curl_java_login($phone){
|
|
|
793
|
+ $curl = curl_init();
|
|
|
794
|
+ curl_setopt_array($curl, array(
|
|
|
795
|
+ CURLOPT_URL => 'http://shop.gdjbp.com/gateway/userCenter_service/userLogOnService/userPhoneLogOn',
|
|
|
796
|
+ CURLOPT_RETURNTRANSFER => true,
|
|
|
797
|
+ CURLOPT_ENCODING => '',
|
|
|
798
|
+ CURLOPT_MAXREDIRS => 10,
|
|
|
799
|
+ CURLOPT_TIMEOUT => 0,
|
|
|
800
|
+ CURLOPT_FOLLOWLOCATION => true,
|
|
|
801
|
+ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
|
802
|
+ CURLOPT_CUSTOMREQUEST => 'POST',
|
|
|
803
|
+ CURLOPT_POSTFIELDS =>'{"phone":'.$phone.',"sms_code":"9527","type":"1"}',
|
|
|
804
|
+ CURLOPT_HTTPHEADER => array(
|
|
|
805
|
+ 'Content-Type: application/json'
|
|
|
806
|
+ ),
|
|
|
807
|
+ ));
|
|
|
808
|
+ $response = curl_exec($curl);
|
|
|
809
|
+ curl_close($curl);
|
|
|
810
|
+ $response = json_decode($response, true);
|
|
|
811
|
+ return $response;
|
|
|
812
|
+ }
|
|
|
813
|
+
|
|
|
814
|
+
|
|
|
815
|
+
|
|
|
816
|
+
|
|
769
|
817
|
/**
|
|
770
|
818
|
* 获取用户信息
|
|
771
|
819
|
* @return mixed
|