更新订单状态

This commit is contained in:
yaooo 2023-08-25 10:57:05 +08:00
parent 9319ea1f27
commit 5022a621c4

View File

@ -643,30 +643,7 @@ class StoreOrderRepository extends BaseRepository
$order->presell_price = $order->pay_price; $order->presell_price = $order->pay_price;
} }
} }
$order->order_status = $this->getOrderStatusV2($order);
// 状态处理
$order->order_status = 0;
if ($order->paid == 0) {
$order->order_status = 1;
}
if ($order->paid == 1 && $order->status == 0) {
$order->order_status = 2;
}
if ($order->status == 1) {
$order->order_status = 3;
}
if ($order->status == 2) {
$order->order_status = 4;
}
if ($order->status == 3) {
$order->order_status = 5;
}
if ($order->status == -1) {
$order->order_status = 6;
}
if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) {
$order->order_status = 7;
}
return $order; return $order;
} }
@ -1771,36 +1748,40 @@ class StoreOrderRepository extends BaseRepository
} }
} }
$order->takeOrderCount = count($order['takeOrderList']); $order->takeOrderCount = count($order['takeOrderList']);
$order->order_status = $this->getOrderStatusV2($order);
// 订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销 8已支付
$order->order_status = 0;
if ($order->paid == 0) {
$order->order_status = 1;
}
if ($order->paid == 1 && $order->status == 0) {
$order->order_status = 2;
}
if ($order->status == 1) {
$order->order_status = 3;
}
if ($order->status == 2) {
$order->order_status = 4;
}
if ($order->status == 3) {
$order->order_status = 5;
}
if ($order->status == -1) {
$order->order_status = 6;
}
if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) {
$order->order_status = 7;
}
unset($order['takeOrderList'], $order->interest); unset($order['takeOrderList'], $order->interest);
} }
return compact( 'count','list', 'where'); return compact( 'count','list', 'where');
} }
public function getOrderStatusV2($order) {
// 订单状态 1 未支付 2待发货 3待收货 4待评价 5交易完成 6已退款 7待核销
$order->order_status = 0;
if ($order->paid == 0) {
$order->order_status = 1;
}
if ($order->paid == 1 && $order->status == 0) {
$order->order_status = 2;
}
if ($order->status == 1) {
$order->order_status = 3;
}
if ($order->status == 2) {
$order->order_status = 4;
}
if ($order->status == 3) {
$order->order_status = 5;
}
if ($order->status == -1) {
$order->order_status = 6;
}
if ($order->paid == 1 && $order->status == 0 && $order->order_type == 1) {
$order->order_status = 7;
}
return $order->order_status;
}
public function userList($uid, $page, $limit) public function userList($uid, $page, $limit)
{ {
$query = $this->dao->search([ $query = $this->dao->search([