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

测试文件

parent 4cfce545
.idea .idea
/public/* /public/*
/application/controllers/test/*
/index.php /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
<?php
/**
* Created by PhpStorm.
* User: LinJiangL
* Date: 16/8/23
* Time: 下午1:58
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* 接口测试
*
* @property SourceGalanz SourceGalanz
* @property ReceiveGalanz ReceiveGalanz
*/
class Galanz extends BaseController
{
public static $testu = '';
public static $testp = '';
protected static $apiUrl = '';
public function __construct()
{
//ini_set('display_errors', 1);
parent::__construct();
// self::$testu = 'R75510005';
// self::$testp = 'dgqh!769'; //urlencode(str_aes('weixiuhui010'))
self::$apiUrl = "http://{$_SERVER['HTTP_HOST']}/";
$account = [
0 => ['u' => 'R75510005', 'p' => 'dgqh!769'],
1 => ['u' => 'K75516022', 'p' => '123456'],
2 => ['u' => 'W75509345', 'p' => 'dgqh!769'],
3 => ['u' => 'C75500035', 'p' => 'dgqh!769'],
4 => ['u' => 'c01000005', 'p' => 'weixiuhui010'],
5 => ['u' => 'C75500027', 'p' => 'szwxh!755'],
6 => ['u' => 'R75500046', 'p' => 'szwxh!755'],
7 => ['u' => 'c02000043', 'p' => 'weixiuhui09'],
8 => ['u' => 'R75510005', 'p' => 'dgqh!769'],
9 => ['u' => 'W75509335', 'p' => 'szwxh!755'],
];
$key = 3;
self::$testu = $account[$key]['u'];
self::$testp = $account[$key]['p'];
//self::$testp = urlencode(str_aes($account[5]['p']));
}
public function test()
{
$sobj = $this->sourceGalanzObj();
$order = $sobj->SearchOrder();
print_r($order);
}
public function ccc()
{
$file = PUBDIR . "captcha/galanz_". self::$testu .".gif";
echo $file;
echo get_uuapi($file);
}
public function mail()
{
$code = phone_code();
// $mbox = imap_open("{pop.163.com:995/pop3/ssl}INBOX", "wxh__8888@163.com", "WXH888888");
//
// $num = imap_num_msg($mbox);
//
// $body = imap_base64(imap_fetchbody($mbox, imap_num_msg($mbox), 1));
// //$body = iconv('utf8', 'gbk', $body);
//
// imap_close($mbox);
var_dump($code);
}
public function searchOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'name' => '',
'custmobile' => '',
'finishstatus' => '',
'acceptstatus' => '',
'callintype' => '',
'starttime' => '',
'endtime' => '',
'isreminder' => '',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/searchOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function searchWorkOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'name' => '',
'custmobile' => '',
'producenumber' => '',
'approvalstatus' => '1',
'ischangepart' => '',
'returnfactory' => '',
'isrelief' => '',
'starttime' => '',
'endtime' => '',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/searchWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function searchUserProfieOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'custmobile' => '',
'status' => '1',
'investstatus' => '',
'havadetail' => '',
'isuseful' => '',
'jiesuanstatus' => '',
'producenumber' => '',
'installstarttime' => '',
'installendtime' => '',
'inputstarttime' => '',
'inputendtime' => '',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/searchUserProfieOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function queryOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['id'] = 'e8ed9016-d621-45b3-9015-60fc3de89833';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function queryWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['id'] = '2d295d3e-90f4-4026-82af-30b38f99a020';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function queryUserProfileOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['id'] = 'f4e71c00-be89-464d-afd0-e4566287617a';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryUserProfileOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function acceptOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['out_trade_no'] = 'CALL2016091202257';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/acceptOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function createUserProfileOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['out_trade_no'] = 'CALL2016092102853';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/createUserProfileOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function saveOrder()
{
$obj = $this->galanzObj();
$time = strtotime('2016/09/12 16:30');
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'out_trade_no' => 'CALL2016091202257',
'sitecontacttime' => $time,
'siteappointmenttime' => $time,
'actualvisittime' => $time,
'isguaranty' => '0',
'finishstatus' => '1',
'unfinishreason' => '',
'complete_reason' => '1',
'sitedealremarks' => urlencode('已完工'),
'servicePersonnel' => urlencode('俞国华'),
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/saveOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function addProdWorkOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'id' => '2d295d3e-90f4-4026-82af-30b38f99a020',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/addProdWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function addErrorWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['work_order_no'] = 'WO2016090802059';
$data['chk'] = '660a64fd-fad0-4de5-ac35-3cf03e078e48';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/addErrorWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function delPartsWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['work_order_no'] = 'WO2016091201130';
$data['chk'] = '0436e21c-2ed5-4c52-824e-93a2a5b45108';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/delPartsWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function delErrorWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['work_order_no'] = 'WO2016090703635';
$data['chk'] = 'b66480af-9ebc-4b7b-8308-00cb26efa194';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/delErrorWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function delProdWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['work_order_no'] = 'WO2016090703635';
$data['chk'] = 'b4d19534-53a7-4ba8-9f21-0a82ea28f033';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/delProdWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function lookupErrormModule()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['workorderproductid'] = '5ad37132-da70-452a-a91a-119bfff70b28';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/lookupErrormModule";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function lookupErrorGroup()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['errormoduleid'] = '1fcb2508-d161-e411-80cb-00155d016a1c';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/lookupErrorGroup";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function lookupErrorSolution()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['errorgroupid'] = '2c27e484-924e-4168-a01e-3b7ca5a42241';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/lookupErrorSolution";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function lookupProductByGroup()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['productgroupid'] = '5a9e674f-13f6-e311-af25-000c297a69b9';
$data['productname'] = '微波炉P70D10EP';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/lookupProductByGroup";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function getProductTypeById()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['id'] = '66d07939-8c72-478f-a586-b4956b92b1af';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/getProductTypeById";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function addPartsWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['id'] = '2d295d3e-90f4-4026-82af-30b38f99a020';
$data['chk'] = '8b4eb298-8863-4452-9cc3-fcbbfb4b4c1e';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/addPartsWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function saveWorkOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'work_order_no' => 'WO2016092002698',
'custname' => '',
'custmobile' => '',
'address' => '',
'shipdate' => strtotime('2015-05-18'),
'broughtdate' => '',
'installdate' => '',
'visittime' => '',
'actualvisittime' => strtotime('2016-09-12 16:00:00'),
'finishtime' => '',
'repairapply' => '',
'fault' => '',
'parts' => '',
];
// $machine = [
// 'chk' => '5e287744-896f-477b-a2cd-e74ea21126e1',
// 'producttypeid' => '4a1cc115-875b-e411-80cb-00155d017501',
// 'producttypeidName' => '微波炉',
// 'productmodelid' => 'adb078d7-875b-e411-80cb-00155d017501',
// 'productmodelidName' => '微波炉',
// 'productnumber' => '112100100001',
// 'modelnumber' => '微波炉P70D10EP-QA(S0)',
// ];
// $fault = [
// 'chk' => 'de1f6e4c-2947-41dc-91aa-a8b69b384186',
// 'errormoduleid' => '1fcb2508-d161-e411-80cb-00155d016a1c',
// 'errormoduleidName' => '不能制冷',
// 'errorgroupid' => '2c27e484-924e-4168-a01e-3b7ca5a42241',
// 'errorgroupidName' => '压缩机端子破裂',
// 'errorsolutionid' => '7797093e-34b2-48b6-a623-df766beb951d',
// 'errorsolutionidName' => '更换压缩机',
// ];
// $parts = [
// 'chk' => '0436e21c-2ed5-4c52-824e-93a2a5b45108',
// 'errorpartsid' => '6281df61-575b-46d2-b755-274a7840f75a',
// 'errorpartsidName' => '1.5P变频松下压缩机\5RS102ZBE21 [R75/6.53/9.7/7.9kg]',
// 'partsid' => '6281df61-575b-46d2-b755-274a7840f75a',
// 'partsidName' => '1.5P变频松下压缩机\5RS102ZBE21 [R75/6.53/9.7/7.9kg]',
// 'qty' => '2',
// ];
//$data['machine'] = urlencode(json_encode($machine));
//$data['fault'] = urlencode(json_encode($fault));
//$data['parts'] = urlencode(json_encode($parts));
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/saveWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function sendWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['work_order_no'] = 'WO2016092002698';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/sendWorkOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function saveUserProfileOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'id' => '1650bb3a-46b0-408c-9694-6549a8d9d068',
'cardno' => '0',
'contactname' => '', //姓名
'mobile' => '', //手机
'telephone' => '', //电话
'accountaddr' => '', //地址
'email' => '', //邮箱
'broughtdate' => strtotime('2016-08-02 17:34:30'), //购买时间
'installdate' => strtotime('2016-08-05 11:17:41'), //安装时间
'appointmenttime' => strtotime('2016-08-05 11:17:41'), //上门时间
'salesite' => '', //商场
'installer' => '', //安装人员
'goldcard' => '', //金卡
'remarks' => '', //备注
'qualityresult' => '',
'custadvice' => '', //顾客意见
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/saveUserProfileOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function sendUserProfileOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'id' => '1650bb3a-46b0-408c-9694-6549a8d9d068',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/sendUserProfileOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function addProductsUserProfileOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'id' => '1650bb3a-46b0-408c-9694-6549a8d9d068',
'producenumber' => '16Y101100021481'
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/addProductsUserProfileOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function delProductsUserProfileOrder()
{
$obj = $this->galanzObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'id' => '1650bb3a-46b0-408c-9694-6549a8d9d068',
'chk' => '22c31a3c-4d2c-48db-a12c-8be13602c926'
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/delProductsUserProfileOrder";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
private function galanzObj()
{
$this->load->library('Receive/ReceiveGalanz', null, 'ReceiveGalanz');
return $this->ReceiveGalanz;
}
private function sourceGalanzObj()
{
$account = [
'username' => self::$testu,
'pwd' => self::$testp
];
$this->load->library('Source/SourceGalanz', $account, 'SourceGalanz');
return $this->SourceGalanz;
}
private function show($data)
{
echo "<pre>";
print_r($data);
}
}
\ No newline at end of file
<?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