|
|
@@ -33,6 +33,9 @@ class ProductController extends BaseController
|
|
|
$id = $get['id'] ?? 0;
|
|
|
$info = ProductClass::getById($id, true);
|
|
|
ProductClass::check($info, $this->mainId);
|
|
|
+ if ($info->stock > 0) {
|
|
|
+ util::fail('没有库存才能停止预售');
|
|
|
+ }
|
|
|
$info->presell = 0;
|
|
|
$info->presellDate = '';
|
|
|
$info->save();
|