很快,我的消息就作为最上面的字符串发出了。我想知道下面两个字符串中的一个能否解决我的issue数据没有不同值(val1/val2)的问题。
当前数据传递:
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“val1”:“3”,“val2”:“3”,“tags”:[{“category”:“Equipment”,“number”:“p0202”,“quantity”:“1”},{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”},{“category”:“Equipment”,“number”:“P02137”,“quantity”:“1”},{“类别”:“设备”,“编号”:“P02135”,“数量”:“1”}]}
方案a:
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“tags”:[{“category”:“Equipment”,“number”:“p0202”,“quantity”:“1”,“val1”:“3”,“val2”:“3”}]
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“tags”:[{“category”:“Equipment”,“number”:“P02137”,“quantity”:“1”,“val1”:“2”,“val2”:“2”}]
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“tags”:[{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”,“val1”:“1”,“val2”:“1”}]
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“tags”:[{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”,“val1”:“1”,“val2”:“1”}]
选项b:
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“tags”:[{“category”:“Equipment”,“number”:“p0202”,“quantity”:“1”,“val1”:“3”,“val2”:“3”},{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048,“tags”:[{“category”:“Equipment”,“number”:“P02137”,“quantity”:“1”,“val1”:“2”,“val2”:“2”},{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048,“tags”:[{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”,“val1”:“1”,“val2”:“1”},{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“tags”:[{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”,“val1”:“1”,“val2”:“1”}]
方案c:
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“val1”:“3”,“val2”:“3”,“tags”:[{“category”:“Equipment”,“number”:“p0202”,“quantity”:“1”,}]
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“val1”:“2”,“val2”:“2”,“tags”:[{“category”:“Equipment”,“number”:“P02137”,“quantity”:“1”}]
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“val1”:“1”,“val2”:“1”,“tags”:[{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”}]
{“messagetype”:“Transaction”,“companyname”:“c02”,“warehousename”:“wh2”,“dir”:“OUT”,“date”:“2016-02-23 14:48:57.048”,“val1”:“1”,“val2”:“1”,“tags”:[{“category”:“Equipment”,“number”:“P02135”,“quantity”:“1”}]
if(isset($_POST['DONE']) === true){
echo "Submitting";
$dataString = "val1=" . $_POST['val1'] . ",val2=" . $_POST['val2'];
// set post fields
$post = [
'submit' => 'true',
'activity_name' => 'DataSendOff',
'params' => [
'Data' => $dataAsAString
]
];
}
最佳答案
这是通过遍历并附加到“Equipment”标签来解决的。API开发人员也必须在他们的终端上修复一些东西。