|
|
@ -41,9 +41,10 @@ class Order extends Controller |
|
|
|
public function list(string $dataType): Json |
|
|
|
public function list(string $dataType): Json |
|
|
|
{ |
|
|
|
{ |
|
|
|
$model = new OrderModel; |
|
|
|
$model = new OrderModel; |
|
|
|
$list = $model->getList($dataType); |
|
|
|
$result = $model->getList($dataType); |
|
|
|
if (!empty($list['data'])) { |
|
|
|
$data = $result->items(); |
|
|
|
foreach ($list['data'] as $key => $value) { |
|
|
|
if (!empty($data)) { |
|
|
|
|
|
|
|
foreach ($data as $key => $value) { |
|
|
|
$copy_text = "订单号:{$value['order_no']}\n"; |
|
|
|
$copy_text = "订单号:{$value['order_no']}\n"; |
|
|
|
foreach ($value['goods'] as $good) { |
|
|
|
foreach ($value['goods'] as $good) { |
|
|
|
$copy_text .= "商品名称:{$good['goods_name']}\n"; |
|
|
|
$copy_text .= "商品名称:{$good['goods_name']}\n"; |
|
|
@ -64,9 +65,13 @@ class Order extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
$copy_text .= "收件地址:$address{$value['address']['detail']}\n"; |
|
|
|
$copy_text .= "收件地址:$address{$value['address']['detail']}\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
$list['data'][$key]['copy_text'] = $copy_text; |
|
|
|
$data[$key]['copy_text'] = $copy_text; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$list['current_page'] = $result->currentPage(); |
|
|
|
|
|
|
|
$list['last_page'] = $result->lastPage(); |
|
|
|
|
|
|
|
$list['total'] = $result->total(); |
|
|
|
|
|
|
|
$list['data'] = $data; |
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|