|
|
@@ -16,17 +16,18 @@ class Adapter
|
|
|
* @return array
|
|
|
*/
|
|
|
public function syncUser($appid, $appUsername , $password){
|
|
|
- return array('code' => 1, 'msg'=>'');
|
|
|
+ //return array('code' => 1, 'msg'=>'');
|
|
|
|
|
|
$result = array('code'=>-1, 'msg'=>'');
|
|
|
if($appid == 1){//体育
|
|
|
- $config = ['name' => 'agentname', 'key' => 'agentkey', 'secret' => 'agentsecret'];
|
|
|
+ //$config = ['name' => 'dttes', 'key' => 'bf1f3678d5408390feb7a6ec2f014198', 'secret' => 'e2cd20b1ea965a6dac93c312a930436e'];
|
|
|
$proxy = new Sport();
|
|
|
- $proxy->Init($config);
|
|
|
+ $proxy->Init();
|
|
|
$ret = $proxy->caca($appUsername, $password);
|
|
|
- if($ret['key_error'] == 1){
|
|
|
+ $ret = json_decode($ret, true);
|
|
|
+ if($ret['status'] == 1){
|
|
|
$result = array('code'=>1, 'msg'=>'成功');
|
|
|
- }elseif ($ret['key_error'] == 3){
|
|
|
+ }elseif ($ret['data'] == 3){
|
|
|
$result = array('code'=>-3, 'msg'=>'用户名太长');
|
|
|
}else{
|
|
|
$result = array('code'=>-1, 'msg'=>'服务器繁忙');
|
|
|
@@ -34,7 +35,6 @@ class Adapter
|
|
|
}else{
|
|
|
$result = array('code'=>-100, 'msg'=>'应用不存在');
|
|
|
}
|
|
|
-
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
@@ -48,17 +48,19 @@ class Adapter
|
|
|
* @return array
|
|
|
*/
|
|
|
public function login($appid, $appUsername , $password, $money, $billno=''){
|
|
|
- return array('code' => 1, 'msg'=>'成功');
|
|
|
+ //return array('code' => 1, 'msg'=>'成功');
|
|
|
|
|
|
$result = array('code'=>-2, 'msg'=>'', 'data'=>array());
|
|
|
if($appid == 1){//体育
|
|
|
- $config = ['name' => 'agentname', 'key' => 'agentkey', 'secret' => 'agentsecret'];
|
|
|
$proxy = new Sport();
|
|
|
- $proxy->Init($config);
|
|
|
+ $proxy->Init();
|
|
|
$ret = $proxy->tg($appUsername, $password);
|
|
|
+ //'{"status":1,"msg":"登录成功","data":{"ret":0,"tokenold":"UUaCai15678500915d737e6b2bd90","token":"%7B%22img_url%22%3Anull%2C%22name%22%3A%22dttes_t1_jekonefs_a1%22%2C%22token%22%3A%22UUaCai15678500915d737e6b2bd90%22%2C%22cash%22%3A%220.00%22%7D","url":"http:\/\/sports.bocai108.com\/m\/jump.html?token=%7B%22img_url%22%3Anull%2C%22name%22%3A%22dttes_t1_jekonefs_a1%22%2C%22token%22%3A%22UUaCai15678500915d737e6b2bd90%22%2C%22cash%22%3A%220.00%22%7D"}}'
|
|
|
+ $ret = json_decode($ret, true);
|
|
|
if($ret['status'] == 1){
|
|
|
//转账
|
|
|
$ret2 = $proxy->ptc($appUsername, $password, $billno, $money, 'IN');
|
|
|
+ $ret2 = json_decode($ret2, true);
|
|
|
if($ret2['status'] == 1){
|
|
|
$result = array('code'=>1, 'msg'=>'成功', 'data'=>$ret['data']);
|
|
|
}else{
|