Commit 2e765cad authored by 蒋林's avatar 蒋林

测试文件

parent 4cfce545
.idea
/public/*
/application/controllers/test/*
/index.php
<?php
/**
* Created by PhpStorm.
* User: LinJiangL
* Date: 16/10/31
* Time: 上午10:25
*/
/**
* Class Chigo
*
* @property SourceChigo SourceChigo
* @property ReceiveChigo ReceiveChigo
*/
class Chigo extends BaseController
{
public static $testu = '';
public static $testp = '';
protected static $apiUrl = 'http://wxh.pp.cn/';
public function __construct()
{
//ini_set('display_errors', 1);
parent::__construct();
self::$apiUrl = "http://{$_SERVER['HTTP_HOST']}/";
$account = [
0 => ['u' => '0200145', 'p' => '123456'],
];
$key = 0;
self::$testu = $account[$key]['u'];
self::$testp = $account[$key]['p'];
}
public function test()
{
//$sobj = $this->sourceObj();
//$res = $sobj->CallAcceptAction();
//$this->show($res);
}
public function callAcceptAction()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'adat_begin' => '20161012',
'adat_end' => '20161102',
'mobile' => '',
'phone' => '',
'read_state' => '',
'ano' => '0020201610125742',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/chigo/callAcceptAction";
$result = curl_post($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
}
public function show($data)
{
echo "<pre>";
print_r($data);
}
private function sourceObj()
{
$account = [
'username' => self::$testu,
'pwd' => self::$testp
];
$this->load->library('Source/SourceChigo', $account, 'SourceChigo');
return $this->SourceChigo;
}
private function receiveObj()
{
$this->load->library('Receive/ReceiveChigo', null, 'ReceiveChigo');
return $this->ReceiveChigo;
}
}
\ No newline at end of file
This diff is collapsed.
<?php
/**
* Created by PhpStorm.
* User: LinJiangL
* Date: 16/10/17
* Time: 下午2:00
*/
/**
* Class Galanz
*
* @property SourceSuning SourceSuning
* @property ReceiveSuning ReceiveSuning
*/
class Suning extends BaseController
{
public static $testu = '';
public static $testp = '';
protected static $apiUrl = 'http://wxh.pp.cn/';
public function __construct()
{
//ini_set('display_errors', 1);
parent::__construct();
self::$apiUrl = "http://{$_SERVER['HTTP_HOST']}/";
$account = [
0 => ['u' => '深圳唯修汇科技有限公司', 'p' => 'weixiuhui2015'],
];
$key = 0;
self::$testu = $account[$key]['u'];
self::$testp = $account[$key]['p'];
}
public function test()
{
$sobj = $this->sourceObj();
$result = $sobj->ServiceOrderCondition(1);
var_dump($result);
}
public function selectServiceOrderCondition()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/suning/selectServiceOrderCondition";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function selectServiceOrder()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'mark' => '1',
'siteBp' => '904102',
'startTime' => '20161025',
'endTime' => '20161110',
'objectIds' => '',
'phone' => '13423871233',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/suning/selectServiceOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function serviceOrderCondition()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'type' => '1'
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/suning/serviceOrderCondition";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function serviceOrder()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'type' => '1',
'siteBp' => '904102',
'startTime' => '20161026',
'endTime' => '20161110',
'objectIds' => ''
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/suning/serviceOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function receiveServiceOrder()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'object' => '',
];
$object = [
[
'srvOrder' => '7215781123',
'processType' => 'ZS06'
]
];
$data['object'] = urlencode(json_encode($object));
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/suning/receiveServiceOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
private function show($data)
{
echo "<pre>";
print_r($data);
}
private function sourceObj()
{
$account = [
'username' => self::$testu,
'pwd' => self::$testp
];
$this->load->library('Source/SourceSuning', $account, 'SourceSuning');
return $this->SourceSuning;
}
private function receiveObj()
{
$this->load->library('Receive/ReceiveSuning', null, 'ReceiveSuning');
return $this->ReceiveSuning;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment