id; $ext = ShopExtClass::getByCondition(['shopId' => $shopId]); if (empty($ext)) { $extData = [ 'shopId' => $shopId ]; ShopExtClass::add($extData); } } } } }