|
|
@@ -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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|