|
@@ -995,7 +995,7 @@ class Orders extends Api{
|
|
|
// 接受参数
|
|
|
$id = request('id',0);
|
|
|
// 查询数据
|
|
|
- $order = $Model->query()->find($id,['id','pay_total','status','price_total','coupon_total','business_id','pay_total','weizan_orderid','insert_time']);
|
|
|
+ $order = $Model->query()->find($id,['id','snowflake_id as order_code','pay_total','status','price_total','coupon_total','business_id','pay_total','weizan_orderid','insert_time']);
|
|
|
// 查询不到订单
|
|
|
if( !$order ) return json_send(['code'=>'error','msg'=>'订单不存在']);
|
|
|
// 数据转换
|
|
@@ -1003,7 +1003,6 @@ class Orders extends Api{
|
|
|
// id转编号
|
|
|
$order['insert_time'] = date('Y-m-d H:i:s',$order['insert_time']);
|
|
|
$order['business_name'] = (string) $Business->getOne($order['business_id'],'name');
|
|
|
- $order['order_code'] = $Model->idToCode($order['id']);
|
|
|
$order['state'] = $Model->getState($order['status'],'state');
|
|
|
// 查询子订单数据
|
|
|
$order['order_items'] = $OrdersProduct->query()->where([['order_id','=',$id]])->select(['id as item_id','order_id','product_id','buy_num','pay_total','is_rebate','sku_attr_names as product_spec','product_name','product_thumb'])->get()->toArray();
|