|
|
|
@ -391,13 +391,13 @@ class ProductController extends AdminController |
|
|
|
return $form->response()->error('数据不存在'); |
|
|
|
} |
|
|
|
|
|
|
|
$exists_unfinished_order = Order::where([ |
|
|
|
$where = [ |
|
|
|
['product_id', '=', $form->getKey()], |
|
|
|
['status', '>', OrderStatus::UNPAID], |
|
|
|
['status', '<', OrderStatus::SUCCESS], |
|
|
|
['status', '<>', OrderStatus::REFUNDED], |
|
|
|
])->exists(); |
|
|
|
if ($exists_unfinished_order) { |
|
|
|
]; |
|
|
|
if (Order::where($where)->exists()) { |
|
|
|
return $form->response()->error('该产品存在未完成的订单,不允许删除'); |
|
|
|
} |
|
|
|
}); |
|
|
|
|