public function actionMapUpdateAll() { $transaction = Yii::$app->db->beginTransaction(); PeriodMap::deleteAll(); $this->mapUpdateRegular(); $this->mapUpdateGachi(); $transaction->commit(); }
public function actionMapUpdateAll() { $transaction = Yii::$app->db->beginTransaction(); PeriodMap::deleteAll(); SplatfestMap::deleteAll(['splatfest_id' => array_map(function (Splatfest $fest) { return $fest->id; }, Splatfest::find()->innerJoinWith(['region'])->andWhere(['{{region}}.[[key]]' => 'jp'])->all())]); $this->mapUpdateRegular(); $this->mapUpdateGachi(); $this->mapUpdateSplatfest(); $transaction->commit(); }