增加通知商超系统代码
This commit is contained in:
parent
e21c5e3ddf
commit
5a585b6b4e
@ -210,6 +210,9 @@ class LogisticsLogic extends BaseLogic
|
|||||||
'content' => '用户提交订单',
|
'content' => '用户提交订单',
|
||||||
'create_time' => time(),
|
'create_time' => time(),
|
||||||
]);
|
]);
|
||||||
|
//调用接口通知商超平台
|
||||||
|
$url = 'https://crmeb-test.shop.lihaink.cn/api/goods/take/'.$params['order_id'];
|
||||||
|
curl_post($url,[],['order_sn'=>$params['order_sn']]);
|
||||||
Logistics::commit();
|
Logistics::commit();
|
||||||
return ['code'=>1, 'msg'=>'操作成功','data'=>$courierInfo];
|
return ['code'=>1, 'msg'=>'操作成功','data'=>$courierInfo];
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -286,7 +289,7 @@ class LogisticsLogic extends BaseLogic
|
|||||||
return ['code'=>0, 'msg'=>'订单已被取消'];
|
return ['code'=>0, 'msg'=>'订单已被取消'];
|
||||||
}
|
}
|
||||||
//验证取件码
|
//验证取件码
|
||||||
if($logistics['user_take_code'] !== $params['take-code']) return ['code'=>0, 'msg'=>'取件码错误'];
|
if($logistics['user_take_code'] !== $params['take_code']) return ['code'=>0, 'msg'=>'取件码错误'];
|
||||||
//获取配送员信息
|
//获取配送员信息
|
||||||
$courier = Courier::field('nickname,mobile')->where('id', $logistics['courier_id'])->find();
|
$courier = Courier::field('nickname,mobile')->where('id', $logistics['courier_id'])->find();
|
||||||
//更改物流信息状态
|
//更改物流信息状态
|
||||||
|
@ -297,3 +297,25 @@ function format_amount($float)
|
|||||||
}
|
}
|
||||||
return $float;
|
return $float;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function curl_post($url,$headers,$data) {
|
||||||
|
//初始化curl
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch,CURLOPT_URL,$url);
|
||||||
|
//设置获取的信息以文件流的形式返回,而不是直接输出。
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
//设置头文件的信息作为数据流输出
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
|
||||||
|
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||||
|
//设置为post方式请求
|
||||||
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
|
//添加参数
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||||
|
//关闭请求资源
|
||||||
|
$output = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
"tencentcloud/tencentcloud-sdk-php": "^3.0",
|
"tencentcloud/tencentcloud-sdk-php": "^3.0",
|
||||||
"alibabacloud/client": "^1.5",
|
"alibabacloud/client": "^1.5",
|
||||||
"rmccue/requests": "^2.0",
|
"rmccue/requests": "^2.0",
|
||||||
"w7corp/easywechat": "^6.8"
|
"w7corp/easywechat": "^6.8",
|
||||||
|
"ext-curl": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/var-dumper": "^4.2",
|
"symfony/var-dumper": "^4.2",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user