订单详情接口支持商家查询

修改了订单详情接口的查询逻辑,增加商家查询功能。通过判断 is_mer 参数,决定是否包含 uid 在查询条件中。这使得商家也可以查询订单详情,扩展了接口的使用场景。
This commit is contained in:
mkm 2024-10-08 19:48:56 +08:00
parent c4f9320978
commit 2804910665

View File

@ -339,10 +339,17 @@ class OrderController extends BaseApiController
public function detail()
{
$order_id = (int)$this->request->get('order_id');
$where = [
'id' => $order_id,
'uid' => $this->userId,
];
$is_mer=$this->request->get('is_mer');
if($is_mer==1){
$where = [
'id' => $order_id,
];
}else{
$where = [
'id' => $order_id,
'uid' => $this->userId,
];
}
$url = 'https://' . $this->request->host(true);
$order = OrderLogic::detail($where, $url);
if ($order) {