LiveController.php 749 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace console\controllers;
  3. use bizGhs\live\classes\LiveSeatClass;
  4. use common\components\util;
  5. use yii\console\Controller;
  6. use Yii;
  7. class LiveController extends Controller
  8. {
  9. public $sjId, $shopId, $sj;
  10. public function actionSeat()
  11. {
  12. if (getenv('YII_ENV') == 'production') {
  13. $mainId = 33852;
  14. } else {
  15. $mainId = 644;
  16. }
  17. $has = LiveSeatClass::getByCondition(['mainId' => $mainId], true);
  18. if (!empty($has)) {
  19. util::stop('已经有了');
  20. }
  21. for ($i = 1; $i <= 66; $i++) {
  22. $data = [
  23. 'mainId' => $mainId,
  24. 'no' => $i,
  25. ];
  26. LiveSeatClass::add($data, true);
  27. }
  28. }
  29. }