Browse Source

虚拟库存

shish 1 năm trước cách đây
mục cha
commit
6fa410de5a
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      console/controllers/LiveController.php

+ 4 - 0
console/controllers/LiveController.php

@@ -3,6 +3,7 @@
 namespace console\controllers;
 
 use bizGhs\live\classes\LiveSeatClass;
+use bizGhs\product\classes\ProductClass;
 use common\components\util;
 use yii\console\Controller;
 use Yii;
@@ -17,6 +18,9 @@ class LiveController extends Controller
         } else {
             $mainId = 644;
         }
+
+        ProductClass::updateByCondition(['mainId' => $mainId], ['stock' => 99999, 'virtualStock' => 1]);
+
         $has = LiveSeatClass::getByCondition(['mainId' => $mainId], true);
         if (!empty($has)) {
             util::stop('已经有了');