| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace console\controllers;
- use bizGhs\live\classes\LiveSeatClass;
- use common\components\util;
- use yii\console\Controller;
- use Yii;
- class LiveController extends Controller
- {
- 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);
- }
- }
- }
|