Răsfoiți Sursa

更新脚本

shish 1 an în urmă
părinte
comite
f609999aa3

+ 16 - 0
biz-ghs/live/classes/LiveSeatClass.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace bizGhs\live\classes;
+
+use bizGhs\base\classes\BaseClass;
+use bizGhs\custom\classes\CustomClass;
+use common\components\imgUtil;
+use common\components\orderSn;
+use common\components\util;
+
+class LiveSeatClass extends BaseClass
+{
+
+    public static $baseFile = '\bizGhs\live\models\LiveSeat';
+
+}

+ 14 - 0
biz-ghs/live/models/LiveSeat.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace bizGhs\live\models;
+use bizGhs\base\models\Base;
+
+class LiveSeat extends Base
+{
+
+    public static function tableName()
+    {
+        return 'xhLiveSeat';
+    }
+
+}

+ 35 - 0
console/controllers/LiveController.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace console\controllers;
+
+use bizGhs\live\classes\LiveSeatClass;
+use common\components\util;
+use yii\console\Controller;
+use Yii;
+
+class LiveController extends Controller
+{
+
+    public $sjId, $shopId, $sj;
+
+    public function actionSeat()
+    {
+        if (getenv('YII_ENV') == 'production') {
+            $mainId = 33852;
+        } else {
+            $mainId = 644;
+        }
+        $has = LiveSeatClass::getByCondition(['mainId' => $mainId], true);
+        if (!empty($has)) {
+            util::stop('已经有了');
+        }
+        for ($i = 1; $i <= 66; $i++) {
+            $data = [
+                'mainId' => $mainId,
+                'no' => $i,
+            ];
+            LiveSeatClass::add($data, true);
+        }
+    }
+
+}